傅行帆 6 years ago
parent
commit
400d0de692

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java View File

1
 package com.community.huiju.controller;
1
 package com.community.huiju.controller;
2
 
2
 
3
+import com.community.commom.constant.Constant;
3
 import com.community.commom.mode.ResponseBean;
4
 import com.community.commom.mode.ResponseBean;
4
 import com.community.huiju.model.TpAnnouncement;
5
 import com.community.huiju.model.TpAnnouncement;
6
+import com.community.huiju.model.TpMessage;
5
 import com.community.huiju.service.SocialServiceI;
7
 import com.community.huiju.service.SocialServiceI;
6
 import io.swagger.annotations.Api;
8
 import io.swagger.annotations.Api;
7
 import io.swagger.annotations.ApiImplicitParam;
9
 import io.swagger.annotations.ApiImplicitParam;
11
 import org.springframework.cloud.context.config.annotation.RefreshScope;
13
 import org.springframework.cloud.context.config.annotation.RefreshScope;
12
 import org.springframework.web.bind.annotation.*;
14
 import org.springframework.web.bind.annotation.*;
13
 
15
 
16
+import java.util.List;
17
+
14
 /**
18
 /**
15
  * @author weichaochao
19
  * @author weichaochao
16
  * @Title: SocialController
20
  * @Title: SocialController
34
         responseBean.addSuccess(tpAnnouncement);
38
         responseBean.addSuccess(tpAnnouncement);
35
         return responseBean;
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 View File

1
 package com.community.huiju.service;
1
 package com.community.huiju.service;
2
 
2
 
3
 import com.community.huiju.model.TpAnnouncement;
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
  * @author weichaochao
9
  * @author weichaochao
9
  */
12
  */
10
 public interface SocialServiceI {
13
 public interface SocialServiceI {
11
     TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId);
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 View File

2
 
2
 
3
 import com.community.huiju.dao.TpAnnouncementMapper;
3
 import com.community.huiju.dao.TpAnnouncementMapper;
4
 import com.community.huiju.model.TpAnnouncement;
4
 import com.community.huiju.model.TpAnnouncement;
5
+import com.community.huiju.model.TpMessage;
5
 import com.community.huiju.service.SocialServiceI;
6
 import com.community.huiju.service.SocialServiceI;
6
 import org.springframework.beans.factory.annotation.Autowired;
7
 import org.springframework.beans.factory.annotation.Autowired;
7
 import org.springframework.stereotype.Service;
8
 import org.springframework.stereotype.Service;
8
 
9
 
10
+import java.util.List;
11
+
9
 /**
12
 /**
10
  * @author admin
13
  * @author admin
11
  * @Title: SocialServiceImpl
14
  * @Title: SocialServiceImpl
20
     public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
23
     public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
21
         return tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
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
File diff suppressed because it is too large
View File


+ 289
- 277
文档/MYSQL/smartCommunity.pdm
File diff suppressed because it is too large
View File


BIN
文档/需求/app接口需求-第二版.xlsx View File