| @@ -3,18 +3,23 @@ | |||||
| <component name="Encoding" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="UTF-8"> | <component name="Encoding" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="UTF-8"> | ||||
| <file url="file://$PROJECT_DIR$" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/1067-yuexiu-task-model-mybatis" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/1067-yuexiu-task-model-mybatis" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/1067-yuexiu-task-model-mybatis/src/main/java" charset="UTF-8" /> | |||||
| <file url="file://$PROJECT_DIR$/1068-yexiu-read-model-mybatis" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/1068-yexiu-read-model-mybatis" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/1068-yexiu-read-model-mybatis/src/main/java" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/1068-yexiu-read-model-mybatis/src/main/java" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/1069-yuexiu-registration-model-mybatis" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/1069-yuexiu-registration-model-mybatis" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/1069-yuexiu-registration-model-mybatis/src/main/java" charset="UTF-8" /> | |||||
| <file url="file://$PROJECT_DIR$/2067-yuexiu-task-api" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2067-yuexiu-task-api" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/2067-yuexiu-task-api/src/main/java" charset="UTF-8" /> | |||||
| <file url="file://$PROJECT_DIR$/2067-yuexiu-task-application" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2067-yuexiu-task-application" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/2067-yuexiu-task-application/src/main/java" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2067-yuexiu-task-application/src/main/java" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/2068-yexiu-read-api" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2068-yexiu-read-api" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/2068-yexiu-read-api/src/main/java" charset="UTF-8" /> | |||||
| <file url="file://$PROJECT_DIR$/2068-yexiu-read-application" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2068-yexiu-read-application" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/2068-yexiu-read-application/src/main/java" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2068-yexiu-read-application/src/main/java" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/2069-yuexiu-registration-api" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2069-yuexiu-registration-api" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/2069-yuexiu-registration-api/src/main/java" charset="UTF-8" /> | |||||
| <file url="file://$PROJECT_DIR$/2069-yuexiu-registration-application" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2069-yuexiu-registration-application" charset="UTF-8" /> | ||||
| <file url="file://$PROJECT_DIR$/2069-yuexiu-registration-application/src/main/java" charset="UTF-8" /> | <file url="file://$PROJECT_DIR$/2069-yuexiu-registration-application/src/main/java" charset="UTF-8" /> | ||||
| <file url="PROJECT" charset="UTF-8" /> | <file url="PROJECT" charset="UTF-8" /> | ||||
| </component> | </component> | ||||
| </project> | |||||
| </project> | |||||
| @@ -9,6 +9,7 @@ | |||||
| <factory-entry name="1068-yexiu-read-model-mybatis" /> | <factory-entry name="1068-yexiu-read-model-mybatis" /> | ||||
| <factory-entry name="Entities" /> | <factory-entry name="Entities" /> | ||||
| </datasource-mapping> | </datasource-mapping> | ||||
| <naming-strategy-map /> | |||||
| </configuration> | </configuration> | ||||
| </facet> | </facet> | ||||
| <facet type="Spring" name="Spring"> | <facet type="Spring" name="Spring"> | ||||
| @@ -0,0 +1,21 @@ | |||||
| package com.yuexiu.secp.read.infra.constant; | |||||
| public class ArticleConstant { | |||||
| //前缀 | |||||
| public final static String SIE = "SIE"; | |||||
| //阅读标记 | |||||
| public final static String READ = "READ"; | |||||
| //分享标记 | |||||
| public final static String SHARE = "SHARE"; | |||||
| //所有的文章信息标记 | |||||
| public final static String ARTICLE = "ARTICLE"; | |||||
| //我已推荐的文章标记 | |||||
| public final static String RECOMMEND = "RECOMMEND"; | |||||
| } | |||||
| @@ -0,0 +1,39 @@ | |||||
| package com.yuexiu.secp.read.infra.util; | |||||
| import com.google.common.base.Joiner; | |||||
| import com.google.common.collect.Lists; | |||||
| import org.apache.commons.lang.StringUtils; | |||||
| import java.util.ArrayList; | |||||
| /** | |||||
| * 生成key的工具类 | |||||
| */ | |||||
| public class RedisUtils { | |||||
| //分隔符 | |||||
| public final static String split = ":"; | |||||
| public static String getRedisKey(String... name) { | |||||
| StringBuffer sb = new StringBuffer(); | |||||
| for (String str : name) { | |||||
| if (StringUtils.isNotBlank(str)) { | |||||
| sb.append(str); | |||||
| sb.append(split); | |||||
| } | |||||
| } | |||||
| sb = sb.deleteCharAt(sb.lastIndexOf(split)); | |||||
| return sb.toString(); | |||||
| } | |||||
| public static String getRedisKeyJoin(String... name){ | |||||
| ArrayList<String> strlist = Lists.newArrayList(); | |||||
| for (String str : name) { | |||||
| if (StringUtils.isNotBlank(str)) { | |||||
| strlist.add(str); | |||||
| } | |||||
| } | |||||
| return Joiner.on("_").join(strlist); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,17 @@ | |||||
| package com.yuexiu.secp.read.model.dao; | |||||
| import com.sie.iot.common.model.dao.BaseCommonDAO_HI; | |||||
| import com.yuexiu.secp.read.model.entities.ArticleEntity; | |||||
| import com.yuexiu.secp.read.model.entities.ArticlePreviewEntity; | |||||
| import org.apache.ibatis.annotations.Select; | |||||
| import org.springframework.stereotype.Component; | |||||
| /** | |||||
| * 文章信息Dao | |||||
| */ | |||||
| @Component("ArticleDao") | |||||
| public interface ArticleDao extends BaseCommonDAO_HI<ArticleEntity> { | |||||
| @Select("select count(1) from yxh_article where promotion_status = 1 and task_status = 1") | |||||
| int findRecommend(); | |||||
| } | |||||
| @@ -0,0 +1,11 @@ | |||||
| package com.yuexiu.secp.read.model.dao; | |||||
| import com.sie.iot.common.model.dao.BaseCommonDAO_HI; | |||||
| import com.yuexiu.secp.read.model.entities.ArticleGatherEntity; | |||||
| import org.springframework.stereotype.Component; | |||||
| @Component("ArticleGatherDao") | |||||
| public interface ArticleGatherDao extends BaseCommonDAO_HI<ArticleGatherEntity> { | |||||
| } | |||||
| @@ -1,13 +1,14 @@ | |||||
| package com.yuexiu.secp.read.model.dao; | package com.yuexiu.secp.read.model.dao; | ||||
| import com.sie.iot.common.model.dao.BaseCommonDAO_HI; | |||||
| import com.yuexiu.secp.read.model.entities.ArticlePreviewEntity; | import com.yuexiu.secp.read.model.entities.ArticlePreviewEntity; | ||||
| import org.apache.ibatis.annotations.Select; | |||||
| import com.sie.iot.common.model.dao.BaseCommonDAO_HI; | |||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| /** | |||||
| * 文章信息预览Dao | |||||
| */ | |||||
| @Component("ArticlePreviewDao") | @Component("ArticlePreviewDao") | ||||
| public interface ArticlePreviewDao extends BaseCommonDAO_HI<ArticlePreviewEntity> { | public interface ArticlePreviewDao extends BaseCommonDAO_HI<ArticlePreviewEntity> { | ||||
| @Select("select * from sie_article_preview where promotion_status = 1 and task_status = 1") | |||||
| int findRecommend(); | |||||
| } | } | ||||
| @@ -0,0 +1,396 @@ | |||||
| package com.yuexiu.secp.read.model.entities; | |||||
| import java.util.Date; | |||||
| import com.alibaba.fastjson.annotation.JSONField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.sie.iot.common.idgenerate.GeneratedKeyValue; | |||||
| import io.swagger.annotations.ApiModel; | |||||
| import lombok.Data; | |||||
| @Data | |||||
| @TableName("yxh_article") | |||||
| @GeneratedKeyValue | |||||
| @ApiModel(value = "文章信息表") | |||||
| public class ArticleEntity { | |||||
| private Long articleId; | |||||
| private String publishUnit; | |||||
| private String articleTitle; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date spreadBeginTime; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date spreadEndTime; | |||||
| private Integer shareType; | |||||
| private String copywrite1; | |||||
| private String copywrite2; | |||||
| private String copywrite3; | |||||
| private String copywrite4; | |||||
| private String copywrite5; | |||||
| private String shareTitle; | |||||
| private String shareImg; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date releaseTime; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date releaseTaskTime; | |||||
| private Integer releaseTaskUser; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date endTaskTime; | |||||
| private Integer endTaskUser; | |||||
| private Integer taskStatus; | |||||
| private Integer promotionStatus; | |||||
| private Integer approvalStatus; | |||||
| private Integer approvalUser; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date approvalTime; | |||||
| private Integer articleType; | |||||
| private String articleTypeAlias; | |||||
| private String authorName; | |||||
| private String authorLogo; | |||||
| private String articleUrl; | |||||
| private String codeImg; | |||||
| private Long tenantId; | |||||
| private Long createdBy; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date creationDate; | |||||
| private Long lastUpdatedBy; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date lastUpdateDate; | |||||
| private Long lastUpdateLogin; | |||||
| private Integer deleteFlag; | |||||
| private Integer versionNum; | |||||
| public void setArticleId(Long articleId) { | |||||
| this.articleId = articleId; | |||||
| } | |||||
| public Long getArticleId() { | |||||
| return articleId; | |||||
| } | |||||
| public void setPublishUnit(String publishUnit) { | |||||
| this.publishUnit = publishUnit; | |||||
| } | |||||
| public String getPublishUnit() { | |||||
| return publishUnit; | |||||
| } | |||||
| public void setArticleTitle(String articleTitle) { | |||||
| this.articleTitle = articleTitle; | |||||
| } | |||||
| public String getArticleTitle() { | |||||
| return articleTitle; | |||||
| } | |||||
| public void setSpreadBeginTime(Date spreadBeginTime) { | |||||
| this.spreadBeginTime = spreadBeginTime; | |||||
| } | |||||
| public Date getSpreadBeginTime() { | |||||
| return spreadBeginTime; | |||||
| } | |||||
| public void setSpreadEndTime(Date spreadEndTime) { | |||||
| this.spreadEndTime = spreadEndTime; | |||||
| } | |||||
| public Date getSpreadEndTime() { | |||||
| return spreadEndTime; | |||||
| } | |||||
| public void setShareType(Integer shareType) { | |||||
| this.shareType = shareType; | |||||
| } | |||||
| public Integer getShareType() { | |||||
| return shareType; | |||||
| } | |||||
| public void setCopywrite1(String copywrite1) { | |||||
| this.copywrite1 = copywrite1; | |||||
| } | |||||
| public String getCopywrite1() { | |||||
| return copywrite1; | |||||
| } | |||||
| public void setCopywrite2(String copywrite2) { | |||||
| this.copywrite2 = copywrite2; | |||||
| } | |||||
| public String getCopywrite2() { | |||||
| return copywrite2; | |||||
| } | |||||
| public void setCopywrite3(String copywrite3) { | |||||
| this.copywrite3 = copywrite3; | |||||
| } | |||||
| public String getCopywrite3() { | |||||
| return copywrite3; | |||||
| } | |||||
| public void setCopywrite4(String copywrite4) { | |||||
| this.copywrite4 = copywrite4; | |||||
| } | |||||
| public String getCopywrite4() { | |||||
| return copywrite4; | |||||
| } | |||||
| public void setCopywrite5(String copywrite5) { | |||||
| this.copywrite5 = copywrite5; | |||||
| } | |||||
| public String getCopywrite5() { | |||||
| return copywrite5; | |||||
| } | |||||
| public void setShareTitle(String shareTitle) { | |||||
| this.shareTitle = shareTitle; | |||||
| } | |||||
| public String getShareTitle() { | |||||
| return shareTitle; | |||||
| } | |||||
| public void setShareImg(String shareImg) { | |||||
| this.shareImg = shareImg; | |||||
| } | |||||
| public String getShareImg() { | |||||
| return shareImg; | |||||
| } | |||||
| public void setReleaseTime(Date releaseTime) { | |||||
| this.releaseTime = releaseTime; | |||||
| } | |||||
| public Date getReleaseTime() { | |||||
| return releaseTime; | |||||
| } | |||||
| public void setReleaseTaskTime(Date releaseTaskTime) { | |||||
| this.releaseTaskTime = releaseTaskTime; | |||||
| } | |||||
| public Date getReleaseTaskTime() { | |||||
| return releaseTaskTime; | |||||
| } | |||||
| public void setReleaseTaskUser(Integer releaseTaskUser) { | |||||
| this.releaseTaskUser = releaseTaskUser; | |||||
| } | |||||
| public Integer getReleaseTaskUser() { | |||||
| return releaseTaskUser; | |||||
| } | |||||
| public void setEndTaskTime(Date endTaskTime) { | |||||
| this.endTaskTime = endTaskTime; | |||||
| } | |||||
| public Date getEndTaskTime() { | |||||
| return endTaskTime; | |||||
| } | |||||
| public void setEndTaskUser(Integer endTaskUser) { | |||||
| this.endTaskUser = endTaskUser; | |||||
| } | |||||
| public Integer getEndTaskUser() { | |||||
| return endTaskUser; | |||||
| } | |||||
| public void setTaskStatus(Integer taskStatus) { | |||||
| this.taskStatus = taskStatus; | |||||
| } | |||||
| public Integer getTaskStatus() { | |||||
| return taskStatus; | |||||
| } | |||||
| public void setPromotionStatus(Integer promotionStatus) { | |||||
| this.promotionStatus = promotionStatus; | |||||
| } | |||||
| public Integer getPromotionStatus() { | |||||
| return promotionStatus; | |||||
| } | |||||
| public void setApprovalStatus(Integer approvalStatus) { | |||||
| this.approvalStatus = approvalStatus; | |||||
| } | |||||
| public Integer getApprovalStatus() { | |||||
| return approvalStatus; | |||||
| } | |||||
| public void setApprovalUser(Integer approvalUser) { | |||||
| this.approvalUser = approvalUser; | |||||
| } | |||||
| public Integer getApprovalUser() { | |||||
| return approvalUser; | |||||
| } | |||||
| public void setApprovalTime(Date approvalTime) { | |||||
| this.approvalTime = approvalTime; | |||||
| } | |||||
| public Date getApprovalTime() { | |||||
| return approvalTime; | |||||
| } | |||||
| public void setArticleType(Integer articleType) { | |||||
| this.articleType = articleType; | |||||
| } | |||||
| public Integer getArticleType() { | |||||
| return articleType; | |||||
| } | |||||
| public void setArticleTypeAlias(String articleTypeAlias) { | |||||
| this.articleTypeAlias = articleTypeAlias; | |||||
| } | |||||
| public String getArticleTypeAlias() { | |||||
| return articleTypeAlias; | |||||
| } | |||||
| public void setAuthorName(String authorName) { | |||||
| this.authorName = authorName; | |||||
| } | |||||
| public String getAuthorName() { | |||||
| return authorName; | |||||
| } | |||||
| public void setAuthorLogo(String authorLogo) { | |||||
| this.authorLogo = authorLogo; | |||||
| } | |||||
| public String getAuthorLogo() { | |||||
| return authorLogo; | |||||
| } | |||||
| public void setArticleUrl(String articleUrl) { | |||||
| this.articleUrl = articleUrl; | |||||
| } | |||||
| public String getArticleUrl() { | |||||
| return articleUrl; | |||||
| } | |||||
| public void setCodeImg(String codeImg) { | |||||
| this.codeImg = codeImg; | |||||
| } | |||||
| public String getCodeImg() { | |||||
| return codeImg; | |||||
| } | |||||
| public void setTenantId(Long tenantId) { | |||||
| this.tenantId = tenantId; | |||||
| } | |||||
| public Long getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setCreatedBy(Long createdBy) { | |||||
| this.createdBy = createdBy; | |||||
| } | |||||
| public Long getCreatedBy() { | |||||
| return createdBy; | |||||
| } | |||||
| public void setCreationDate(Date creationDate) { | |||||
| this.creationDate = creationDate; | |||||
| } | |||||
| public Date getCreationDate() { | |||||
| return creationDate; | |||||
| } | |||||
| public void setLastUpdatedBy(Long lastUpdatedBy) { | |||||
| this.lastUpdatedBy = lastUpdatedBy; | |||||
| } | |||||
| public Long getLastUpdatedBy() { | |||||
| return lastUpdatedBy; | |||||
| } | |||||
| public void setLastUpdateDate(Date lastUpdateDate) { | |||||
| this.lastUpdateDate = lastUpdateDate; | |||||
| } | |||||
| public Date getLastUpdateDate() { | |||||
| return lastUpdateDate; | |||||
| } | |||||
| public void setLastUpdateLogin(Long lastUpdateLogin) { | |||||
| this.lastUpdateLogin = lastUpdateLogin; | |||||
| } | |||||
| public Long getLastUpdateLogin() { | |||||
| return lastUpdateLogin; | |||||
| } | |||||
| public void setDeleteFlag(Integer deleteFlag) { | |||||
| this.deleteFlag = deleteFlag; | |||||
| } | |||||
| public Integer getDeleteFlag() { | |||||
| return deleteFlag; | |||||
| } | |||||
| public void setVersionNum(Integer versionNum) { | |||||
| this.versionNum = versionNum; | |||||
| } | |||||
| public Integer getVersionNum() { | |||||
| return versionNum; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,158 @@ | |||||
| package com.yuexiu.secp.read.model.entities; | |||||
| import java.util.Date; | |||||
| import com.alibaba.fastjson.annotation.JSONField; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableId; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.sie.iot.common.idgenerate.GeneratedKeyValue; | |||||
| import com.sie.iot.common.model.entity.BaseEntity; | |||||
| import io.swagger.annotations.ApiModel; | |||||
| import lombok.Data; | |||||
| /** | |||||
| * 文章推广汇总表 | |||||
| */ | |||||
| @Data | |||||
| @TableName("yxh_article_gather") | |||||
| @GeneratedKeyValue | |||||
| @ApiModel(value = "文章推广汇总表") | |||||
| public class ArticleGatherEntity extends BaseEntity<ArticleGatherEntity> { | |||||
| @TableId(value = "article_gather_id", type = IdType.ASSIGN_ID) | |||||
| private Long articleGatherId; | |||||
| private Long articleId; | |||||
| private Integer readCount; | |||||
| private Integer totalPoint; | |||||
| private Integer shareCount; | |||||
| private Integer thumbsCount; | |||||
| private Long tenantId; | |||||
| private Long createdBy; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date creationDate; | |||||
| private Long lastUpdatedBy; | |||||
| @JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||||
| private Date lastUpdateDate; | |||||
| private Long lastUpdateLogin; | |||||
| private Integer deleteFlag; | |||||
| public void setArticleGatherId(Long articleGatherId) { | |||||
| this.articleGatherId = articleGatherId; | |||||
| } | |||||
| public Long getArticleGatherId() { | |||||
| return articleGatherId; | |||||
| } | |||||
| public void setArticleId(Long articleId) { | |||||
| this.articleId = articleId; | |||||
| } | |||||
| public Long getArticleId() { | |||||
| return articleId; | |||||
| } | |||||
| public void setReadCount(Integer readCount) { | |||||
| this.readCount = readCount; | |||||
| } | |||||
| public Integer getReadCount() { | |||||
| return readCount; | |||||
| } | |||||
| public void setTotalPoint(Integer totalPoint) { | |||||
| this.totalPoint = totalPoint; | |||||
| } | |||||
| public Integer getTotalPoint() { | |||||
| return totalPoint; | |||||
| } | |||||
| public void setShareCount(Integer shareCount) { | |||||
| this.shareCount = shareCount; | |||||
| } | |||||
| public Integer getShareCount() { | |||||
| return shareCount; | |||||
| } | |||||
| public void setThumbsCount(Integer thumbsCount) { | |||||
| this.thumbsCount = thumbsCount; | |||||
| } | |||||
| public Integer getThumbsCount() { | |||||
| return thumbsCount; | |||||
| } | |||||
| public void setTenantId(Long tenantId) { | |||||
| this.tenantId = tenantId; | |||||
| } | |||||
| public Long getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setCreatedBy(Long createdBy) { | |||||
| this.createdBy = createdBy; | |||||
| } | |||||
| public Long getCreatedBy() { | |||||
| return createdBy; | |||||
| } | |||||
| public void setCreationDate(Date creationDate) { | |||||
| this.creationDate = creationDate; | |||||
| } | |||||
| public Date getCreationDate() { | |||||
| return creationDate; | |||||
| } | |||||
| public void setLastUpdatedBy(Long lastUpdatedBy) { | |||||
| this.lastUpdatedBy = lastUpdatedBy; | |||||
| } | |||||
| public Long getLastUpdatedBy() { | |||||
| return lastUpdatedBy; | |||||
| } | |||||
| public void setLastUpdateDate(Date lastUpdateDate) { | |||||
| this.lastUpdateDate = lastUpdateDate; | |||||
| } | |||||
| public Date getLastUpdateDate() { | |||||
| return lastUpdateDate; | |||||
| } | |||||
| public void setLastUpdateLogin(Long lastUpdateLogin) { | |||||
| this.lastUpdateLogin = lastUpdateLogin; | |||||
| } | |||||
| public Long getLastUpdateLogin() { | |||||
| return lastUpdateLogin; | |||||
| } | |||||
| public void setDeleteFlag(Integer deleteFlag) { | |||||
| this.deleteFlag = deleteFlag; | |||||
| } | |||||
| public Integer getDeleteFlag() { | |||||
| return deleteFlag; | |||||
| } | |||||
| } | |||||
| @@ -1,6 +1,5 @@ | |||||
| package com.yuexiu.secp.read.model.entities; | package com.yuexiu.secp.read.model.entities; | ||||
| import com.alibaba.fastjson.annotation.JSONField; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | import com.baomidou.mybatisplus.annotation.IdType; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| @@ -11,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.Date; | |||||
| @Data | @Data | ||||
| @TableName("yx_article_preview_content") | @TableName("yx_article_preview_content") | ||||
| @@ -0,0 +1,23 @@ | |||||
| package com.yuexiu.secp.read.dto; | |||||
| /** | |||||
| * 用于增加文章统计数 + 1 | |||||
| */ | |||||
| import io.swagger.annotations.ApiModel; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import lombok.NoArgsConstructor; | |||||
| @Data | |||||
| @NoArgsConstructor | |||||
| @ApiModel(value = "增加文章统计数Dto") | |||||
| public class ArticleAddCountDto { | |||||
| @ApiModelProperty(value = "文章id") | |||||
| private String articleId; | |||||
| @ApiModelProperty(value = "类型 - 1:阅读数 2:分享数") | |||||
| private Integer type; | |||||
| } | |||||
| @@ -0,0 +1,32 @@ | |||||
| package com.yuexiu.secp.read.dto; | |||||
| /** | |||||
| * 查询最新推荐和我已推荐的Dto | |||||
| */ | |||||
| import io.swagger.annotations.ApiModel; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import lombok.NoArgsConstructor; | |||||
| @Data | |||||
| @NoArgsConstructor | |||||
| @ApiModel(value = "查询最新推荐和我已推荐的Dto") | |||||
| public class ArticleQueryDto { | |||||
| @ApiModelProperty(value = "推广状态") | |||||
| private int promotionStatus; | |||||
| @ApiModelProperty(value = "任务状态") | |||||
| private int taskStatus; | |||||
| @ApiModelProperty(value = "项目id") | |||||
| private int projectId; | |||||
| @ApiModelProperty(value = "城市id") | |||||
| private int cityId; | |||||
| @ApiModelProperty(value = "用户id") | |||||
| private int userId; | |||||
| } | |||||
| @@ -0,0 +1,23 @@ | |||||
| package com.yuexiu.secp.read.vo; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import lombok.NoArgsConstructor; | |||||
| /** | |||||
| * 封装统计数返回对象 | |||||
| */ | |||||
| @Data | |||||
| @NoArgsConstructor | |||||
| public class StatisticsRespVo { | |||||
| @ApiModelProperty(value = "文章id") | |||||
| private String articleId; | |||||
| @ApiModelProperty(value = "阅读数") | |||||
| private String read; | |||||
| @ApiModelProperty(value = "分享数") | |||||
| private String share; | |||||
| } | |||||
| @@ -0,0 +1,56 @@ | |||||
| package com.yuexiu.secp.read.controller; | |||||
| import com.sie.iot.common.bean.ResponseData; | |||||
| import com.sie.iot.common.secure.annotation.CheckToken; | |||||
| import com.yuexiu.secp.read.dto.ArticleQueryDto; | |||||
| import com.yuexiu.secp.read.model.entities.ArticleEntity; | |||||
| import com.yuexiu.secp.read.model.service.IArticleServer; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.validation.annotation.Validated; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.List; | |||||
| @Validated | |||||
| @Api(value = "阅读有礼-文章", tags = "阅读有礼-文章") | |||||
| @RestController | |||||
| @RequestMapping("/ArticleController") | |||||
| public class ArticleController { | |||||
| @Autowired | |||||
| private IArticleServer iArticleServer; | |||||
| /** | |||||
| * 最新推查询 | |||||
| * @param articleQueryDto | |||||
| * @return | |||||
| */ | |||||
| @ApiOperation(value = "查询最新推荐", notes = "根据城市与项目查询最新推荐数据") | |||||
| @PostMapping(value = "/findNewest") | |||||
| @CheckToken | |||||
| public ResponseData<List<ArticleEntity>> findNewest(@RequestBody ArticleQueryDto articleQueryDto) { | |||||
| List<ArticleEntity> recommendedAndPast = iArticleServer.findNewest(articleQueryDto); | |||||
| return ResponseData.data(recommendedAndPast); | |||||
| } | |||||
| /** | |||||
| * 查询往期推荐 | |||||
| */ | |||||
| @ApiOperation(value = "查询往期推荐", notes = "根据城市与项目查询往期推荐数据") | |||||
| @PostMapping(value = "/findPrevious") | |||||
| @CheckToken | |||||
| public ResponseData<List<ArticleEntity>> findPrevious(@RequestBody ArticleQueryDto articleQueryDto) { | |||||
| List<ArticleEntity> recommendedAndPast = iArticleServer.findPrevious(articleQueryDto); | |||||
| return ResponseData.data(recommendedAndPast); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,45 @@ | |||||
| package com.yuexiu.secp.read.controller; | |||||
| import com.sie.iot.common.secure.annotation.CheckToken; | |||||
| import com.yuexiu.secp.read.dto.ArticleAddCountDto; | |||||
| import com.yuexiu.secp.read.model.service.IArticleGatherServer; | |||||
| import com.yuexiu.secp.read.vo.StatisticsRespVo; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.validation.annotation.Validated; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @Validated | |||||
| @Api(value = "阅读有礼-文章推广汇总", tags = "阅读有礼-文章推广汇总") | |||||
| @RestController | |||||
| @RequestMapping("/ArticleGatherController") | |||||
| public class ArticleGatherController { | |||||
| @Autowired | |||||
| private IArticleGatherServer iArticleGatherServer; | |||||
| @ApiOperation(value = "根据文章id阅读数和分享数", notes = "根据文章id阅读数和分享数") | |||||
| @GetMapping(value = "/find/{articleId}/count") | |||||
| @CheckToken | |||||
| public StatisticsRespVo findByArticleIdCount(@PathVariable Long articleId) { | |||||
| return iArticleGatherServer.findByArticleIdCount(articleId); | |||||
| } | |||||
| /** | |||||
| * 根据文章id增加相关的文章阅读数和分享数 | |||||
| */ | |||||
| @ApiOperation(value = "根据文章id增加相关的文章阅读数和分享数", notes = "根据文章id增加相关的文章阅读数和分享数") | |||||
| @PostMapping(value = "/add/ArticleCount") | |||||
| @CheckToken | |||||
| public void addArticleCount(@RequestBody ArticleAddCountDto articlePreviewDto) { | |||||
| iArticleGatherServer.addArticleCount(articlePreviewDto); | |||||
| } | |||||
| } | |||||
| @@ -1,16 +1,12 @@ | |||||
| package com.yuexiu.secp.read.controller; | package com.yuexiu.secp.read.controller; | ||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.sie.iot.common.bean.RequestData; | import com.sie.iot.common.bean.RequestData; | ||||
| import com.sie.iot.common.bean.ResponseData; | import com.sie.iot.common.bean.ResponseData; | ||||
| import com.sie.iot.common.model.inter.IBaseCommon; | import com.sie.iot.common.model.inter.IBaseCommon; | ||||
| import com.sie.iot.common.secure.annotation.CheckToken; | import com.sie.iot.common.secure.annotation.CheckToken; | ||||
| import com.sie.iot.common.services.CommonAbstractService; | import com.sie.iot.common.services.CommonAbstractService; | ||||
| import com.yuexiu.secp.read.dto.ArticlePreviewDto; | import com.yuexiu.secp.read.dto.ArticlePreviewDto; | ||||
| import com.yuexiu.secp.read.dto.CostUnitDto; | |||||
| import com.yuexiu.secp.read.dto.RecommendDto; | |||||
| import com.yuexiu.secp.read.model.entities.ArticlePreviewEntity; | import com.yuexiu.secp.read.model.entities.ArticlePreviewEntity; | ||||
| import com.yuexiu.secp.read.model.entities.CostUnitEntity; | |||||
| import com.yuexiu.secp.read.model.service.IArticlePreview; | import com.yuexiu.secp.read.model.service.IArticlePreview; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -26,14 +22,9 @@ public class ArticlePreviewController extends CommonAbstractService { | |||||
| @Override | @Override | ||||
| public IBaseCommon<?> getBaseCommonServer() { | public IBaseCommon<?> getBaseCommonServer() { | ||||
| return this.iReadService;; | |||||
| return this.iReadService; | |||||
| } | } | ||||
| @GetMapping(value = "/findRecommendedAndPast") | |||||
| public String findRecommendedAndPast(RecommendDto articlePreviewDto) { | |||||
| return iReadService.findRecommendedAndPast(articlePreviewDto); | |||||
| } | |||||
| @ApiOperation(value = "保存成本单位", notes = "保存成本单位") | @ApiOperation(value = "保存成本单位", notes = "保存成本单位") | ||||
| @PostMapping(value = "/save") | @PostMapping(value = "/save") | ||||
| @@ -0,0 +1,29 @@ | |||||
| package com.yuexiu.secp.read.model.service; | |||||
| import com.yuexiu.secp.read.dto.ArticleAddCountDto; | |||||
| import com.yuexiu.secp.read.model.entities.ArticleGatherEntity; | |||||
| import com.yuexiu.secp.read.vo.StatisticsRespVo; | |||||
| public interface IArticleGatherServer { | |||||
| /** | |||||
| * 根据类型和文章id,获取统计数 | |||||
| * @param articleId | |||||
| */ | |||||
| String findByArticleIdAndTypeCount(Long articleId , int type); | |||||
| /** | |||||
| * 根据文章id获取相关统计数 | |||||
| * @param articleId | |||||
| */ | |||||
| StatisticsRespVo findByArticleIdCount(Long articleId); | |||||
| /** | |||||
| * 根据文章和类型,增加相关的统计数 | |||||
| * @param articlePreviewDto | |||||
| */ | |||||
| void addArticleCount(ArticleAddCountDto articlePreviewDto); | |||||
| } | |||||
| @@ -3,14 +3,12 @@ package com.yuexiu.secp.read.model.service; | |||||
| import com.sie.iot.common.model.inter.IBaseCommon; | import com.sie.iot.common.model.inter.IBaseCommon; | ||||
| import com.yuexiu.secp.read.dto.ArticlePreviewDto; | import com.yuexiu.secp.read.dto.ArticlePreviewDto; | ||||
| import com.yuexiu.secp.read.dto.RecommendDto; | |||||
| import com.yuexiu.secp.read.model.entities.ArticlePreviewEntity; | import com.yuexiu.secp.read.model.entities.ArticlePreviewEntity; | ||||
| import com.yuexiu.secp.read.model.entities.CostUnitEntity; | import com.yuexiu.secp.read.model.entities.CostUnitEntity; | ||||
| public interface IArticlePreview extends IBaseCommon<CostUnitEntity> { | public interface IArticlePreview extends IBaseCommon<CostUnitEntity> { | ||||
| String findRecommendedAndPast(RecommendDto articlePreviewDto); | |||||
| ArticlePreviewEntity saveArticlePreview(ArticlePreviewDto dto); | ArticlePreviewEntity saveArticlePreview(ArticlePreviewDto dto); | ||||
| @@ -0,0 +1,18 @@ | |||||
| package com.yuexiu.secp.read.model.service; | |||||
| import com.yuexiu.secp.read.dto.ArticleQueryDto; | |||||
| import com.yuexiu.secp.read.model.entities.ArticleEntity; | |||||
| import java.util.List; | |||||
| public interface IArticleServer { | |||||
| List<ArticleEntity> findNewest(ArticleQueryDto articleQueryDto); | |||||
| List<ArticleEntity> findPrevious(ArticleQueryDto articleQueryDto); | |||||
| } | |||||
| @@ -0,0 +1,96 @@ | |||||
| package com.yuexiu.secp.read.model.service.impl; | |||||
| import com.itextpdf.text.log.Logger; | |||||
| import com.itextpdf.text.log.LoggerFactory; | |||||
| import com.sie.iot.common.model.inter.server.BaseCommonServer; | |||||
| import com.yuexiu.secp.read.dto.ArticleAddCountDto; | |||||
| import com.yuexiu.secp.read.infra.constant.ArticleConstant; | |||||
| import com.yuexiu.secp.read.infra.util.RedisUtils; | |||||
| import com.yuexiu.secp.read.model.entities.ArticleGatherEntity; | |||||
| import com.yuexiu.secp.read.model.service.IArticleGatherServer; | |||||
| import com.yuexiu.secp.read.vo.StatisticsRespVo; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.data.redis.core.StringRedisTemplate; | |||||
| import org.springframework.stereotype.Service; | |||||
| import org.springframework.util.StringUtils; | |||||
| @Service | |||||
| public class ArticleGatherServer extends BaseCommonServer<ArticleGatherEntity> implements IArticleGatherServer { | |||||
| private static final Logger LOGGER = LoggerFactory.getLogger(ArticleGatherServer.class); | |||||
| //阅读标记 | |||||
| public final static Integer READ_TYPE = 1; | |||||
| //阅读标记 | |||||
| public final static Integer SHARE_TYPE = 2; | |||||
| /** | |||||
| * redis | |||||
| */ | |||||
| @Autowired | |||||
| private StringRedisTemplate redisTemplate; | |||||
| /** | |||||
| * 获取文章统计数 | |||||
| * type: | |||||
| * 1:阅读数 | |||||
| * 2:转发数 | |||||
| * | |||||
| * @param articleId | |||||
| */ | |||||
| public String findByArticleIdAndTypeCount(Long articleId, int type) { | |||||
| LOGGER.info("articleId : {}" + articleId + "type --> {}" + type); | |||||
| String count = ""; | |||||
| if (type == READ_TYPE) { | |||||
| count = redisTemplate.opsForValue().get(RedisUtils.getRedisKey(ArticleConstant.SIE, ArticleConstant.READ, String.valueOf(articleId))); | |||||
| } else if (type == SHARE_TYPE) { | |||||
| count = redisTemplate.opsForValue().get(RedisUtils.getRedisKey(ArticleConstant.SIE, ArticleConstant.SHARE, String.valueOf(articleId))); | |||||
| } | |||||
| return count; | |||||
| } | |||||
| /** | |||||
| * 根据文章id获取相关统计数 | |||||
| * | |||||
| * @param articleId | |||||
| */ | |||||
| @Override | |||||
| public StatisticsRespVo findByArticleIdCount(Long articleId) { | |||||
| LOGGER.info("articleId : {}" + articleId); | |||||
| StatisticsRespVo statisticsRespVo = new StatisticsRespVo(); | |||||
| //获取阅读数 | |||||
| String read = this.findByArticleIdAndTypeCount(articleId, READ_TYPE); | |||||
| String share = this.findByArticleIdAndTypeCount(articleId, SHARE_TYPE); | |||||
| LOGGER.info("该文章id:" + articleId + "获取到的阅读数:" + read + "和分享数:" + share); | |||||
| //组装数据 | |||||
| statisticsRespVo.setRead(!StringUtils.isEmpty(read) ? read : "0"); | |||||
| statisticsRespVo.setShare(!StringUtils.isEmpty(share) ? read : "0"); | |||||
| return statisticsRespVo; | |||||
| } | |||||
| /** | |||||
| * 根据文章和类型,增加相关的统计数 | |||||
| * | |||||
| * @param articlePreviewDto | |||||
| */ | |||||
| @Override | |||||
| public void addArticleCount(ArticleAddCountDto articlePreviewDto) { | |||||
| LOGGER.info("articlePreviewDto : {}" + articlePreviewDto); | |||||
| if (articlePreviewDto.getType() == READ_TYPE) { | |||||
| redisTemplate.opsForValue().increment(RedisUtils.getRedisKey(ArticleConstant.SIE, ArticleConstant.READ, articlePreviewDto.getArticleId()), 1L); | |||||
| } else if (articlePreviewDto.getType() == SHARE_TYPE) { | |||||
| redisTemplate.opsForValue().increment(RedisUtils.getRedisKey(ArticleConstant.SIE, ArticleConstant.SHARE, articlePreviewDto.getArticleId()), 1L); | |||||
| } else { | |||||
| LOGGER.error("传参有误,没有定义该类型:" + articlePreviewDto.getType()); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -36,70 +36,6 @@ public class ArticlePreviewServer extends BaseCommonServer<CostUnitEntity> imple | |||||
| private ArticlePreviewDao articlePreviewDao; | private ArticlePreviewDao articlePreviewDao; | ||||
| @Override | |||||
| public String findRecommendedAndPast(RecommendDto articlePreviewDto) { | |||||
| //项目的集合信息 | |||||
| List<ArticlePreviewEntity> projectList = new ArrayList<>(); | |||||
| //城市的集合信息 | |||||
| List<ArticlePreviewEntity> articlePreviewList = new ArrayList<>(); | |||||
| List<ArticlePreviewEntity> dataList = new ArrayList<>(); | |||||
| //查询是否有最新推荐 | |||||
| int count = articlePreviewDao.findRecommend(); | |||||
| if (count < 1) { | |||||
| return "为空"; | |||||
| } | |||||
| //获取当前登录用户 | |||||
| //获取我已推荐的文章 | |||||
| Set<String> recommendIdList = redisTemplate.opsForSet().members("sie:recommend:1"); | |||||
| //获取所有文章的信息 | |||||
| Map<Object, Object> entries = redisTemplate.opsForHash().entries("sie:read:article"); | |||||
| ObjectMapper objectMapper = new ObjectMapper(); | |||||
| //剔除我已推荐文章 | |||||
| for (String recommendId : recommendIdList) { | |||||
| entries.remove(recommendId); | |||||
| } | |||||
| Collection<Object> values = entries.values(); | |||||
| //判断是否有房产 | |||||
| if (true) { | |||||
| for (Object value : values) { | |||||
| //匹配项目,任务状态为已发布 , 推广状态为有效 | |||||
| ArticlePreviewEntity articlePreview = objectMapper.convertValue(value,ArticlePreviewEntity.class); | |||||
| if(articlePreview.getPromotionStatus() == articlePreviewDto.getPromotionStatus() && | |||||
| articlePreview.getTaskStatus() == articlePreviewDto.getTaskStatus()){ | |||||
| //往城市里的集合塞数据 | |||||
| projectList.add(articlePreview); | |||||
| } | |||||
| System.out.println(value); | |||||
| } | |||||
| } | |||||
| for (Object value : values) { | |||||
| //匹配城市,任务状态为已发布 , 推广状态为有效 | |||||
| ArticlePreviewEntity articlePreview = objectMapper.convertValue(value,ArticlePreviewEntity.class); | |||||
| if(articlePreview.getPromotionStatus() == articlePreviewDto.getPromotionStatus() && | |||||
| articlePreview.getTaskStatus() == articlePreviewDto.getTaskStatus()){ | |||||
| //往城市里的集合塞数据 | |||||
| articlePreviewList.add(articlePreview); | |||||
| } | |||||
| System.out.println(value); | |||||
| } | |||||
| //如果项目类型不为空,合并项目和城市 | |||||
| if(!CollectionUtils.isEmpty(projectList)){ | |||||
| Iterables.addAll(dataList, projectList); | |||||
| Iterables.addAll(dataList, articlePreviewList); | |||||
| } | |||||
| return "不为空"; | |||||
| } | |||||
| @Override | @Override | ||||
| public ArticlePreviewEntity saveArticlePreview(ArticlePreviewDto dto) { | public ArticlePreviewEntity saveArticlePreview(ArticlePreviewDto dto) { | ||||
| @@ -0,0 +1,124 @@ | |||||
| package com.yuexiu.secp.read.model.service.impl; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.google.common.collect.Iterables; | |||||
| import com.yuexiu.secp.read.dto.ArticleQueryDto; | |||||
| import com.yuexiu.secp.read.infra.constant.ArticleConstant; | |||||
| import com.yuexiu.secp.read.infra.util.RedisUtils; | |||||
| import com.yuexiu.secp.read.model.dao.ArticleDao; | |||||
| import com.yuexiu.secp.read.model.entities.ArticleEntity; | |||||
| import com.yuexiu.secp.read.model.service.IArticleServer; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.data.redis.core.StringRedisTemplate; | |||||
| import org.springframework.stereotype.Service; | |||||
| import org.springframework.util.CollectionUtils; | |||||
| import java.util.*; | |||||
| /** | |||||
| * @author YuChengLong | |||||
| * @date 2022/5/10 | |||||
| */ | |||||
| @Service | |||||
| public class ArticleServer implements IArticleServer{ | |||||
| /** | |||||
| * redis | |||||
| */ | |||||
| @Autowired | |||||
| private StringRedisTemplate redisTemplate; | |||||
| /** | |||||
| * 文章DAO | |||||
| */ | |||||
| @Autowired | |||||
| private ArticleDao articleDao; | |||||
| /** | |||||
| * 最新推荐 | |||||
| * @param articleQueryDto | |||||
| * @return | |||||
| */ | |||||
| @Override | |||||
| public List<ArticleEntity> findNewest(ArticleQueryDto articleQueryDto) { | |||||
| //项目的集合信息 | |||||
| List<ArticleEntity> projectList = new ArrayList<>(); | |||||
| //城市的集合信息 | |||||
| List<ArticleEntity> articlePreviewList = new ArrayList<>(); | |||||
| List<ArticleEntity> dataList = new ArrayList<>(); | |||||
| //查询是否有最新推荐 | |||||
| int count = articleDao.findRecommend(); | |||||
| if (count < 1) { | |||||
| return null; | |||||
| } | |||||
| //获取当前登录用户 | |||||
| //获取我已推荐的文章 | |||||
| Set<String> recommendIdList = redisTemplate.opsForSet().members(RedisUtils.getRedisKey(ArticleConstant.SIE , ArticleConstant.RECOMMEND ,String.valueOf(articleQueryDto.getUserId()))); | |||||
| //获取所有文章的信息 | |||||
| Map<Object, Object> entries = redisTemplate.opsForHash().entries(RedisUtils.getRedisKey(ArticleConstant.SIE , ArticleConstant.READ ,ArticleConstant.ARTICLE)); | |||||
| ObjectMapper objectMapper = new ObjectMapper(); | |||||
| //剔除我已推荐文章 | |||||
| for (String recommendId : recommendIdList) { | |||||
| entries.remove(recommendId); | |||||
| } | |||||
| Collection<Object> values = entries.values(); | |||||
| //判断是否有房产 | |||||
| //todo 调用第三方接口cdp,查询是否有房产 | |||||
| if (true) { | |||||
| for (Object value : values) { | |||||
| //匹配项目,任务状态为已发布 , 推广状态为有效 | |||||
| ArticleEntity articlePreview = objectMapper.convertValue(value,ArticleEntity.class); | |||||
| if(articlePreview.getPromotionStatus() == articleQueryDto.getPromotionStatus() && | |||||
| articlePreview.getTaskStatus() == articleQueryDto.getTaskStatus()){ | |||||
| //往城市里的集合塞数据 | |||||
| projectList.add(articlePreview); | |||||
| } | |||||
| System.out.println(value); | |||||
| } | |||||
| } | |||||
| for (Object value : values) { | |||||
| //匹配城市,任务状态为已发布 , 推广状态为有效 | |||||
| ArticleEntity articlePreview = objectMapper.convertValue(value,ArticleEntity.class); | |||||
| if(articlePreview.getPromotionStatus() == articleQueryDto.getPromotionStatus() && | |||||
| articlePreview.getTaskStatus() == articleQueryDto.getTaskStatus()){ | |||||
| //往城市里的集合塞数据 | |||||
| articlePreviewList.add(articlePreview); | |||||
| } | |||||
| System.out.println(value); | |||||
| } | |||||
| //如果项目类型不为空,合并项目和城市 | |||||
| if(!CollectionUtils.isEmpty(projectList)){ | |||||
| Iterables.addAll(dataList, projectList); | |||||
| Iterables.addAll(dataList, articlePreviewList); | |||||
| } | |||||
| return dataList; | |||||
| } | |||||
| /** | |||||
| * 往期推荐 | |||||
| * @param articleQueryDto | |||||
| * @return | |||||
| */ | |||||
| @Override | |||||
| public List<ArticleEntity> findPrevious(ArticleQueryDto articleQueryDto) { | |||||
| return null; | |||||
| } | |||||
| } | |||||