傅行帆 6 年前
父节点
当前提交
400d0de692

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java 查看文件

@@ -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.TpAnnouncement;
6
+import com.community.huiju.model.TpMessage;
5 7
 import com.community.huiju.service.SocialServiceI;
6 8
 import io.swagger.annotations.Api;
7 9
 import io.swagger.annotations.ApiImplicitParam;
@@ -11,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
11 13
 import org.springframework.cloud.context.config.annotation.RefreshScope;
12 14
 import org.springframework.web.bind.annotation.*;
13 15
 
16
+import java.util.List;
17
+
14 18
 /**
15 19
  * @author weichaochao
16 20
  * @Title: SocialController
@@ -34,4 +38,16 @@ public class SocialController {
34 38
         responseBean.addSuccess(tpAnnouncement);
35 39
         return responseBean;
36 40
     }
41
+    
42
+    @ApiOperation(value = "按小区获取分页活动列表", notes = "按小区获取分页活动列表")
43
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
44
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
45
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
46
+    @RequestMapping(value = "/announcements/{communityId}",method = RequestMethod.GET)
47
+    public ResponseBean getAnnouncements(@PathVariable Integer communityId,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
48
+        ResponseBean responseBean = new ResponseBean();
49
+        List<TpMessage> upcomingList = socialServiceI.getAnnouncements(communityId,pageNum,pageSize);
50
+        responseBean.addSuccess(upcomingList);
51
+        return responseBean;
52
+    }
37 53
 }

+ 12
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java 查看文件

@@ -1,6 +1,9 @@
1 1
 package com.community.huiju.service;
2 2
 
3 3
 import com.community.huiju.model.TpAnnouncement;
4
+import com.community.huiju.model.TpMessage;
5
+
6
+import java.util.List;
4 7
 
5 8
 /**
6 9
  * @author weichaochao
@@ -9,4 +12,13 @@ import com.community.huiju.model.TpAnnouncement;
9 12
  */
10 13
 public interface SocialServiceI {
11 14
     TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId);
15
+	
16
+	/**
17
+	 * 分页获取活动列表
18
+	 * @param communityId
19
+	 * @param pageNum
20
+	 * @param pageSize
21
+	 * @return
22
+	 */
23
+	List<TpMessage> getAnnouncements(Integer communityId, Integer pageNum, Integer pageSize);
12 24
 }

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

@@ -2,10 +2,13 @@ package com.community.huiju.service.impl;
2 2
 
3 3
 import com.community.huiju.dao.TpAnnouncementMapper;
4 4
 import com.community.huiju.model.TpAnnouncement;
5
+import com.community.huiju.model.TpMessage;
5 6
 import com.community.huiju.service.SocialServiceI;
6 7
 import org.springframework.beans.factory.annotation.Autowired;
7 8
 import org.springframework.stereotype.Service;
8 9
 
10
+import java.util.List;
11
+
9 12
 /**
10 13
  * @author admin
11 14
  * @Title: SocialServiceImpl
@@ -20,4 +23,17 @@ public class SocialServiceImpl implements SocialServiceI {
20 23
     public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
21 24
         return tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
22 25
     }
26
+    
27
+    /**
28
+     * 分页获取活动列表
29
+     * @param communityId
30
+     * @param pageNum
31
+     * @param pageSize
32
+     * @return
33
+     */
34
+    @Override
35
+    public List<TpMessage> getAnnouncements(Integer communityId, Integer pageNum, Integer pageSize) {
36
+        Integer userId = 1;
37
+        return null;
38
+    }
23 39
 }

+ 289
- 277
文档/MYSQL/smartCommunity.pdb
文件差异内容过多而无法显示
查看文件


+ 289
- 277
文档/MYSQL/smartCommunity.pdm
文件差异内容过多而无法显示
查看文件


二进制
文档/需求/app接口需求-第二版.xlsx 查看文件