From ac911e41e1587cc09fc3c1ee4e889a8851b39e2d Mon Sep 17 00:00:00 2001 From: sj <1304317391@qq.com> Date: Mon, 26 Sep 2022 11:08:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=AF=84=E6=B5=8B=E5=88=97=E8=A1=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rest/AppStoreEvaluationController.java | 54 +++++++++ .../service/YxEvaluationService.java | 3 + .../service/impl/YxEvaluationServiceImpl.java | 20 ++++ .../impl/YxStoreExpertServiceImpl.java | 4 +- .../param/YxStoreProductQueryParam.java | 3 + .../product/vo/YxStoreProductQueryVo.java | 3 + .../yixiang/utils/location/EvaluationDTO.java | 104 ++++++++++++++++++ .../co/yixiang/utils/location/ExpertDTO.java | 2 +- 8 files changed, 190 insertions(+), 3 deletions(-) create mode 100644 zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java create mode 100644 zsw-bxg/src/main/java/co/yixiang/utils/location/EvaluationDTO.java diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java new file mode 100644 index 00000000..7997a64f --- /dev/null +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java @@ -0,0 +1,54 @@ +/** + * Copyright (C) 2018-2022 + * All rights reserved, Designed By www.yixiang.co + * 注意: + * 本软件为www.yixiang.co开发研制,未经购买不得使用 + * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) + * 一经发现盗用、分享等行为,将追究法律责任,后果自负 + */ +package co.yixiang.app.modules.evaluation.rest; + +import cn.iocoder.yudao.framework.common.pojo.ApiResult; +import co.yixiang.annotation.AnonymousAccess; +import co.yixiang.modules.evaluation.service.YxEvaluationService; +import co.yixiang.utils.location.EvaluationDTO; +import co.yixiang.utils.location.ExpertDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + *

+ * 商品评测控制器 + *

+ * + * @author ssj + * @since 2022-9-20 + */ +@Slf4j +@RestController +@Api(value = "产品评测", tags = "商城:评测") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class AppStoreEvaluationController { + + private final YxEvaluationService yxEvaluationService; + + + /** + * 商品分类列表 + */ + @AnonymousAccess + @GetMapping("/evaluation") + @ApiOperation(value = "评测列表",notes = "产品评测") + public ApiResult> getYxEvaluationPageList(){ + return ApiResult.ok(yxEvaluationService.getList()); + } + +} + diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/YxEvaluationService.java b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/YxEvaluationService.java index 292e44a4..69ea5064 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/YxEvaluationService.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/YxEvaluationService.java @@ -13,6 +13,7 @@ import co.yixiang.domain.PageResult; import co.yixiang.modules.evaluation.domain.YxEvaluation; import co.yixiang.modules.evaluation.service.dto.YxEvaluationDto; import co.yixiang.modules.evaluation.service.dto.YxEvaluationQueryCriteria; +import co.yixiang.utils.location.EvaluationDTO; import org.springframework.data.domain.Pageable; import javax.servlet.http.HttpServletResponse; @@ -46,4 +47,6 @@ public interface YxEvaluationService extends BaseService { * @throws IOException / */ void download(List all, HttpServletResponse response) throws IOException; + + List getList(); } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java index 6fea3888..f89225a1 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java @@ -12,12 +12,18 @@ import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.domain.PageResult; import co.yixiang.dozer.service.IGenerator; +import co.yixiang.enums.ShopCommonEnum; import co.yixiang.modules.evaluation.domain.YxEvaluation; import co.yixiang.modules.evaluation.service.YxEvaluationService; import co.yixiang.modules.evaluation.service.dto.YxEvaluationDto; import co.yixiang.modules.evaluation.service.dto.YxEvaluationQueryCriteria; import co.yixiang.modules.evaluation.service.mapper.YxEvaluationMapper; +import co.yixiang.modules.expert.domain.YxStoreExpert; import co.yixiang.utils.FileUtil; +import co.yixiang.utils.TreeUtil; +import co.yixiang.utils.location.EvaluationDTO; +import co.yixiang.utils.location.ExpertDTO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.github.pagehelper.PageInfo; import lombok.AllArgsConstructor; import org.springframework.data.domain.Pageable; @@ -85,4 +91,18 @@ public class YxEvaluationServiceImpl extends BaseServiceImpl getList() { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(YxEvaluation::getIsShow, ShopCommonEnum.SHOW_1.getValue()) + .orderByAsc(YxEvaluation::getSort); + List list = generator.convert(baseMapper.selectList(wrapper),EvaluationDTO.class); +// return TreeUtil.list2TreeConverter(list,0);//没有父类,不需要树形 + return list; + } } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java index d20f59e4..35f1f6d9 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java @@ -58,7 +58,7 @@ public class YxStoreExpertServiceImpl extends BaseServiceImpl list = generator.convert(baseMapper.selectList(wrapper),ExpertDTO.class); -// return TreeUtil.list2TreeConverter(list,0); +// return TreeUtil.list2TreeConverter(list,0); //没有父类,不需要树形 return list; } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/param/YxStoreProductQueryParam.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/param/YxStoreProductQueryParam.java index 3ec842e3..77823e6e 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/param/YxStoreProductQueryParam.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/param/YxStoreProductQueryParam.java @@ -26,6 +26,9 @@ public class YxStoreProductQueryParam extends QueryParam { @ApiModelProperty(value = "分类ID") private String sid; + @ApiModelProperty(value = "品牌ID") + private String bid; + @ApiModelProperty(value = "是否新品") private String news; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/vo/YxStoreProductQueryVo.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/vo/YxStoreProductQueryVo.java index 387cf761..074e79d0 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/vo/YxStoreProductQueryVo.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/vo/YxStoreProductQueryVo.java @@ -79,6 +79,9 @@ public class YxStoreProductQueryVo implements Serializable { @ApiModelProperty(value = "分类id") private String cateId; + @ApiModelProperty(value = "品牌id") + private String brandId; + @ApiModelProperty(value = "商品价格") @JsonSerialize(using = BigDecimalSerializer.class) private BigDecimal price; diff --git a/zsw-bxg/src/main/java/co/yixiang/utils/location/EvaluationDTO.java b/zsw-bxg/src/main/java/co/yixiang/utils/location/EvaluationDTO.java new file mode 100644 index 00000000..9679bded --- /dev/null +++ b/zsw-bxg/src/main/java/co/yixiang/utils/location/EvaluationDTO.java @@ -0,0 +1,104 @@ +package co.yixiang.utils.location; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 商城商品评测 + *

+ * + * @author sj + * @since 2022-09-26 + */ +public class EvaluationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** 评测ID */ + @TableId + private Integer id; + + + /** 在列表里面的首页图 */ + private String homeImage; + + + /** 评测介绍 */ + private String synopsis; + + + /** 评测视频 */ + @NotBlank + private String videoInput; + + + + /** 关联商品信息 */ + @NotNull + private String product; + + /** 评测总结 */ + private String summary; + + + /** 产品展示图集 */ + private String displayImage; + + + /** 产品展示文字 */ + private String displaySynopsis; + + + /** 实用体验感受图 */ + private String feelImage; + + + /** 使用体验感受文字 */ + private String feelSynopsis; + + + /** 易用性体验图 */ + private String accessibilityImage; + + + /** 易用性体验文字 */ + private String accessibilitySynopsis; + + + /** 添加时间 */ + @TableField(fill= FieldFill.INSERT) + private Timestamp createTime; + + + /** 更新时间 */ + @TableField(fill= FieldFill.INSERT_UPDATE) + private Timestamp updateTime; + + + /** 是否删除 */ + private Integer isDel; + + + /** 是否展示 */ + private Integer isShow; + + + /** 排序 */ + @NotNull + private Integer sort; + + + private Long tenantId; + + private List children = new ArrayList<>(); +} diff --git a/zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java b/zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java index 02fc9e96..48326638 100644 --- a/zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java +++ b/zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java @@ -15,7 +15,7 @@ import java.util.List; /** *

- * 商城商品分类 + * 商城专家 *

* * @author hupeng