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