| @@ -3,18 +3,23 @@ | |||
| <component name="Encoding" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="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/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/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/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/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/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/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/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/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/src/main/java" charset="UTF-8" /> | |||
| <file url="PROJECT" charset="UTF-8" /> | |||
| </component> | |||
| </project> | |||
| </project> | |||
| @@ -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,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; | |||
| import com.yuexiu.secp.read.model.entities.readonly.ArticlePreview; | |||
| import com.yuexiu.secp.read.model.entities.ArticlePreviewEntity; | |||
| import com.sie.iot.common.model.dao.BaseCommonDAO_HI; | |||
| import org.apache.ibatis.annotations.Select; | |||
| import org.springframework.stereotype.Component; | |||
| /** | |||
| * 文章信息预览Dao | |||
| */ | |||
| @Component("ArticlePreviewDao") | |||
| public interface ArticlePreviewDao extends BaseCommonDAO_HI<ArticlePreview> { | |||
| public interface ArticlePreviewDao extends BaseCommonDAO_HI<ArticlePreviewEntity> { | |||
| @Select("select count(1) from yxh_article where promotion_status = 1 and task_status = 1") | |||
| int findRecommend(); | |||
| } | |||
| @@ -2,12 +2,16 @@ 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; | |||
| /** | |||
| * YxhArticleEntity_MY Entity Object | |||
| * Tue May 10 15:09:48 CST 2022 Auto Generate | |||
| */ | |||
| @Data | |||
| @TableName("yxh_article") | |||
| @GeneratedKeyValue | |||
| @ApiModel(value = "文章信息表") | |||
| public class ArticleEntity { | |||
| private Long articleId; | |||
| private String publishUnit; | |||
| @@ -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; | |||
| import com.alibaba.fastjson.annotation.JSONField; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| @@ -11,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.Data; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| @Data | |||
| @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,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; | |||
| } | |||
| @@ -17,7 +17,7 @@ import java.util.List; | |||
| @Validated | |||
| @Api(value = "阅读有礼-文章", tags = "阅读有礼-文章") | |||
| @RestController | |||
| @RequestMapping("/read/article") | |||
| @RequestMapping("/ArticleController") | |||
| public class ArticleController { | |||
| @@ -51,4 +51,6 @@ public class ArticleController { | |||
| } | |||
| @@ -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,33 +0,0 @@ | |||
| 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.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.GetMapping; | |||
| import org.springframework.web.bind.annotation.PathVariable; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| @Validated | |||
| @Api(value = "阅读有礼文章统计数", tags = "阅读有礼文章统计数") | |||
| @RestController | |||
| @RequestMapping("/read/") | |||
| public class ArticleStatisticsController { | |||
| @Autowired | |||
| private IArticleServer iArticleServer; | |||
| @ApiOperation(value = "根据文章id获取统计数", notes = "根据文章id获取统计数") | |||
| @GetMapping(value = "/find/{articleId}/count") | |||
| @CheckToken | |||
| public ResponseData findByArticleIdCount(@PathVariable Long articleId) { | |||
| iArticleServer.findByArticleIdCount(articleId); | |||
| return null; | |||
| } | |||
| } | |||
| @@ -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,7 +3,6 @@ package com.yuexiu.secp.read.model.service; | |||
| import com.sie.iot.common.model.inter.IBaseCommon; | |||
| 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.CostUnitEntity; | |||
| @@ -3,7 +3,6 @@ package com.yuexiu.secp.read.model.service; | |||
| import com.yuexiu.secp.read.dto.ArticleQueryDto; | |||
| import com.yuexiu.secp.read.dto.RecommendDto; | |||
| import com.yuexiu.secp.read.model.entities.ArticleEntity; | |||
| @@ -16,6 +15,4 @@ public interface IArticleServer { | |||
| List<ArticleEntity> findPrevious(ArticleQueryDto articleQueryDto); | |||
| void findByArticleIdCount(Long articleId); | |||
| } | |||
| @@ -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()); | |||
| } | |||
| } | |||
| } | |||
| @@ -4,8 +4,9 @@ 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.ArticlePreviewDao; | |||
| import com.yuexiu.secp.read.model.dao.ArticleDao; | |||
| import com.yuexiu.secp.read.model.entities.ArticleEntity; | |||
| import com.yuexiu.secp.read.model.service.IArticleServer; | |||
| @@ -36,7 +37,7 @@ public class ArticleServer implements IArticleServer{ | |||
| * 文章DAO | |||
| */ | |||
| @Autowired | |||
| private ArticlePreviewDao articlePreviewDao; | |||
| private ArticleDao articleDao; | |||
| /** | |||
| @@ -55,16 +56,16 @@ public class ArticleServer implements IArticleServer{ | |||
| List<ArticleEntity> dataList = new ArrayList<>(); | |||
| //查询是否有最新推荐 | |||
| int count = articlePreviewDao.findRecommend(); | |||
| int count = articleDao.findRecommend(); | |||
| if (count < 1) { | |||
| return null; | |||
| } | |||
| //获取当前登录用户 | |||
| //获取我已推荐的文章 | |||
| Set<String> recommendIdList = redisTemplate.opsForSet().members(RedisUtils.getRedisKey("SIE" , "RECOMMEND" ,String.valueOf(articleQueryDto.getUserId()))); | |||
| 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("SIE" , "READ" ,"ARTICLE")); | |||
| Map<Object, Object> entries = redisTemplate.opsForHash().entries(RedisUtils.getRedisKey(ArticleConstant.SIE , ArticleConstant.READ ,ArticleConstant.ARTICLE)); | |||
| ObjectMapper objectMapper = new ObjectMapper(); | |||
| //剔除我已推荐文章 | |||
| for (String recommendId : recommendIdList) { | |||
| @@ -118,10 +119,6 @@ public class ArticleServer implements IArticleServer{ | |||
| return null; | |||
| } | |||
| @Override | |||
| public void findByArticleIdCount(Long articleId) { | |||
| } | |||
| } | |||