24 changed files with 672 additions and 32 deletions
			
			
		@ -0,0 +1,37 @@ | 
				
			|||
package com.epmet.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民端查看文章详情传参DTO | 
				
			|||
 * @ClassName ResiArticleDetailFormDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-04 09:20 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ResiArticleDetailFormDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = -7197489284630455909L; | 
				
			|||
 | 
				
			|||
    public interface ResiArticleDetailInternalGroup{} | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "网格Id不能为空",groups = ResiArticleDetailInternalGroup.class) | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "文章Id不能为空",groups = ResiArticleDetailInternalGroup.class) | 
				
			|||
    private String articleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 用户Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "用户Id不能为空",groups = ResiArticleDetailInternalGroup.class) | 
				
			|||
    private String userId; | 
				
			|||
} | 
				
			|||
@ -0,0 +1,52 @@ | 
				
			|||
package com.epmet.utils; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 常量类 | 
				
			|||
 * */ | 
				
			|||
public interface ModuleConstant { | 
				
			|||
    /** | 
				
			|||
     * 数据库列名 - 网格ID | 
				
			|||
     * */ | 
				
			|||
    String FIELD_GRID_ID = "GRID_ID"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 实体属性名 - 网格ID | 
				
			|||
     * */ | 
				
			|||
    String FIELD_GRID_ID_CAMEL = "gridId"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 数据库列名 - 客户ID | 
				
			|||
     * */ | 
				
			|||
    String FIELD_CUSTOMER_ID = "CUSTOMER_ID"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 实体属性名 - 客户ID | 
				
			|||
     * */ | 
				
			|||
    String FIELD_CUSTOMER_ID_CAMEL = "customerId"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 数据库列名 - 用户ID | 
				
			|||
     * */ | 
				
			|||
    String FIELD_USER_ID = "USER_ID"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 实体属性名 - 用户ID | 
				
			|||
     * */ | 
				
			|||
    String FIELD_USER_ID_CAMEL = "userId"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 数据库列名 - 文章ID | 
				
			|||
     * */ | 
				
			|||
    String FIELD_ARTICLE_ID = "ARTICLE_ID"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 实体属性名 - 文章ID | 
				
			|||
     * */ | 
				
			|||
    String FIELD_ARTICLE_ID_CAMEL = "articleId"; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章未找到异常模板 | 
				
			|||
     * */ | 
				
			|||
    String SPECIFIED_ARTICLE_NOT_FOUND_EXCEPTION_TEMPLATE = "未找到指定文章,文章Id:【%s】,发布网格Id:【%s】,可能原因:没有该文章或者请求网格不在该文章发布范围内。"; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,34 @@ | 
				
			|||
package com.epmet.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民端首页轮播查询接口DTO | 
				
			|||
 * @ClassName ArticleBannerFormDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-02 11:20 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class CommonArticleListFormDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = 5996259506950697451L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 内部错误分组 | 
				
			|||
     * */ | 
				
			|||
    public interface ArticleBannerInternalGroup{} | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户定制化条数(高级配置里的参数) | 
				
			|||
     * */ | 
				
			|||
    private Integer num; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,31 @@ | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description | 
				
			|||
 * @ClassName ArticleBannerResultDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-02 13:55 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ArticleBannerResultDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = 7764443348626371305L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章Id | 
				
			|||
     * */ | 
				
			|||
    private String articleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 封面图url | 
				
			|||
     * */ | 
				
			|||
    private String coverImg; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 标题 | 
				
			|||
     * */ | 
				
			|||
    private String title; | 
				
			|||
} | 
				
			|||
@ -0,0 +1,41 @@ | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description | 
				
			|||
 * @ClassName ArticleLatestResultDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-02 17:11 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ArticleLatestResultDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = 6953266228209247094L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章Id | 
				
			|||
     * */ | 
				
			|||
    private String articleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章封面图片url | 
				
			|||
     * */ | 
				
			|||
    private String articleCoverImg; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章标题 | 
				
			|||
     * */ | 
				
			|||
    private String articleTitle; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 发布单位名称 | 
				
			|||
     * */ | 
				
			|||
    private String publishName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 发布时间(天级别) 时间戳 | 
				
			|||
     * */ | 
				
			|||
    private String publishDate; | 
				
			|||
} | 
				
			|||
@ -1,11 +1,50 @@ | 
				
			|||
package com.epmet.controller; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.commons.tools.validator.ValidatorUtils; | 
				
			|||
import com.epmet.dto.feign.GovVoiceFeignClient; | 
				
			|||
import com.epmet.dto.form.CommonArticleListFormDTO; | 
				
			|||
import com.epmet.dto.result.ArticleBannerResultDTO; | 
				
			|||
import com.epmet.dto.result.ArticleLatestResultDTO; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.web.bind.annotation.PostMapping; | 
				
			|||
import org.springframework.web.bind.annotation.RequestBody; | 
				
			|||
import org.springframework.web.bind.annotation.RequestMapping; | 
				
			|||
import org.springframework.web.bind.annotation.RestController; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
@RestController | 
				
			|||
@RequestMapping("voice") | 
				
			|||
public class VoiceController { | 
				
			|||
    //最新党建声音列表
 | 
				
			|||
    //首页轮播图列表
 | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private GovVoiceFeignClient govVoiceFeignClient; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 | 
				
			|||
     * @param commonArticleListFormDTO :: getGridId :: getNum | 
				
			|||
     * @return List<ArticleBannerResultDTO> | 
				
			|||
     * @author wangc | 
				
			|||
     * @date 2020.06.02 16:13 | 
				
			|||
     **/ | 
				
			|||
    @PostMapping("toparticlelist") | 
				
			|||
    public Result<List<ArticleBannerResultDTO>> topArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ | 
				
			|||
        ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); | 
				
			|||
        return govVoiceFeignClient.resiTopArticleList(commonArticleListFormDTO); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 | 
				
			|||
     * @param commonArticleListFormDTO :: getGridId :: getNum | 
				
			|||
     * @return List<ArticleLatestResultDTO> | 
				
			|||
     * @author wangc | 
				
			|||
     * @date 2020.06.03 09:53 | 
				
			|||
     **/ | 
				
			|||
    @PostMapping("latestarticlelist") | 
				
			|||
    public Result<List<ArticleLatestResultDTO>> latestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ | 
				
			|||
        ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); | 
				
			|||
        return govVoiceFeignClient.resiLatestArticleList(commonArticleListFormDTO); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@ -0,0 +1,43 @@ | 
				
			|||
package com.epmet.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民端查看文章列表参数DTO | 
				
			|||
 * @ClassName ArticlePageFormDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-03 14:21 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
@Data | 
				
			|||
public class ArticlePageFormDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = -6201259689082896334L; | 
				
			|||
 | 
				
			|||
    public interface ArticlePageInternalGroup{} | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "网格Id不能为空" , groups = {ArticlePageInternalGroup.class}) | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 标签Id集合 | 
				
			|||
     * */ | 
				
			|||
    private List<String> tagIdList; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 页码 | 
				
			|||
     * */ | 
				
			|||
    private Integer pageNo = 1; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 每页显示量 | 
				
			|||
     * */ | 
				
			|||
    private Integer pageSize = 10; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,34 @@ | 
				
			|||
package com.epmet.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民端首页轮播查询接口DTO | 
				
			|||
 * @ClassName ArticleBannerFormDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-02 11:20 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class CommonArticleListFormDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = 5996259506950697451L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 内部错误分组 | 
				
			|||
     * */ | 
				
			|||
    public interface ArticleBannerInternalGroup{} | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户定制化条数(高级配置里的参数) | 
				
			|||
     * */ | 
				
			|||
    private Integer num; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,37 @@ | 
				
			|||
package com.epmet.dto.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民端查看文章详情传参DTO | 
				
			|||
 * @ClassName ResiArticleDetailFormDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-04 09:20 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ResiArticleDetailFormDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = -7197489284630455909L; | 
				
			|||
 | 
				
			|||
    public interface ResiArticleDetailInternalGroup{} | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "网格Id不能为空",groups = ResiArticleDetailInternalGroup.class) | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "文章Id不能为空",groups = ResiArticleDetailInternalGroup.class) | 
				
			|||
    private String articleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 用户Id | 
				
			|||
     * */ | 
				
			|||
    @NotBlank(message = "用户Id不能为空",groups = ResiArticleDetailInternalGroup.class) | 
				
			|||
    private String userId; | 
				
			|||
} | 
				
			|||
@ -0,0 +1,26 @@ | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description | 
				
			|||
 * @ClassName ArticleContentResultDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-03 16:41 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ArticleContentResultDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = 2853197212163051558L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 内容类型(图片:img;文字:text) | 
				
			|||
     * */ | 
				
			|||
    private String contentType; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 内容 | 
				
			|||
     * */ | 
				
			|||
    private String content; | 
				
			|||
} | 
				
			|||
@ -0,0 +1,55 @@ | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description | 
				
			|||
 * @ClassName ArticleDetailResultDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-03 16:36 | 
				
			|||
 */ | 
				
			|||
@JsonIgnoreProperties(ignoreUnknown = true) | 
				
			|||
@Data | 
				
			|||
public class ArticleDetailResultDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = 4659147595194692686L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章Id | 
				
			|||
     * */ | 
				
			|||
    private String articleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章标题 | 
				
			|||
     * */ | 
				
			|||
    private String articleTitle; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章发布单位名称 | 
				
			|||
     * */ | 
				
			|||
    private String publishUnitDesc; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 发布时间 | 
				
			|||
     * */ | 
				
			|||
    private String publishDate; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章当前网格阅读量(article_visit_record统计数) | 
				
			|||
     * */ | 
				
			|||
    private Integer visitRecordCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 标签名称集合(竖线分隔) | 
				
			|||
     * */ | 
				
			|||
    private String tags; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章内容 | 
				
			|||
     * */ | 
				
			|||
    private List<ArticleContentResultDTO> articleContentList; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,46 @@ | 
				
			|||
package com.epmet.dto.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description | 
				
			|||
 * @ClassName ArticleListResultDTO | 
				
			|||
 * @Auth wangc | 
				
			|||
 * @Date 2020-06-03 10:59 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ArticleListResultDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = 293527138997974861L; | 
				
			|||
    /** | 
				
			|||
     * 文章Id | 
				
			|||
     * */ | 
				
			|||
    private String articleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章标题 | 
				
			|||
     * */ | 
				
			|||
    private String articleTitle; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 发布单位名称 | 
				
			|||
     * */ | 
				
			|||
    private String publishName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 发布时间(天级别) | 
				
			|||
     * */ | 
				
			|||
    private String publishDate; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 文章发布内容(只截取前50字) | 
				
			|||
     * */ | 
				
			|||
    private String articleContent; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 标签名称集合(竖线分隔) | 
				
			|||
     * */ | 
				
			|||
    private String tagName; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue