From aae9a494f83882a004311d3bb95b1eb081f38f02 Mon Sep 17 00:00:00 2001 From: Administrator <15274802129@163.com> Date: Thu, 10 Jul 2025 16:13:45 +0800 Subject: [PATCH] refactor(mall): 优化身材数据选择逻辑 --- src/main/java/cc/mrbird/febs/mall/service/impl/ClothesTypeServiceImpl.java | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ClothesTypeServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ClothesTypeServiceImpl.java index f52d65f..0c1efce 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/ClothesTypeServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ClothesTypeServiceImpl.java @@ -16,10 +16,7 @@ import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; import cc.mrbird.febs.mall.service.IMallMoneyFlowService; import cc.mrbird.febs.mall.vo.AdminMallOrderInfoVo; -import cc.mrbird.febs.mall.vo.clothes.AdminClothesLocationRemarkVo; -import cc.mrbird.febs.mall.vo.clothes.AdminClothesOrderListVo; -import cc.mrbird.febs.mall.vo.clothes.AdminClothesPatternRemarkVo; -import cc.mrbird.febs.mall.vo.clothes.AdminClothesSocialListVo; +import cc.mrbird.febs.mall.vo.clothes.*; import cc.mrbird.febs.pay.util.WeixinServiceUtil; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; @@ -74,6 +71,7 @@ private final ClothesPatternRemarkMapper clothesPatternRemarkMapper; private final ClothesLocationRemarkMapper clothesLocationRemarkMapper; + private final ClothesSocialCommentMapper clothesSocialCommentMapper; private final IApiMallMemberWalletService memberWalletService; private final IMallMoneyFlowService mallMoneyFlowService; @@ -752,6 +750,13 @@ } @Override + public IPage<AdminClothesSocialCommentVo> socialComment(ClothesSocialComment dto, QueryRequest request) { + Page<AdminClothesSocialCommentVo> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<AdminClothesSocialCommentVo> vos = clothesSocialCommentMapper.selectSocialCommentListInPage(page, dto); + return vos; + } + + @Override public FebsResponse socialState(Long id, Integer state) { ClothesSocial clothesSocial = clothesSocialMapper.selectById(id); @@ -768,6 +773,39 @@ } @Override + public FebsResponse commentStateSwitch(Long id, Integer state) { + + ClothesSocial clothesSocial = clothesSocialMapper.selectById(id); + if(ObjectUtil.isNull(clothesSocial)){ + throw new RuntimeException("内容不存在"); + } + clothesSocialMapper.update( + null, + Wrappers.lambdaUpdate(ClothesSocial.class) + .set(ClothesSocial::getCommentState, state) + .eq(ClothesSocial::getId, id) + ); + return new FebsResponse().success().message("操作成功"); + } + + @Override + public FebsResponse showStateSwitch(Long id, Integer state) { + + ClothesSocialComment clothesSocialComment = clothesSocialCommentMapper.selectById(id); + + if(ObjectUtil.isNull(clothesSocialComment)){ + throw new RuntimeException("评论不存在"); + } + clothesSocialCommentMapper.update( + null, + Wrappers.lambdaUpdate(ClothesSocialComment.class) + .set(ClothesSocialComment::getShowState, state) + .eq(ClothesSocialComment::getId, id) + ); + return new FebsResponse().success().message("操作成功"); + } + + @Override public FebsResponse socialHotState(Long id, Integer state) { ClothesSocial clothesSocial = clothesSocialMapper.selectById(id); -- Gitblit v1.9.1