Bladeren bron

bugfix:二手相关bug

刘云鑫 2 maanden geleden
bovenliggende
commit
778bfd04b1

+ 2 - 2
alien-entity/src/main/java/shop/alien/entity/store/CommonComment.java

@@ -28,11 +28,11 @@ public class CommonComment implements Serializable {
     @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
-    @ApiModelProperty(value = "评论来源类型:1-评价的评论 2-动态评论 3-打卡评论")
+    @ApiModelProperty(value = "评论来源类型:1-评价的评论 2-动态评论 3-打卡评论,4-二手商品评论")
     @TableField("source_type")
     private Integer sourceType;
 
-    @ApiModelProperty(value = "来源关联ID:source_type=1时=rating.id,=2时=动态ID,=3打卡id")
+    @ApiModelProperty(value = "来源关联ID:source_type=1时=rating.id,=2时=动态ID,=3打卡id,=4时=二手商品ID")
     @TableField("source_id")
     private Long sourceId;
 

+ 2 - 2
alien-store/src/main/java/shop/alien/store/service/LifeCommentService.java

@@ -196,7 +196,7 @@ public class LifeCommentService {
                 return commonRatingMapper.update(null, new UpdateWrapper<CommonRating>()
                         .setSql("like_count = like_count + 1")
                         .eq("id", huifuId));
-            } else if (CommonConstant.COMMENT_LIKE.equals(type) || CommonConstant.DYNAMIC_LIKE.equals(type) || CommonConstant.CLOCK_IN_LIKE.equals(type)) {
+            } else if (CommonConstant.COMMENT_LIKE.equals(type) || CommonConstant.DYNAMIC_LIKE.equals(type) || CommonConstant.CLOCK_IN_LIKE.equals(type) || CommonConstant.SECOND_HAND_LIKE.equals(type)) {
                 // 12-评论点赞:更新评论表点赞数
                 return commonCommentMapper.update(null, new UpdateWrapper<CommonComment>()
                         .setSql("like_count = like_count + 1")
@@ -364,7 +364,7 @@ public class LifeCommentService {
                 return commonRatingMapper.update(null, new UpdateWrapper<CommonRating>()
                         .setSql("like_count = like_count - 1")
                         .eq("id", huifuId));
-            } else if (CommonConstant.COMMENT_LIKE.equals(type) || CommonConstant.DYNAMIC_LIKE.equals(type) || CommonConstant.CLOCK_IN_LIKE.equals(type)) {
+            } else if (CommonConstant.COMMENT_LIKE.equals(type) || CommonConstant.DYNAMIC_LIKE.equals(type) || CommonConstant.CLOCK_IN_LIKE.equals(type) || CommonConstant.SECOND_HAND_LIKE.equals(type)) {
                 // 12-评论点赞:更新评论表点赞数
                 return commonCommentMapper.update(null, new UpdateWrapper<CommonComment>()
                         .setSql("like_count = like_count - 1")

+ 2 - 0
alien-store/src/main/java/shop/alien/store/service/impl/CommonCommentServiceImpl.java

@@ -88,6 +88,8 @@ public class CommonCommentServiceImpl extends ServiceImpl<CommonCommentMapper, C
             likeType = CommonConstant.DYNAMIC_LIKE;
         } else if (sourceType == CommentSourceTypeEnum.CLOCK_IN_COMMENT.getType()){
             likeType = CommonConstant.CLOCK_IN_LIKE;
+        } else if (sourceType == CommentSourceTypeEnum.SECOND_HAND_COMMENT.getType()){
+            likeType =  CommonConstant.SECOND_HAND_LIKE;
         }
         List<CommonCommentVo> firstLevelComment = getFirstLevelComment(sourceType, sourceId, pageNum, pageSize, userId,likeType);
         CommonRatingVo commonRatingVo = new CommonRatingVo();

+ 1 - 0
alien-store/src/main/java/shop/alien/store/util/CommonConstant.java

@@ -113,6 +113,7 @@ public class CommonConstant {
     public static final String COMMENT_LIKE = "12";
     public static final String DYNAMIC_LIKE = "13";
     public static final String CLOCK_IN_LIKE = "14";
+    public static final String SECOND_HAND_LIKE = "15";
 
 
     /**

+ 2 - 1
alien-util/src/main/java/shop/alien/util/common/constant/CommentSourceTypeEnum.java

@@ -4,7 +4,8 @@ package shop.alien.util.common.constant;
 public enum CommentSourceTypeEnum {
     STORE_COMMENT(1, "店铺评价"),
     DYNAMIC_COMMENT(2, "动态评论"),
-    CLOCK_IN_COMMENT(3, "打卡评论");
+    CLOCK_IN_COMMENT(3, "打卡评论"),
+    SECOND_HAND_COMMENT(4, "二手商品评论");
     private final Integer type;
     private final String info;