Bläddra i källkod

landingType 不能为空

yangzian 4 år sedan
förälder
incheckning
980d4f4b49

+ 19 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/AiBytedanceAdvertiserStrategyController.java

@@ -372,10 +372,16 @@ public class AiBytedanceAdvertiserStrategyController {
 
 	@ApiOperation(value="获取行动号召", notes="获取行动号召")
 	@GetMapping(value = "/getAdActionText")
-	public Result getAdActionText(@RequestParam("accountId") String accountId,
-								  @RequestParam("landingType") String landingType,
+	public Result getAdActionText(@RequestParam(value = "accountId",required = false) String accountId,
+								  @RequestParam(value = "landingType",required = false) String landingType,
 								  @RequestParam(value = "advancedCreativeType",required = false) String advancedCreativeType) {
 		try {
+			if (Check.isNull(accountId)){
+				return Result.errorMsg("请选择账户。");
+			}
+			if (Check.isNull(landingType)){
+				return Result.errorMsg("投放内容不能为空");
+			}
 			return aiBytedanceAdvertiserStrategyService.getAdActionText(accountId,landingType,advancedCreativeType);
 		}catch (Exception e){
 			log.error("获取行动号召异常",e);
@@ -383,15 +389,21 @@ public class AiBytedanceAdvertiserStrategyController {
 		}
 	}
 
-	@ApiOperation(value="获取行动号召", notes="获取行动号召")
+	@ApiOperation(value="获取定向包", notes="获取定向包")
 	@GetMapping(value = "/getAdAudiencePackage")
-	public Result getAdAudiencePackage(@RequestParam("accountId") String accountId,
-								  @RequestParam(value = "landingType") String landingType,
-								  @RequestParam(value = "deliveryRange",required = false) String deliveryRange) {
+	public Result getAdAudiencePackage(@RequestParam(value = "accountId",required = false) String accountId,
+									   @RequestParam(value = "landingType",required = false) String landingType,
+									   @RequestParam(value = "deliveryRange",required = false) String deliveryRange) {
 		try {
+			if (Check.isNull(accountId)){
+				return Result.errorMsg("请选择账户。");
+			}
+			if (Check.isNull(landingType)){
+				return Result.errorMsg("投放内容不能为空");
+			}
 			return aiBytedanceAdvertiserStrategyService.getAdAudiencePackage(accountId,landingType,deliveryRange);
 		}catch (Exception e){
-			log.error("获取行动号召异常",e);
+			log.error("获取定向包异常",e);
 			return Result.error("请求失败,请联系开发人员!");
 		}
 	}