Selaa lähdekoodia

公告轮播图

dingxin 6 vuotta sitten
vanhempi
commit
9b0ae54e58

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Näytä tiedosto

@@ -59,4 +59,18 @@ public class SocialController {
59 59
         responseBean.addSuccess(announcementList);
60 60
         return responseBean;
61 61
     }
62
+
63
+    @ApiOperation(value = "获取公告轮播图", notes = "获取公告轮播图")
64
+    @ApiImplicitParams({
65
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "小区id"),
66
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "sum",value = "显示的条数")
67
+    })
68
+    @RequestMapping(value = "/announcement/announcementCarouselImg/{communityId}",method = RequestMethod.GET)
69
+    public ResponseBean getAnnouncement(@PathVariable(value = "communityId")Integer communityId ,@RequestParam("sum") Integer sum){
70
+        ResponseBean responseBean = new ResponseBean();
71
+        List<TpAnnouncement> agreement = socialServiceI.getAnnouncement(communityId,sum);
72
+        responseBean.addSuccess(agreement);
73
+        return responseBean;
74
+    }
75
+
62 76
 }

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Näytä tiedosto

@@ -56,4 +56,6 @@ public class UserController {
56 56
 
57 57
     }
58 58
 
59
+
60
+
59 61
 }

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpAnnouncementMapper.java Näytä tiedosto

@@ -22,4 +22,6 @@ public interface TpAnnouncementMapper {
22 22
     int updateByPrimaryKey(TpAnnouncement record);
23 23
 	
24 24
 	List<TpAnnouncement> getAnnouncements(@Param("communityId") Integer communityId,@Param("title") String title);
25
+
26
+    List<TpAnnouncement> getAnnouncement(@Param("communityId")Integer communityId, @Param("sum")Integer sum);
25 27
 }

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java Näytä tiedosto

@@ -21,4 +21,12 @@ public interface SocialServiceI {
21 21
 	 * @return
22 22
 	 */
23 23
 	List<TpAnnouncement> getAnnouncements(Integer communityId, String title, Integer pageNum, Integer pageSize);
24
+
25
+	/**
26
+	 * 公告轮播图
27
+	 * @param communityId
28
+	 * @param sum
29
+	 * @return
30
+	 */
31
+	List<TpAnnouncement> getAnnouncement(Integer communityId, Integer sum);
24 32
 }

+ 12
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Näytä tiedosto

@@ -42,4 +42,16 @@ public class SocialServiceImpl implements SocialServiceI {
42 42
         List<TpAnnouncement> announcementList = tpAnnouncementMapper.getAnnouncements(communityId,title);
43 43
         return announcementList;
44 44
     }
45
+    /**
46
+     * 根据当前小区ID查出轮播图
47
+     * @param communityId 当前小区ID
48
+     * @param sum 当前查询总数
49
+     * @return
50
+     */
51
+    @Override
52
+    public List<TpAnnouncement> getAnnouncement(Integer communityId, Integer sum) {
53
+        List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId ,sum);
54
+        return listAnnouncement;
55
+    }
56
+
45 57
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpAnnouncementMapper.xml Näytä tiedosto

@@ -209,4 +209,11 @@
209 209
       a.sort,
210 210
       a.create_date DESC
211 211
   </select>
212
+
213
+  <select id="getAnnouncement" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpAnnouncement">
214
+    select
215
+    <include refid="Base_Column_List" />
216
+    from tp_announcement
217
+    where community_id = #{communityId,jdbcType=INTEGER}  and status=1 limit  #{sum,jdbcType=INTEGER}
218
+  </select>
212 219
 </mapper>

BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/SingleRedisTemplate.class Näytä tiedosto


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/HttpClientUtils.class Näytä tiedosto