Răsfoiți Sursa

关注推荐新品接口提交

zjy 2 săptămâni în urmă
părinte
comite
de295c7241

+ 20 - 0
alien-entity/src/main/java/shop/alien/entity/second/vo/SecondCommentVo.java

@@ -0,0 +1,20 @@
+package shop.alien.entity.second.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import shop.alien.entity.store.StoreComment;
+
+@Data
+@JsonInclude
+@ApiModel(value = "二手商品", description = "用户信息")
+public class SecondCommentVo extends StoreComment {
+
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+
+    @ApiModelProperty(value = "用户头像")
+    private String userImage;
+
+}

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/second/vo/SecondGoodsRecommendVo.java

@@ -45,7 +45,7 @@ public class SecondGoodsRecommendVo extends SecondGoods {
     private String commentCount;
 
     @ApiModelProperty(value = "评论列表")
-    private List<StoreComment> commentList;
+    private List<SecondCommentVo> commentList;
 
     @ApiModelProperty(value = "话题列表")
     @JsonProperty("topicList")

+ 2 - 1
alien-entity/src/main/java/shop/alien/mapper/second/SecondRecommendMapper.java

@@ -3,6 +3,7 @@ package shop.alien.mapper.second;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
+import shop.alien.entity.second.vo.SecondCommentVo;
 import shop.alien.entity.second.vo.SecondGoodsRecommendVo;
 import shop.alien.entity.store.StoreComment;
 
@@ -22,7 +23,7 @@ public interface SecondRecommendMapper extends BaseMapper<SecondGoodsRecommendVo
 
     IPage<SecondGoodsRecommendVo> querySecondNewGoodsByPage(IPage<SecondGoodsRecommendVo> page,@Param("userId") String userId, @Param("phoneId") String phoneId, @Param("position") String position);
 
-    List<StoreComment> querySecondCommentInfo(@Param("ids") List<Integer> ids);
+    List<SecondCommentVo> querySecondCommentInfo(@Param("ids") List<Integer> ids);
 
     SecondGoodsRecommendVo querySecondGoodsDetail(@Param("goodsId") Integer goodsId, @Param("phoneId") String phoneId, @Param("position") String position);
 }

+ 1 - 1
alien-entity/src/main/resources/mapper/second/SecondGoodsInfoMapper.xml

@@ -114,7 +114,7 @@
             f.fans_id = #{phoneId} and f.delete_flag = 0
     </select>
 
-    <select id="querySecondCommentInfo" resultType="shop.alien.entity.store.StoreComment">
+    <select id="querySecondCommentInfo" resultType="shop.alien.entity.second.vo.SecondCommentVo">
         select
             business_id,
             comment_content,

+ 0 - 7
alien-second/src/main/java/shop/alien/second/controller/SecondRecommendController.java

@@ -7,12 +7,8 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiSort;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.kie.api.KieBase;
-import org.kie.api.runtime.KieSession;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
-import shop.alien.entity.second.Order;
 import shop.alien.entity.second.vo.SecondGoodsRecommendVo;
 import shop.alien.second.service.SecondRecommendService;
 
@@ -27,9 +23,6 @@ public class SecondRecommendController {
 
     private final SecondRecommendService service;
 
-    @Autowired
-    private static KieBase kieBase;
-
     @ApiOperation("搜索推荐商品列表")
     @PostMapping("/queryRecommendList")
     public R<IPage<SecondGoodsRecommendVo>> queryRecommendList(

+ 6 - 6
alien-second/src/main/java/shop/alien/second/service/impl/SecondRecommendServiceImpl.java

@@ -5,11 +5,11 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.extern.flogger.Flogger;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import shop.alien.entity.second.vo.SecondCommentVo;
 import shop.alien.entity.second.vo.SecondGoodsRecommendVo;
 import shop.alien.entity.store.LifeFans;
 import shop.alien.entity.store.StoreComment;
@@ -93,7 +93,7 @@ public class SecondRecommendServiceImpl extends ServiceImpl<SecondRecommendMappe
             if (CollectionUtil.isEmpty(idList)) {
                 return list;
             }
-            List<StoreComment> commentList =mapper.querySecondCommentInfo(idList);
+            List<SecondCommentVo> commentList =mapper.querySecondCommentInfo(idList);
             list.getRecords().forEach(item -> {
                 // 距离拼接
                 if (StringUtil.isNotBlank(item.getDist())) {
@@ -101,7 +101,7 @@ public class SecondRecommendServiceImpl extends ServiceImpl<SecondRecommendMappe
                 }
 
                 // 评论列表
-                List<StoreComment> cList = new ArrayList<>();
+                List<SecondCommentVo> cList = new ArrayList<>();
                 commentList.forEach(comment -> {
                     if (item.getId() == comment.getBusinessId()) {
                         cList.add(comment);
@@ -125,7 +125,7 @@ public class SecondRecommendServiceImpl extends ServiceImpl<SecondRecommendMappe
      * @return 关注列表
      */
     public IPage<SecondGoodsRecommendVo> querySecondNewGoodsByPage(
-            IPage<SecondGoodsRecommendVo> page, String position) throws Exception{
+            IPage<SecondGoodsRecommendVo> page, String position) throws Exception {
         try {
             JSONObject data = JwtUtil.getCurrentUserInfo();
             String phoneId = null;
@@ -144,7 +144,7 @@ public class SecondRecommendServiceImpl extends ServiceImpl<SecondRecommendMappe
             if (CollectionUtil.isEmpty(idList)) {
                 return list;
             }
-            List<StoreComment> commentList = mapper.querySecondCommentInfo(idList);
+            List<SecondCommentVo> commentList = mapper.querySecondCommentInfo(idList);
             list.getRecords().forEach(item -> {
                 // 距离拼接
                 if (StringUtil.isNotBlank(item.getDist())) {
@@ -152,7 +152,7 @@ public class SecondRecommendServiceImpl extends ServiceImpl<SecondRecommendMappe
                 }
 
                 // 评论列表
-                List<StoreComment> cList = new ArrayList<>();
+                List<SecondCommentVo> cList = new ArrayList<>();
                 commentList.forEach(comment -> {
                     if (item.getId() == comment.getBusinessId()) {
                         cList.add(comment);