Browse Source

增加小程序获取评测列表接口

zyj
sj 2 years ago
parent
commit
ac911e41e1
  1. 54
      zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java
  2. 3
      zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/YxEvaluationService.java
  3. 20
      zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java
  4. 4
      zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java
  5. 3
      zsw-bxg/src/main/java/co/yixiang/modules/product/param/YxStoreProductQueryParam.java
  6. 3
      zsw-bxg/src/main/java/co/yixiang/modules/product/vo/YxStoreProductQueryVo.java
  7. 104
      zsw-bxg/src/main/java/co/yixiang/utils/location/EvaluationDTO.java
  8. 2
      zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java

54
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;
/**
* <p>
* 商品评测控制器
* </p>
*
* @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<List<EvaluationDTO>> getYxEvaluationPageList(){
return ApiResult.ok(yxEvaluationService.getList());
}
}

3
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<YxEvaluation> {
* @throws IOException /
*/
void download(List<YxEvaluationDto> all, HttpServletResponse response) throws IOException;
List<EvaluationDTO> getList();
}

20
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<YxEvaluationMapper,
}
FileUtil.downloadExcel(list, response);
}
/**
* 获取评测列表
* @return List
*/
@Override
public List<EvaluationDTO> getList() {
LambdaQueryWrapper<YxEvaluation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxEvaluation::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByAsc(YxEvaluation::getSort);
List<EvaluationDTO> list = generator.convert(baseMapper.selectList(wrapper),EvaluationDTO.class);
// return TreeUtil.list2TreeConverter(list,0);//没有父类,不需要树形
return list;
}
}

4
zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java

@ -58,7 +58,7 @@ public class YxStoreExpertServiceImpl extends BaseServiceImpl<YxStoreExpertMappe
}
/**
* 获取专家列表树形列表
* 获取专家列表
* @return List
*/
@Override
@ -67,7 +67,7 @@ public class YxStoreExpertServiceImpl extends BaseServiceImpl<YxStoreExpertMappe
wrapper.eq(YxStoreExpert::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByAsc(YxStoreExpert::getSort);
List<ExpertDTO> list = generator.convert(baseMapper.selectList(wrapper),ExpertDTO.class);
// return TreeUtil.list2TreeConverter(list,0);
// return TreeUtil.list2TreeConverter(list,0); //没有父类,不需要树形
return list;
}

3
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;

3
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;

104
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;
/**
* <p>
* 商城商品评测
* </p>
*
* @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<EvaluationDTO> children = new ArrayList<>();
}

2
zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java

@ -15,7 +15,7 @@ import java.util.List;
/**
* <p>
* 商城商品分类
* 商城专家
* </p>
*
* @author hupeng

Loading…
Cancel
Save