| | |
| | | |
| | | import cn.lili.common.aop.annotation.PreventDuplicateSubmissions; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.member.entity.dto.EvaluationQueryParams; |
| | | import cn.lili.modules.member.entity.vo.MemberEvaluationListVO; |
| | | import cn.lili.modules.member.entity.vo.MemberEvaluationVO; |
| | | import cn.lili.modules.member.service.MemberEvaluationService; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管理端,会员商品评价接口 |
| | |
| | | public class MemberEvaluationManagerController { |
| | | @Autowired |
| | | private MemberEvaluationService memberEvaluationService; |
| | | |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | @PreventDuplicateSubmissions |
| | | @ApiOperation(value = "通过id获取评论") |
| | | @ApiImplicitParam(name = "id", value = "评价ID", required = true, dataType = "String", paramType = "path") |
| | | @GetMapping(value = "/get/{id}") |
| | | public ResultMessage<MemberEvaluationVO> get(@PathVariable String id) { |
| | | |
| | | return ResultUtil.data(memberEvaluationService.queryById(id)); |
| | | MemberEvaluationVO t = memberEvaluationService.queryById(id); |
| | | String images = t.getImages(); |
| | | if (StringUtils.isNotBlank(images)) { |
| | | String[] split = images.split(","); |
| | | List<String> imgList = new ArrayList<>(split.length); |
| | | for (String s : split) { |
| | | if (StringUtils.isNotBlank(s)&&!s.contains("http")) { |
| | | imgList.add(cosUtil.getPreviewUrl(s)); |
| | | } |
| | | } |
| | | t.setImages(String.join(",", imgList)); |
| | | } |
| | | String goodsImage = t.getGoodsImage(); |
| | | if (StringUtils.isNotBlank(goodsImage)&&!goodsImage.contains("http")) { |
| | | t.setGoodsImage(cosUtil.getPreviewUrl(goodsImage)); |
| | | } |
| | | String memberProfile = t.getMemberProfile(); |
| | | if (StringUtils.isNotBlank(memberProfile)&&!memberProfile.contains("http")) { |
| | | t.setMemberProfile(cosUtil.getPreviewUrl(memberProfile)); |
| | | } |
| | | return ResultUtil.data(t); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取评价分页") |