|
@@ -1,7 +1,9 @@
|
1
|
1
|
package com.community.huiju.controller;
|
2
|
2
|
|
|
3
|
+import com.community.commom.constant.Constant;
|
3
|
4
|
import com.community.commom.mode.ResponseBean;
|
4
|
5
|
import com.community.huiju.model.ToCommunities;
|
|
6
|
+import com.community.huiju.model.TpMessage;
|
5
|
7
|
import com.community.huiju.service.MessageServiceI;
|
6
|
8
|
import io.swagger.annotations.Api;
|
7
|
9
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -9,6 +11,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
9
|
11
|
import io.swagger.annotations.ApiOperation;
|
10
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
13
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
14
|
+import org.springframework.web.bind.annotation.PathVariable;
|
12
|
15
|
import org.springframework.web.bind.annotation.RequestMapping;
|
13
|
16
|
import org.springframework.web.bind.annotation.RequestMethod;
|
14
|
17
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -30,12 +33,37 @@ public class MessageController {
|
30
|
33
|
@Autowired
|
31
|
34
|
private MessageServiceI messageService;
|
32
|
35
|
|
33
|
|
- @ApiOperation(value = "根据小区名获取小区列表", notes = "根据小区名获取小区列表")
|
34
|
|
- @RequestMapping(value = "/message/total",method = RequestMethod.GET)
|
35
|
|
- public ResponseBean getMessageTotal(){
|
|
36
|
+ @ApiOperation(value = "按小区获取消息总数", notes = "按小区获取个人消息总数")
|
|
37
|
+ @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id") })
|
|
38
|
+ @RequestMapping(value = "/message/{communityId}/total",method = RequestMethod.GET)
|
|
39
|
+ public ResponseBean getMessageTotal(@PathVariable Integer communityId){
|
36
|
40
|
ResponseBean responseBean = new ResponseBean();
|
37
|
|
- Map<String,Object> totalMap = messageService.getMessageTotal();
|
|
41
|
+ Map<String,Object> totalMap = messageService.getMessageTotal(communityId);
|
38
|
42
|
responseBean.addSuccess(totalMap);
|
39
|
43
|
return responseBean;
|
40
|
44
|
}
|
|
45
|
+
|
|
46
|
+ @ApiOperation(value = "按小区获取分页消息", notes = "按小区获取分页消息")
|
|
47
|
+ @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
|
|
48
|
+ @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
|
|
49
|
+ @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
|
|
50
|
+ @RequestMapping(value = "/message/{communityId}/news",method = RequestMethod.GET)
|
|
51
|
+ public ResponseBean getNews(@PathVariable Integer communityId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
|
|
52
|
+ ResponseBean responseBean = new ResponseBean();
|
|
53
|
+ List<TpMessage> newsList = messageService.getMessages(communityId,pageNum,pageSize, Constant.MODEL_TYPE_NEWS);
|
|
54
|
+ responseBean.addSuccess(newsList);
|
|
55
|
+ return responseBean;
|
|
56
|
+ }
|
|
57
|
+
|
|
58
|
+ @ApiOperation(value = "按小区获取分页待办", notes = "按小区获取分页待办")
|
|
59
|
+ @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
|
|
60
|
+ @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
|
|
61
|
+ @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
|
|
62
|
+ @RequestMapping(value = "/message/{communityId}/upcoming",method = RequestMethod.GET)
|
|
63
|
+ public ResponseBean getUpcoming(@PathVariable Integer communityId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
|
|
64
|
+ ResponseBean responseBean = new ResponseBean();
|
|
65
|
+ List<TpMessage> upcomingList = messageService.getMessages(communityId,pageNum,pageSize,Constant.MODEL_TYPE_UPCOMING);
|
|
66
|
+ responseBean.addSuccess(upcomingList);
|
|
67
|
+ return responseBean;
|
|
68
|
+ }
|
41
|
69
|
}
|