魏熙美 преди 6 години
родител
ревизия
717fbf9a06

+ 24
- 1
whole-estate/src/main/java/com/example/wholeestate/controller/EncyclopediaController.java Целия файл

@@ -2,9 +2,19 @@ package com.example.wholeestate.controller;
2 2
 
3 3
 
4 4
 import com.example.wholeestate.common.base.BaseController;
5
+import com.example.wholeestate.common.resp.ResponseBean;
6
+import com.example.wholeestate.dao.EncyclopediaMapper;
7
+import com.example.wholeestate.model.Encyclopedia;
8
+import com.example.wholeestate.service.IEncyclopediaService;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
5 12
 import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
6 14
 import org.springframework.web.bind.annotation.RestController;
7 15
 
16
+import java.util.List;
17
+
8 18
 /**
9 19
  * <p>
10 20
  *  前端控制器
@@ -14,7 +24,20 @@ import org.springframework.web.bind.annotation.RestController;
14 24
  * @since 2019-03-27
15 25
  */
16 26
 @RestController
17
-@RequestMapping("/ta/encyclopedia")
27
+@RequestMapping("/")
28
+@Api(value = "百科全书", description = "百科全书")
18 29
 public class EncyclopediaController extends BaseController {
19 30
 
31
+    @Autowired
32
+    private IEncyclopediaService iEncyclopediaService;
33
+
34
+    @RequestMapping(value = "/encyclopedia/list", method = RequestMethod.GET)
35
+    @ApiOperation(value = "获取所有数据")
36
+    private ResponseBean getList() {
37
+        ResponseBean responseBean = new ResponseBean();
38
+        List<Encyclopedia> encyclopediaList = iEncyclopediaService.list();
39
+        responseBean.addSuccess(encyclopediaList);
40
+        return responseBean;
41
+    }
42
+
20 43
 }

+ 23
- 1
whole-estate/src/main/java/com/example/wholeestate/controller/EncyclopediaTypeController.java Целия файл

@@ -2,9 +2,18 @@ package com.example.wholeestate.controller;
2 2
 
3 3
 
4 4
 import com.example.wholeestate.common.base.BaseController;
5
+import com.example.wholeestate.common.resp.ResponseBean;
6
+import com.example.wholeestate.model.EncyclopediaType;
7
+import com.example.wholeestate.service.IEncyclopediaTypeService;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.beans.factory.annotation.Autowired;
5 11
 import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RequestMethod;
6 13
 import org.springframework.web.bind.annotation.RestController;
7 14
 
15
+import java.util.List;
16
+
8 17
 /**
9 18
  * <p>
10 19
  *  前端控制器
@@ -14,7 +23,20 @@ import org.springframework.web.bind.annotation.RestController;
14 23
  * @since 2019-03-27
15 24
  */
16 25
 @RestController
17
-@RequestMapping("/ta/encyclopedia-type")
26
+@RequestMapping("/")
27
+@Api(value = "百科全书类型", description = "百科全书类型")
18 28
 public class EncyclopediaTypeController extends BaseController {
19 29
 
30
+    @Autowired
31
+    private IEncyclopediaTypeService iEncyclopediaTypeService;
32
+
33
+    @RequestMapping(value = "/encyclopedia/type/list", method = RequestMethod.GET)
34
+    @ApiOperation(value = "获取所有数据")
35
+    private ResponseBean getList() {
36
+        ResponseBean responseBean = new ResponseBean();
37
+        List<EncyclopediaType> encyclopediaList = iEncyclopediaTypeService.list();
38
+        responseBean.addSuccess(encyclopediaList);
39
+        return responseBean;
40
+    }
41
+
20 42
 }