|
|
@@ -1,5 +1,25 @@
|
|
|
package com.moka.gdtauto.controller;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
+
|
|
|
+import org.springaicommunity.mcp.annotation.McpTool;
|
|
|
+import org.springaicommunity.mcp.annotation.McpToolParam;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -9,16 +29,15 @@ import com.moka.gdtauto.controller.vo.CreateAdPlanConfRequest;
|
|
|
import com.moka.gdtauto.controller.vo.UpdateAdPlanConfRequest;
|
|
|
import com.moka.gdtauto.entity.AccountGroup;
|
|
|
import com.moka.gdtauto.entity.AccountGroupAccountRelationship;
|
|
|
+import com.moka.gdtauto.entity.AdPlan;
|
|
|
import com.moka.gdtauto.entity.AdPlanConf;
|
|
|
+import com.moka.gdtauto.entity.AdPlanCreative;
|
|
|
+import com.moka.gdtauto.entity.OssFile;
|
|
|
import com.moka.gdtauto.entity.SysUser;
|
|
|
import com.moka.gdtauto.entity.TencentAssetDrama;
|
|
|
import com.moka.gdtauto.entity.TencentAssetFiction;
|
|
|
-import com.moka.gdtauto.entity.AdPlan;
|
|
|
-import com.moka.gdtauto.entity.AdPlanCreative;
|
|
|
-import com.moka.gdtauto.entity.OssFile;
|
|
|
-import com.moka.gdtauto.service.SysUserService;
|
|
|
-
|
|
|
import com.moka.gdtauto.mapper.AccountGroupAccountRelationshipMapper;
|
|
|
+import com.moka.gdtauto.mapper.OssFileMapper;
|
|
|
import com.moka.gdtauto.mapper.TencentAssetDramaMapper;
|
|
|
import com.moka.gdtauto.mapper.TencentAssetFictionMapper;
|
|
|
import com.moka.gdtauto.service.AccountGroupService;
|
|
|
@@ -28,6 +47,7 @@ import com.moka.gdtauto.service.AdPlanCreativeService;
|
|
|
import com.moka.gdtauto.service.AdPlanDailyReportService;
|
|
|
import com.moka.gdtauto.service.AdPlanService;
|
|
|
import com.moka.gdtauto.service.OssFileService;
|
|
|
+import com.moka.gdtauto.service.SysUserService;
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
@@ -36,20 +56,6 @@ import jakarta.validation.constraints.NotNull;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
-
|
|
|
-import org.springframework.data.redis.core.RedisTemplate;
|
|
|
-import org.springaicommunity.mcp.annotation.McpTool;
|
|
|
-import org.springaicommunity.mcp.annotation.McpToolParam;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
-
|
|
|
/**
|
|
|
* 广告计划配置管理控制器
|
|
|
*
|
|
|
@@ -75,6 +81,7 @@ public class AdPlanConfController {
|
|
|
private final TencentAssetDramaMapper tencentAssetDramaMapper;
|
|
|
private final TencentAssetFictionMapper tencentAssetFictionMapper;
|
|
|
private final OssFileService ossFileService;
|
|
|
+ private final OssFileMapper ossFileMapper;
|
|
|
|
|
|
@GetMapping("/gdtSuspendByConfId")
|
|
|
public Result<Void> gdtSuspendByConfId(@NotNull Long confId) {
|
|
|
@@ -690,11 +697,7 @@ public class AdPlanConfController {
|
|
|
@PostMapping("/getOneCreativeImage")
|
|
|
public Result<OssFile> getOneCreativeImage(@RequestBody List<Long> ids) {
|
|
|
try {
|
|
|
- OssFile ossFile = ossFileService.lambdaQuery()
|
|
|
- .notIn(ids != null && !ids.isEmpty(), OssFile::getId, ids)
|
|
|
- .eq(OssFile::getBusinessType, 1)
|
|
|
- .eq(OssFile::getFileType, "image")
|
|
|
- .last("order by rand() limit 1").one();
|
|
|
+ OssFile ossFile = ossFileMapper.selectOneCreativeImage(ids);
|
|
|
return Result.success(ossFile, "查询成功");
|
|
|
} catch (Exception e) {
|
|
|
log.error("查询创意图片失败", e);
|
|
|
@@ -705,11 +708,7 @@ public class AdPlanConfController {
|
|
|
@PostMapping("/getOneCreativeVideo")
|
|
|
public Result<OssFile> getOneCreativeVideo(@RequestBody List<Long> ids) {
|
|
|
try {
|
|
|
- OssFile ossFile = ossFileService.lambdaQuery()
|
|
|
- .notIn(ids != null && !ids.isEmpty(), OssFile::getId, ids)
|
|
|
- .eq(OssFile::getBusinessType, 1)
|
|
|
- .eq(OssFile::getFileType, "video")
|
|
|
- .last("order by rand() limit 1").one();
|
|
|
+ OssFile ossFile = ossFileMapper.selectOneCreativeVideo(ids);
|
|
|
return Result.success(ossFile, "查询成功");
|
|
|
} catch (Exception e) {
|
|
|
log.error("查询创意视频失败", e);
|