|
@@ -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
|
}
|