|
@@ -6,13 +6,21 @@ import com.community.huiju.dao.TpSocialViewMapper;
|
6
|
6
|
import com.community.huiju.model.TpAnnouncement;
|
7
|
7
|
import com.community.huiju.model.TpSocialView;
|
8
|
8
|
import com.community.huiju.service.SocialServiceI;
|
9
|
|
-import io.swagger.models.auth.In;
|
|
9
|
+import com.community.huiju.dao.TpActivityMapper;
|
|
10
|
+import com.community.huiju.dao.TpAnnouncementMapper;
|
|
11
|
+import com.community.huiju.model.TpActivity;
|
|
12
|
+import com.community.huiju.model.TpAnnouncement;
|
|
13
|
+import com.community.huiju.model.TpMessage;
|
|
14
|
+import com.community.huiju.service.SocialServiceI;
|
|
15
|
+import com.github.pagehelper.PageHelper;
|
10
|
16
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
17
|
import org.springframework.stereotype.Service;
|
12
|
18
|
import org.springframework.transaction.annotation.Transactional;
|
13
|
19
|
|
14
|
20
|
import java.util.Date;
|
15
|
21
|
|
|
22
|
+import java.util.List;
|
|
23
|
+
|
16
|
24
|
/**
|
17
|
25
|
* @author weichaochao
|
18
|
26
|
* @Title: SocialServiceImpl
|
|
@@ -23,9 +31,13 @@ public class SocialServiceImpl implements SocialServiceI {
|
23
|
31
|
|
24
|
32
|
@Autowired
|
25
|
33
|
private TpAnnouncementMapper tpAnnouncementMapper;
|
|
34
|
+
|
26
|
35
|
@Autowired
|
27
|
36
|
private TpSocialViewMapper tpSocialViewMapper;
|
28
|
37
|
|
|
38
|
+ @Autowired
|
|
39
|
+ private TpActivityMapper tpActivityMapper;
|
|
40
|
+
|
29
|
41
|
@Override
|
30
|
42
|
@Transactional
|
31
|
43
|
public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
|
|
@@ -47,8 +59,41 @@ public class SocialServiceImpl implements SocialServiceI {
|
47
|
59
|
return tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
|
48
|
60
|
}
|
49
|
61
|
|
|
62
|
+ /**
|
|
63
|
+ * 分页获取公告列表
|
|
64
|
+ * @param communityId
|
|
65
|
+ * @param title
|
|
66
|
+ * @param pageNum
|
|
67
|
+ * @param pageSize
|
|
68
|
+ * @return
|
|
69
|
+ */
|
50
|
70
|
@Override
|
51
|
|
- public void insertSocialView(TpSocialView tpSocialView) {
|
52
|
|
-
|
|
71
|
+ public List<TpAnnouncement> getAnnouncements(Integer communityId,String title, Integer pageNum, Integer pageSize) {
|
|
72
|
+ pageNum = null == pageNum ? 1 : pageNum;
|
|
73
|
+ pageSize = null == pageSize ? 10 : pageSize;
|
|
74
|
+ //使用分页插件
|
|
75
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
76
|
+ // 获取数据
|
|
77
|
+ List<TpAnnouncement> announcementList = tpAnnouncementMapper.getAnnouncements(communityId,title);
|
|
78
|
+ return announcementList;
|
|
79
|
+ }
|
|
80
|
+
|
|
81
|
+ /**
|
|
82
|
+ * 分页获取活动列表
|
|
83
|
+ * @param communityId
|
|
84
|
+ * @param title
|
|
85
|
+ * @param pageNum
|
|
86
|
+ * @param pageSize
|
|
87
|
+ * @return
|
|
88
|
+ */
|
|
89
|
+ @Override
|
|
90
|
+ public List<TpActivity> getActivitys(Integer communityId, String title, Integer pageNum, Integer pageSize) {
|
|
91
|
+ pageNum = null == pageNum ? 1 : pageNum;
|
|
92
|
+ pageSize = null == pageSize ? 10 : pageSize;
|
|
93
|
+ //使用分页插件
|
|
94
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
95
|
+ // 获取数据
|
|
96
|
+ List<TpActivity> activityList = tpActivityMapper.getActivitys(communityId,title);
|
|
97
|
+ return activityList;
|
53
|
98
|
}
|
54
|
99
|
}
|