Quellcode durchsuchen

外部公众号增加渠道校验

xueyiming vor 2 Monaten
Ursprung
Commit
72bcc98a71

+ 6 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/GhDetailServiceImpl.java

@@ -22,6 +22,7 @@ import org.springframework.util.CollectionUtils;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 @Slf4j
 @Service
@@ -180,6 +181,11 @@ public class GhDetailServiceImpl implements GhDetailService {
     }
 
     private CommonResponse<Void> checkParam(GhDetailVo ghDetailVo) {
+        if (Objects.equals(ghDetailVo.getType(), GhTypeEnum.THIRD_PARTY_GH.type)) {
+            if (StringUtils.isEmpty(ghDetailVo.getChannel())) {
+                return CommonResponse.create(500, "渠道不能为空");
+            }
+        }
         if (StringUtils.isNotEmpty(ghDetailVo.getRate())) {
             if (!JSONArray.isValidArray(ghDetailVo.getRate())) {
                 return CommonResponse.create(500, "保底比率格式错误");