From 46e92f405bbf608e47fd43f66e35232118e02359 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Thu, 14 Aug 2025 11:14:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81sns=E7=9A=84feignConfig=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=85=BC=E5=AE=B9=E6=96=87=E4=BB=B6=E5=92=8C=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BC=A0=E8=BE=93=EF=BC=8C2=E3=80=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=B8=BE=E6=8A=A5=E6=9F=A5=E8=AF=A2=EF=BC=8C3?= =?UTF-8?q?=E3=80=81=E6=94=B9=E5=9B=9E=E5=B9=B3=E5=8F=B0=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShopBaseProductCategoryController.java | 6 ++-- .../suisung/mall/sns/config/FeignConfig.java | 11 +++++-- .../impl/SnsUserReportServiceImpl.java | 33 ++++++++++++------- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/mobile/ShopBaseProductCategoryController.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/mobile/ShopBaseProductCategoryController.java index aac12b28..a817adc5 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/mobile/ShopBaseProductCategoryController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/mobile/ShopBaseProductCategoryController.java @@ -41,9 +41,9 @@ public class ShopBaseProductCategoryController extends BaseController { @RequestMapping(value = "/listCategory", method = RequestMethod.GET) public CommonRes> listCategory(ProductCategoryListReq productCategoryListReq) { productCategoryListReq.setCategoryIsEnable(true); - if(productCategoryListReq.getStore_id().equals("0")){ - productCategoryListReq.setStore_id("58"); - } +// if(productCategoryListReq.getStore_id().equals("0")){ +// productCategoryListReq.setStore_id("58"); +// } IPage pageList = shopBaseProductCategoryService.lists(productCategoryListReq); return success(pageList); diff --git a/mall-sns/src/main/java/com/suisung/mall/sns/config/FeignConfig.java b/mall-sns/src/main/java/com/suisung/mall/sns/config/FeignConfig.java index b533e4b2..2052c9c8 100644 --- a/mall-sns/src/main/java/com/suisung/mall/sns/config/FeignConfig.java +++ b/mall-sns/src/main/java/com/suisung/mall/sns/config/FeignConfig.java @@ -5,6 +5,10 @@ import feign.RequestInterceptor; import feign.RequestTemplate; import feign.form.spring.SpringFormEncoder; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.ObjectFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; +import org.springframework.cloud.openfeign.support.SpringEncoder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.context.request.RequestContextHolder; @@ -15,7 +19,8 @@ import javax.servlet.http.HttpServletRequest; @Configuration @Slf4j public class FeignConfig { - + @Autowired + private ObjectFactory messageConverters; @Bean("requestInterceptor") public RequestInterceptor requestInterceptor() { return new RequestInterceptor() { @@ -32,6 +37,8 @@ public class FeignConfig { @Bean public Encoder feignFormEncoder() { - return new SpringFormEncoder(); + return new SpringFormEncoder( + new SpringEncoder(this.messageConverters)//兼容文件和参数的feign调用 + ); } } \ No newline at end of file diff --git a/mall-sns/src/main/java/com/suisung/mall/sns/service/impl/SnsUserReportServiceImpl.java b/mall-sns/src/main/java/com/suisung/mall/sns/service/impl/SnsUserReportServiceImpl.java index cf331a2d..849a9539 100644 --- a/mall-sns/src/main/java/com/suisung/mall/sns/service/impl/SnsUserReportServiceImpl.java +++ b/mall-sns/src/main/java/com/suisung/mall/sns/service/impl/SnsUserReportServiceImpl.java @@ -58,22 +58,33 @@ public class SnsUserReportServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(snsUserReport); + if(StringUtils.isNotBlank(reporterPhone)){ + queryWrapper.like("reporter_phone", reporterPhone); + } + if(StringUtils.isNotBlank(reportedPhone)){ + queryWrapper.like("reported_phone", reportedPhone); + } + if(StringUtils.isNotBlank(reporterNickname)){ + queryWrapper.like("reporter_nickname", reporterNickname); + } + if(StringUtils.isNotEmpty(reportedNickname)){ + queryWrapper.like("reported_nickname", reportedNickname); + } return this.lists(queryWrapper,pageNo,pageSize); }