Jelajahi Sumber

fix(controller): 更新AI审核字段并优化优惠券规则查询接口

- 将AI审核内容检查中的"is_trade_related"字段更改为"is_compliant"
- 为获取优惠券规则列表接口增加acName和status查询参数
- 在服务层实现根据名称和状态筛选优惠券规则的功能
- 更新相关方法签名以支持新的查询条件
- 优化日志记录,包含新增的查询参数信息
qrs 5 hari lalu
induk
melakukan
793f71d9da

+ 1 - 1
alien-store/src/main/java/shop/alien/store/controller/AiAuditController.java

@@ -109,7 +109,7 @@ public class AiAuditController {
 
     private R<JSONObject> getAiAuditContentCheck(String accessToken, String text) {
         JSONObject data = new JSONObject();
-        data.put("is_trade_related", true);
+        data.put("is_compliant", true);
 
         // 初始化请求体Map
         Map<String, Object> requestBody = new HashMap<>();

+ 3 - 3
alien-store/src/main/java/shop/alien/store/controller/LifeDiscountCouponStoreFriendController.java

@@ -165,9 +165,9 @@ public class LifeDiscountCouponStoreFriendController {
     @ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "当前登录店铺id", dataType = "String", paramType = "query", required = true)
     })
     @GetMapping("/getRuleList")
-    private R<List<LifeDiscountCouponFriendRuleVo>> getRuleList(@RequestParam(value = "storeId") String storeId) {
-        log.info("LifeDiscountCouponStoreFriendController.getRuleList?storeId={}", storeId);
-        return R.data(lifeDiscountCouponStoreFriendService.getRuleList(storeId));
+    private R<List<LifeDiscountCouponFriendRuleVo>> getRuleList(@RequestParam(value = "storeId") String storeId, String acName, String status) {
+        log.info("LifeDiscountCouponStoreFriendController.getRuleList?storeId={},name={},status={}", storeId, acName, status);
+        return R.data(lifeDiscountCouponStoreFriendService.getRuleList(storeId, acName, status));
     }
 
     @ApiOperation("查询赠券记录")

+ 1 - 1
alien-store/src/main/java/shop/alien/store/service/LifeDiscountCouponStoreFriendService.java

@@ -55,7 +55,7 @@ public interface LifeDiscountCouponStoreFriendService extends IService<LifeDisco
 
     List<LifeDiscountCouponFriendRuleDetailVo> getReceivedFriendCouponList(String storeId,String friendStoreUserId);
 
-    List<LifeDiscountCouponFriendRuleVo> getRuleList(String storeId);
+    List<LifeDiscountCouponFriendRuleVo> getRuleList(String storeId, String acName, String status);
 
     LifeDiscountCouponFriendRuleVo getRuleById(String id);
 

+ 7 - 1
alien-store/src/main/java/shop/alien/store/service/impl/LifeDiscountCouponStoreFriendServiceImpl.java

@@ -471,11 +471,17 @@ public class LifeDiscountCouponStoreFriendServiceImpl extends ServiceImpl<LifeDi
     }
 
     @Override
-    public List<LifeDiscountCouponFriendRuleVo> getRuleList(String storeId) {
+    public List<LifeDiscountCouponFriendRuleVo> getRuleList(String storeId, String acName, String status) {
         List<LifeDiscountCouponFriendRuleVo> ruleList = lifeDiscountCouponFriendRuleDetailMapper.getRuleList(storeId);
         if (ObjectUtils.isNotEmpty(ruleList)) {
             ruleList.forEach(i -> i.setStatus(i.getEndDate().after(new Date()) ? "0" : "1"));
         }
+        if (StringUtils.isNotEmpty(acName)) {
+            ruleList = ruleList.stream().filter(i -> i.getAcName().contains(acName)).collect(Collectors.toList());
+        }
+        if (StringUtils.isNotEmpty(status)) {
+            ruleList = ruleList.stream().filter(i -> i.getStatus().equals(status)).collect(Collectors.toList());
+        }
         return ruleList;
     }