eafc4bf9b06c58abb386f47d3fb931b87851b790
[dcaegen2/services.git] /
1 /*\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP : DataLake\r
4  * ================================================================================\r
5  * Copyright 2019 China Mobile\r
6  *=================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  *     http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.onap.datalake.feeder.service;\r
22 \r
23 import java.util.ArrayList;\r
24 import java.util.List;\r
25 \r
26 import org.onap.datalake.feeder.domain.DesignType;\r
27 import org.onap.datalake.feeder.repository.DesignTypeRepository;\r
28 import org.springframework.beans.factory.annotation.Autowired;\r
29 import org.springframework.stereotype.Service;\r
30 \r
31 /**\r
32  * Service for designTypes\r
33  *\r
34  * @author guochunmeng\r
35  */\r
36 @Service\r
37 public class DesignTypeService {\r
38         \r
39         @Autowired\r
40         DesignTypeRepository designTypeRepository;\r
41         \r
42         public List<String> listNames(){\r
43                 \r
44                 List<String> names = new ArrayList<>();\r
45                 \r
46                 Iterable<DesignType> ret = designTypeRepository.findAll();\r
47                 \r
48                 for(DesignType designType:ret) {\r
49                         \r
50                         names.add(designType.getName());\r
51                         \r
52                 }\r
53                 \r
54                 return names;\r
55         }\r
56 }\r