魏超 5 年前
父节点
当前提交
a39ca734ec

+ 24
- 0
src/main/java/com/huiju/estateagents/controller/TaNewsController.java 查看文件

13
 import com.huiju.estateagents.service.ITaNewsService;
13
 import com.huiju.estateagents.service.ITaNewsService;
14
 import com.huiju.estateagents.service.ITaPersonService;
14
 import com.huiju.estateagents.service.ITaPersonService;
15
 import com.huiju.estateagents.service.ITaSaveService;
15
 import com.huiju.estateagents.service.ITaSaveService;
16
+import io.swagger.annotations.ApiImplicitParam;
17
+import io.swagger.annotations.ApiImplicitParams;
18
+import io.swagger.annotations.ApiOperation;
16
 import org.checkerframework.checker.units.qual.A;
19
 import org.checkerframework.checker.units.qual.A;
17
 import org.slf4j.Logger;
20
 import org.slf4j.Logger;
18
 import org.slf4j.LoggerFactory;
21
 import org.slf4j.LoggerFactory;
62
      * @param pageSize
65
      * @param pageSize
63
      * @return
66
      * @return
64
      */
67
      */
68
+    @ApiOperation(value = "资讯列表", notes = "资讯列表")
69
+    @ApiImplicitParams({
70
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageNum", paramType = "query",value = "第几页"),
71
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageSize", paramType = "query",value = "一页多少行"),
72
+            @ApiImplicitParam(dataTypeClass = String.class, name = "buildingId", paramType = "query",value = "项目id"),
73
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "newsTypeId", paramType = "query",value = "资讯类型id"),
74
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "newsStatus", paramType = "query",value = "状态")
75
+    })
65
     @RequestMapping(value="/admin/taNews",method= RequestMethod.GET)
76
     @RequestMapping(value="/admin/taNews",method= RequestMethod.GET)
66
     public ResponseBean taNewsList(HttpServletRequest request,
77
     public ResponseBean taNewsList(HttpServletRequest request,
67
                                    @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
78
                                    @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
108
      * @param taNews 实体对象
119
      * @param taNews 实体对象
109
      * @return
120
      * @return
110
      */
121
      */
122
+    @ApiOperation(value = "保存资讯", notes = "保存资讯")
123
+    @ApiImplicitParams({
124
+            @ApiImplicitParam(dataType = "TaNews", name = "taNews", paramType = "body",value = "资讯详细数据")
125
+    })
111
     @RequestMapping(value="/admin/taNews",method= RequestMethod.POST)
126
     @RequestMapping(value="/admin/taNews",method= RequestMethod.POST)
112
     public ResponseBean taNewsAdd(@RequestBody TaNews taNews, HttpServletRequest request){
127
     public ResponseBean taNewsAdd(@RequestBody TaNews taNews, HttpServletRequest request){
113
         Integer cityId = iTaBuildingService.getCityById(taNews.getBuildingId());
128
         Integer cityId = iTaBuildingService.getCityById(taNews.getBuildingId());
134
      * @param taNews 实体对象
149
      * @param taNews 实体对象
135
      * @return
150
      * @return
136
      */
151
      */
152
+    @ApiOperation(value = "修改资讯", notes = "修改资讯")
153
+    @ApiImplicitParams({
154
+            @ApiImplicitParam(dataType = "TaNews", name = "taNews", paramType = "body",value = "资讯数据"),
155
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "taNews", paramType = "path", value = "资讯id")
156
+    })
137
     @RequestMapping(value="/admin/taNews/{id}",method= RequestMethod.PUT)
157
     @RequestMapping(value="/admin/taNews/{id}",method= RequestMethod.PUT)
138
     public ResponseBean taNewsUpdate(@PathVariable Integer id,
158
     public ResponseBean taNewsUpdate(@PathVariable Integer id,
139
                                         @RequestBody TaNews taNews,
159
                                         @RequestBody TaNews taNews,
150
      * 根据id查询对象
170
      * 根据id查询对象
151
      * @param id  实体ID
171
      * @param id  实体ID
152
      */
172
      */
173
+    @ApiOperation(value = "咨询详情", notes = "咨询详情")
174
+    @ApiImplicitParams({
175
+            @ApiImplicitParam(dataType = "Integer", name = "id", paramType = "path",value = "资讯id")
176
+    })
153
     @RequestMapping(value="/admin/taNews/{id}",method= RequestMethod.GET)
177
     @RequestMapping(value="/admin/taNews/{id}",method= RequestMethod.GET)
154
     public ResponseBean taNewsGet(@PathVariable Integer id){
178
     public ResponseBean taNewsGet(@PathVariable Integer id){
155
         ResponseBean responseBean = iTaNewsService.getTaNewsById(id);
179
         ResponseBean responseBean = iTaNewsService.getTaNewsById(id);

+ 24
- 0
src/main/java/com/huiju/estateagents/controller/TaNewsTypeController.java 查看文件

7
 import com.huiju.estateagents.base.ResponseBean;
7
 import com.huiju.estateagents.base.ResponseBean;
8
 import com.huiju.estateagents.entity.TaNewsType;
8
 import com.huiju.estateagents.entity.TaNewsType;
9
 import com.huiju.estateagents.service.ITaNewsTypeService;
9
 import com.huiju.estateagents.service.ITaNewsTypeService;
10
+import io.swagger.annotations.Api;
11
+import io.swagger.annotations.ApiImplicitParam;
12
+import io.swagger.annotations.ApiImplicitParams;
13
+import io.swagger.annotations.ApiOperation;
10
 import org.slf4j.Logger;
14
 import org.slf4j.Logger;
11
 import org.slf4j.LoggerFactory;
15
 import org.slf4j.LoggerFactory;
12
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.beans.factory.annotation.Autowired;
30
  */
34
  */
31
 @RestController
35
 @RestController
32
 @RequestMapping("/api")
36
 @RequestMapping("/api")
37
+@Api(value = "资讯类型", tags = "资讯类型")
33
 public class TaNewsTypeController extends BaseController {
38
 public class TaNewsTypeController extends BaseController {
34
 
39
 
35
     private final Logger logger = LoggerFactory.getLogger(TaNewsTypeController.class);
40
     private final Logger logger = LoggerFactory.getLogger(TaNewsTypeController.class);
44
      * @param pageSize
49
      * @param pageSize
45
      * @return
50
      * @return
46
      */
51
      */
52
+    @ApiOperation(value = "查询资讯类型", notes = "查询资讯类型")
53
+    @ApiImplicitParams({
54
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageNum", paramType = "query",value = "第几页"),
55
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageSize", paramType = "query",value = "一页多少行"),
56
+            @ApiImplicitParam(dataTypeClass = String.class, name = "buildingId", paramType = "query",value = "项目id")
57
+    })
47
     @RequestMapping(value="/admin/taNewsType",method= RequestMethod.GET)
58
     @RequestMapping(value="/admin/taNewsType",method= RequestMethod.GET)
48
     public ResponseBean taNewsTypeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
59
     public ResponseBean taNewsTypeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
49
                                        @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
60
                                        @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
58
      * @param taNewsType 实体对象
69
      * @param taNewsType 实体对象
59
      * @return
70
      * @return
60
      */
71
      */
72
+    @ApiOperation(value = "保存资讯类型", notes = "保存资讯类型")
73
+    @ApiImplicitParams({
74
+            @ApiImplicitParam(dataType = "TaNewsType", name = "taNewsType", paramType = "body",value = "资讯类型数据")
75
+    })
61
     @RequestMapping(value="/admin/taNewsType",method= RequestMethod.POST)
76
     @RequestMapping(value="/admin/taNewsType",method= RequestMethod.POST)
62
     public ResponseBean taNewsTypeAdd(@RequestBody TaNewsType taNewsType, HttpServletRequest request){
77
     public ResponseBean taNewsTypeAdd(@RequestBody TaNewsType taNewsType, HttpServletRequest request){
63
         ResponseBean responseBean = iTaNewsTypeService.addTaNewsType(taNewsType, getOrgId(request));
78
         ResponseBean responseBean = iTaNewsTypeService.addTaNewsType(taNewsType, getOrgId(request));
81
      * @param taNewsType 实体对象
96
      * @param taNewsType 实体对象
82
      * @return
97
      * @return
83
      */
98
      */
99
+    @ApiOperation(value = "修改资讯类型", notes = "根据ID修改资讯类型")
100
+    @ApiImplicitParams({
101
+            @ApiImplicitParam(dataType = "TaNewsType", name = "taNewsType", paramType = "body",value = "资讯类型数据"),
102
+            @ApiImplicitParam(dataType = "Integer", name = "id", paramType = "path",value = "资讯id")
103
+    })
84
     @RequestMapping(value="/admin/taNewsType/{id}",method= RequestMethod.PUT)
104
     @RequestMapping(value="/admin/taNewsType/{id}",method= RequestMethod.PUT)
85
     public ResponseBean taNewsTypeUpdate(@PathVariable Integer id,
105
     public ResponseBean taNewsTypeUpdate(@PathVariable Integer id,
86
                                         @RequestBody TaNewsType taNewsType, HttpServletRequest request){
106
                                         @RequestBody TaNewsType taNewsType, HttpServletRequest request){
94
      * 根据id查询对象
114
      * 根据id查询对象
95
      * @param id  实体ID
115
      * @param id  实体ID
96
      */
116
      */
117
+    @ApiOperation(value = "咨询类型详情", notes = "咨询类型详情")
118
+    @ApiImplicitParams({
119
+            @ApiImplicitParam(dataType = "Integer", name = "id", paramType = "path",value = "资讯id")
120
+    })
97
     @RequestMapping(value="/admin/taNewsType/{id}",method= RequestMethod.GET)
121
     @RequestMapping(value="/admin/taNewsType/{id}",method= RequestMethod.GET)
98
     public ResponseBean taNewsTypeGet(@PathVariable Integer id){
122
     public ResponseBean taNewsTypeGet(@PathVariable Integer id){
99
         ResponseBean responseBean = iTaNewsTypeService.getTaNewsTypeById(id);
123
         ResponseBean responseBean = iTaNewsTypeService.getTaNewsTypeById(id);