springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/enums/PresetPictureType.java
New file @@ -0,0 +1,15 @@ package com.panzhihua.common.enums; /** * @title: PresetPictureType * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 预设图片类型 * @author: hans * @date: 2021/11/23 17:31 */ public class PresetPictureType { /** * 物业宣传 */ public static Integer PROPERTY_PUBLICITY = 1; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActPictureLibraryVO.java
New file @@ -0,0 +1,22 @@ package com.panzhihua.common.model.vos.community; import java.util.List; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @title: ComActPictureLibraryVO * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 公共预设图库信息 * @author: hans * @date: 2021/11/23 17:16 */ @Data @ApiModel("公共预设图库信息") public class ComActPictureLibraryVO { @ApiModelProperty("操作内容") private List<String> presetPictures; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -7272,4 +7272,13 @@ */ @PostMapping("/reserve/admin/homeQuarantine/export") R exportHomeQuarantine(@RequestBody PageReserveRegisterDetailedAdminDTO pageReserveRegisterDetailedAdminDTO); /** * 获取预设图片 * @param type * @param subtype * @return */ @GetMapping("/picture/library/get") R getPresetPictureLibrary(@RequestParam("type") Integer type, @RequestParam("subtype") Integer subtype); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComPropertyPublicityApi.java
@@ -13,11 +13,12 @@ import org.springframework.web.bind.annotation.RestController; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.enums.PresetPictureType; import com.panzhihua.common.model.dtos.community.ComPropertyPublicityDTO; import com.panzhihua.common.model.dtos.community.PageComPropertyPublicityDTO; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComMngVillageVO; import com.panzhihua.common.model.vos.community.ComActPictureLibraryVO; import com.panzhihua.common.model.vos.community.ComPropertyPublicityVO; import com.panzhihua.common.model.vos.community.ComPropertyVO; import com.panzhihua.common.service.community.CommunityService; @@ -92,4 +93,11 @@ public R listProperty(@RequestParam(value = "villageId", required = false) Long villageId) { return communityService.listProperty(villageId, getCommunityId()); } @ApiOperation(value = "获取预设图库",response = ComActPictureLibraryVO.class) @GetMapping("/picture/library") @ApiImplicitParam(name = "publicityType", value = "宣传类型(1.停水通知 2.停电通知 3.停气通知 4.物业公告 5.优秀业主)", required = true) public R getPresetPictureLibrary(@RequestParam("publicityType") Integer publicityType) { return communityService.getPresetPictureLibrary(PresetPictureType.PROPERTY_PUBLICITY, publicityType); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActPictureLibraryApi.java
New file @@ -0,0 +1,37 @@ package com.panzhihua.service_community.api; import javax.annotation.Resource; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.service.ComActPictureLibraryService; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.panzhihua.common.service.community.CommunityService; import lombok.extern.slf4j.Slf4j; /** * @title: ComActPictureLibraryApi * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 公共图库 * @author: hans * @date: 2021/11/23 16:54 */ @Slf4j @RestController @RequestMapping("/picture/library") public class ComActPictureLibraryApi { @Resource private ComActPictureLibraryService comActPictureLibraryService; @GetMapping("/get") @ApiOperation("获取预设图库") public R getPresetPictureLibrary(@RequestParam("type") Integer type, @RequestParam("subtype") Integer subtype) { return comActPictureLibraryService.getPresetPictureLibrary(type, subtype); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActPictureLibraryDAO.java
New file @@ -0,0 +1,25 @@ package com.panzhihua.service_community.dao; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; /** * @title: ComActPictureLibraryDAO * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 图库预设mapper * @author: hans * @date: 2021/11/23 17:05 */ @Mapper public interface ComActPictureLibraryDAO { /** * 获取预设图库 * @param type * @param subtype * @return */ List<String> getPresetPictureLibrary(@Param("type") Integer type, @Param("subtype") Integer subtype); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActPictureLibraryService.java
New file @@ -0,0 +1,21 @@ package com.panzhihua.service_community.service; import com.panzhihua.common.model.vos.R; /** * @title: ComActPictureLibraryService * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 公共预设图库服务类 * @author: hans * @date: 2021/11/23 17:01 */ public interface ComActPictureLibraryService { /** * 获取预设图库 * @param type * @param subtype * @return */ R getPresetPictureLibrary(Integer type, Integer subtype); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActPictureLibraryServiceImpl.java
New file @@ -0,0 +1,38 @@ package com.panzhihua.service_community.service.impl; import javax.annotation.Resource; import com.panzhihua.common.model.vos.community.ComActPictureLibraryVO; import org.springframework.stereotype.Service; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.dao.ComActPictureLibraryDAO; import com.panzhihua.service_community.service.ComActPictureLibraryService; /** * @title: ComActPictureLibraryServiceImpl * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 公共预设图库服务实现类 * @author: hans * @date: 2021/11/23 17:03 */ @Service public class ComActPictureLibraryServiceImpl implements ComActPictureLibraryService { @Resource private ComActPictureLibraryDAO comActPictureLibraryDAO; /** * 获取预设图库 * @param type * @param subtype * @return */ @Override public R getPresetPictureLibrary(Integer type, Integer subtype) { ComActPictureLibraryVO libraryVO = new ComActPictureLibraryVO(); libraryVO.setPresetPictures(comActPictureLibraryDAO.getPresetPictureLibrary(type, subtype)); return R.ok(libraryVO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActPictureLibrary.xml
New file @@ -0,0 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.service_community.dao.ComActPictureLibraryDAO"> <select id="getPresetPictureLibrary" resultType="java.lang.String"> SELECT upload_picture FROM com_act_picture_library t1 LEFT JOIN com_act_library_type t2 ON t1.library_type_id = t2.id WHERE t2.type = #{type} AND t2.subtype = #{subtype} </select> </mapper>