|
@@ -0,0 +1,663 @@
|
|
|
|
|
+package com.tzld.ad.controller.marketing;
|
|
|
|
|
+
|
|
|
|
|
+import com.tzld.ad.annotation.JwtIgnore;
|
|
|
|
|
+import com.tzld.ad.common.base.CommonResponse;
|
|
|
|
|
+import com.tzld.ad.marketing.client.*;
|
|
|
|
|
+import com.tzld.ad.marketing.model.TencentApiResponse;
|
|
|
|
|
+import com.tzld.ad.marketing.model.adgroup.AdGroupDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.advertiser.AdvertiserDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.audience.AudienceDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.batch.BatchDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.component.ComponentDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.creative.CreativeDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.funds.FundsDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.image.ImageDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.oauth.OAuthDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.page.PageDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.report.ReportDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.useraction.UserActionDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.video.VideoDTO;
|
|
|
|
|
+import com.tzld.ad.marketing.model.wechat.WechatDTO;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 腾讯广告 Marketing API 统一调用入口
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 通过 path 区分不同的 client 模块:
|
|
|
|
|
+ * - /oauth/*: OAuth 授权
|
|
|
|
|
+ * - /agency/*: 服务商账号
|
|
|
|
|
+ * - /advertiser/*: 广告账号
|
|
|
|
|
+ * - /funds/*: 资金
|
|
|
|
|
+ * - /adgroup/*: 广告
|
|
|
|
|
+ * - /creative/*: 创意
|
|
|
|
|
+ * - /component/*: 创意组件
|
|
|
|
|
+ * - /image/*: 图片
|
|
|
|
|
+ * - /video/*: 视频
|
|
|
|
|
+ * - /page/*: 落地页
|
|
|
|
|
+ * - /audience/*: 客户人群
|
|
|
|
|
+ * - /useraction/*: 用户行为数据
|
|
|
|
|
+ * - /useractionset/*: 用户行为数据源
|
|
|
|
|
+ * - /batch/*: 批量操作
|
|
|
|
|
+ * - /report/*: 报表
|
|
|
|
|
+ * - /wechat/*: 公众号
|
|
|
|
|
+ */
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/marketing")
|
|
|
|
|
+public class TencentMarketingController {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private OAuthClient oauthClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private AgencyClient agencyClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private AdvertiserClient advertiserClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FundsClient fundsClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private AdGroupClient adGroupClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CreativeClient creativeClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ComponentClient componentClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ImageClient imageClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private VideoClient videoClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private PageClient pageClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CustomAudienceClient customAudienceClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private UserActionClient userActionClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private UserActionSetClient userActionSetClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private BatchClient batchClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DailyReportClient dailyReportClient;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WechatClient wechatClient;
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== OAuth 授权 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/oauth/authorize")
|
|
|
|
|
+ public CommonResponse<String> buildAuthorizeUrl(@RequestParam String state,
|
|
|
|
|
+ @RequestParam(required = false) String scope) {
|
|
|
|
|
+ String url = oauthClient.buildAuthorizeUrl(state, scope);
|
|
|
|
|
+ return CommonResponse.success(url);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/oauth/token")
|
|
|
|
|
+ public CommonResponse<OAuthDTO.TokenResponse> getToken(@RequestParam String authorizationCode) {
|
|
|
|
|
+ OAuthDTO.TokenResponse response = oauthClient.getToken(authorizationCode);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/oauth/refresh")
|
|
|
|
|
+ public CommonResponse<OAuthDTO.TokenResponse> refreshToken(@RequestParam String refreshToken) {
|
|
|
|
|
+ OAuthDTO.TokenResponse response = oauthClient.refreshToken(refreshToken);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 服务商账号 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/agency/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<AdvertiserDTO.AgencyInfo>> getAgency(@RequestParam String accessToken) {
|
|
|
|
|
+ TencentApiResponse<AdvertiserDTO.AgencyInfo> response = agencyClient.getAgency(accessToken);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 广告账号 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/advertiser/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<AdvertiserDTO.AdvertiserInfo>>> getAdvertisers(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam(required = false) List<Long> accountIdList) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<AdvertiserDTO.AdvertiserInfo>> response =
|
|
|
|
|
+ advertiserClient.getAdvertisers(accessToken, accountId, accountIdList);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/advertiser/getOne")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<AdvertiserDTO.AdvertiserInfo>> getAdvertiser(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId) {
|
|
|
|
|
+ TencentApiResponse<AdvertiserDTO.AdvertiserInfo> response =
|
|
|
|
|
+ advertiserClient.getAdvertiser(accessToken, accountId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/advertiser/update")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> updateAdvertiser(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody AdvertiserDTO.UpdateRequest request) {
|
|
|
|
|
+ TencentApiResponse<Void> response = advertiserClient.updateAdvertiser(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/advertiser/dailyBudget/update")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> updateDailyBudget(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long dailyBudget) {
|
|
|
|
|
+ TencentApiResponse<Void> response = advertiserClient.updateDailyBudget(accessToken, accountId, dailyBudget);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/advertiser/dailyBudget/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<AdvertiserDTO.DailyBudget>> getDailyBudget(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId) {
|
|
|
|
|
+ TencentApiResponse<AdvertiserDTO.DailyBudget> response = advertiserClient.getDailyBudget(accessToken, accountId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 资金 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/funds/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<FundsDTO.FundsInfo>> getFunds(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId) {
|
|
|
|
|
+ TencentApiResponse<FundsDTO.FundsInfo> response = fundsClient.getFundsByAccountId(accessToken, accountId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 广告 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/adgroup/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<AdGroupDTO.AdGroupInfo>>> getAdGroups(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody AdGroupDTO.GetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<AdGroupDTO.AdGroupInfo>> response =
|
|
|
|
|
+ adGroupClient.getAdGroups(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/adgroup/getOne")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<AdGroupDTO.AdGroupInfo>> getAdGroup(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long adgroupId) {
|
|
|
|
|
+ TencentApiResponse<AdGroupDTO.AdGroupInfo> response =
|
|
|
|
|
+ adGroupClient.getAdGroup(accessToken, accountId, adgroupId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/adgroup/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Long>> addAdGroup(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody AdGroupDTO.AddRequest request) {
|
|
|
|
|
+ TencentApiResponse<Long> response = adGroupClient.addAdGroup(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/adgroup/update")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> updateAdGroup(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody AdGroupDTO.UpdateRequest request) {
|
|
|
|
|
+ TencentApiResponse<Void> response = adGroupClient.updateAdGroup(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/adgroup/updateBid")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> updateBidAmount(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long adgroupId,
|
|
|
|
|
+ @RequestParam Integer bidAmount) {
|
|
|
|
|
+ TencentApiResponse<Void> response = adGroupClient.updateBidAmount(accessToken, accountId, adgroupId, bidAmount);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/adgroup/updateStatus")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> updateAdGroupStatus(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long adgroupId,
|
|
|
|
|
+ @RequestParam String configuredStatus) {
|
|
|
|
|
+ TencentApiResponse<Void> response = adGroupClient.updateStatus(accessToken, accountId, adgroupId, configuredStatus);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/adgroup/delete")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> deleteAdGroup(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long adgroupId) {
|
|
|
|
|
+ TencentApiResponse<Void> response = adGroupClient.deleteAdGroup(accessToken, accountId, adgroupId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 创意 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/creative/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<CreativeDTO.CreativeInfo>>> getCreatives(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody CreativeDTO.GetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<CreativeDTO.CreativeInfo>> response =
|
|
|
|
|
+ creativeClient.getCreatives(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/creative/getOne")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<CreativeDTO.CreativeInfo>> getCreative(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long dynamicCreativeId) {
|
|
|
|
|
+ TencentApiResponse<CreativeDTO.CreativeInfo> response =
|
|
|
|
|
+ creativeClient.getCreative(accessToken, accountId, dynamicCreativeId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/creative/getByAdGroup")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<CreativeDTO.CreativeInfo>>> getCreativesByAdGroup(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long adgroupId) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<CreativeDTO.CreativeInfo>> response =
|
|
|
|
|
+ creativeClient.getCreativesByAdGroup(accessToken, accountId, adgroupId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/creative/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Long>> addCreative(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody CreativeDTO.AddRequest request) {
|
|
|
|
|
+ TencentApiResponse<Long> response = creativeClient.addCreative(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/creative/update")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> updateCreative(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody CreativeDTO.UpdateRequest request) {
|
|
|
|
|
+ TencentApiResponse<Void> response = creativeClient.updateCreative(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/creative/updateStatus")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> updateCreativeStatus(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long dynamicCreativeId,
|
|
|
|
|
+ @RequestParam String configuredStatus) {
|
|
|
|
|
+ TencentApiResponse<Void> response = creativeClient.updateCreativeStatus(accessToken, accountId, dynamicCreativeId, configuredStatus);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/creative/delete")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> deleteCreative(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long dynamicCreativeId) {
|
|
|
|
|
+ TencentApiResponse<Void> response = creativeClient.deleteCreative(accessToken, accountId, dynamicCreativeId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 创意组件 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/component/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<ComponentDTO.ComponentInfo>>> getComponents(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody ComponentDTO.GetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<ComponentDTO.ComponentInfo>> response =
|
|
|
|
|
+ componentClient.getComponents(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/component/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Long>> addComponent(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody ComponentDTO.AddRequest request) {
|
|
|
|
|
+ TencentApiResponse<Long> response = componentClient.addComponent(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/component/delete")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> deleteComponent(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long componentId) {
|
|
|
|
|
+ TencentApiResponse<Void> response = componentClient.deleteComponent(accessToken, accountId, componentId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 图片 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/image/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<ImageDTO.ImageInfo>>> getImages(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody ImageDTO.GetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<ImageDTO.ImageInfo>> response =
|
|
|
|
|
+ imageClient.getImages(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/image/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<ImageDTO.AddResponse>> addImage(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody ImageDTO.AddRequest request) {
|
|
|
|
|
+ TencentApiResponse<ImageDTO.AddResponse> response = imageClient.addImage(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/image/delete")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> deleteImage(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam String imageId) {
|
|
|
|
|
+ TencentApiResponse<Void> response = imageClient.deleteImage(accessToken, accountId, imageId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 视频 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/video/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<VideoDTO.VideoInfo>>> getVideos(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody VideoDTO.GetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<VideoDTO.VideoInfo>> response =
|
|
|
|
|
+ videoClient.getVideos(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/video/getOne")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<VideoDTO.VideoInfo>> getVideo(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long videoId) {
|
|
|
|
|
+ TencentApiResponse<VideoDTO.VideoInfo> response = videoClient.getVideo(accessToken, accountId, videoId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/video/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<VideoDTO.AddResponse>> addVideo(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody VideoDTO.AddRequest request) {
|
|
|
|
|
+ TencentApiResponse<VideoDTO.AddResponse> response = videoClient.addVideo(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 落地页 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/page/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<PageDTO.PageInfo>>> getPages(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody PageDTO.GetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<PageDTO.PageInfo>> response =
|
|
|
|
|
+ pageClient.getPages(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 客户人群 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/audience/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<AudienceDTO.AudienceInfo>>> getAudiences(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody AudienceDTO.GetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<AudienceDTO.AudienceInfo>> response =
|
|
|
|
|
+ customAudienceClient.getAudiences(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/audience/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Long>> addAudience(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody AudienceDTO.AddRequest request) {
|
|
|
|
|
+ TencentApiResponse<Long> response = customAudienceClient.addAudience(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/audience/file/upload")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<String>> uploadAudienceFile(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody AudienceDTO.FileAddRequest request) {
|
|
|
|
|
+ TencentApiResponse<String> response = customAudienceClient.uploadAudienceFile(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/audience/file/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<String>> getAudienceFiles(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam(required = false) Long audienceId,
|
|
|
|
|
+ @RequestParam(required = false) Integer page,
|
|
|
|
|
+ @RequestParam(required = false) Integer pageSize) {
|
|
|
|
|
+ TencentApiResponse<String> response = customAudienceClient.getAudienceFiles(accessToken, accountId, audienceId, page, pageSize);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/audience/push")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> pushAudience(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody AudienceDTO.PushRequest request) {
|
|
|
|
|
+ TencentApiResponse<Void> response = customAudienceClient.pushAudience(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 用户行为数据 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/useraction/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> addUserActions(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody UserActionDTO.UserActionAddRequest request) {
|
|
|
|
|
+ TencentApiResponse<Void> response = userActionClient.addUserActions(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/useraction/addRaw")
|
|
|
|
|
+ public CommonResponse<String> addUserActionsRaw(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody String jsonBody) {
|
|
|
|
|
+ String response = userActionClient.addUserActionsRaw(accessToken, jsonBody);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 用户行为数据源 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/useractionset/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<UserActionDTO.UserActionSetInfo>>> getUserActionSets(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody UserActionDTO.UserActionSetGetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<UserActionDTO.UserActionSetInfo>> response =
|
|
|
|
|
+ userActionSetClient.getUserActionSets(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/useractionset/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Long>> addUserActionSet(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody UserActionDTO.UserActionSetAddRequest request) {
|
|
|
|
|
+ TencentApiResponse<Long> response = userActionSetClient.addUserActionSet(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 批量操作 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/batch/requests")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<BatchDTO.BatchResponse>> batchRequests(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody BatchDTO.BatchRequest request) {
|
|
|
|
|
+ TencentApiResponse<BatchDTO.BatchResponse> response = batchClient.batchRequests(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/batch/updateDailyBudget")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> batchUpdateDailyBudget(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody BatchDTO.UpdateDailyBudgetRequest request) {
|
|
|
|
|
+ TencentApiResponse<Void> response = batchClient.updateDailyBudget(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/batch/updateStatus")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> batchUpdateStatus(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody BatchDTO.UpdateStatusRequest request) {
|
|
|
|
|
+ TencentApiResponse<Void> response = batchClient.updateStatus(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/batch/updateBidAmount")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> batchUpdateBidAmount(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody BatchDTO.UpdateBidAmountRequest request) {
|
|
|
|
|
+ TencentApiResponse<Void> response = batchClient.updateBidAmount(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 报表 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/report/daily/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<ReportDTO.DailyReportData>>> getDailyReport(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody ReportDTO.DailyReportGetRequest request) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<ReportDTO.DailyReportData>> response =
|
|
|
|
|
+ dailyReportClient.getDailyReport(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/report/adgroup/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<ReportDTO.DailyReportData>>> getAdGroupReport(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam(required = false) Long adgroupId,
|
|
|
|
|
+ @RequestParam String startDate,
|
|
|
|
|
+ @RequestParam String endDate,
|
|
|
|
|
+ @RequestParam(required = false) Integer page,
|
|
|
|
|
+ @RequestParam(required = false) Integer pageSize) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<ReportDTO.DailyReportData>> response =
|
|
|
|
|
+ dailyReportClient.getAdGroupReport(accessToken, accountId, adgroupId, startDate, endDate, page, pageSize);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/report/creative/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<ReportDTO.DailyReportData>>> getCreativeReport(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam(required = false) Long creativeId,
|
|
|
|
|
+ @RequestParam String startDate,
|
|
|
|
|
+ @RequestParam String endDate,
|
|
|
|
|
+ @RequestParam(required = false) Integer page,
|
|
|
|
|
+ @RequestParam(required = false) Integer pageSize) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<ReportDTO.DailyReportData>> response =
|
|
|
|
|
+ dailyReportClient.getCreativeReport(accessToken, accountId, creativeId, startDate, endDate, page, pageSize);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/report/component/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<ReportDTO.DailyReportData>>> getComponentReport(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam String startDate,
|
|
|
|
|
+ @RequestParam String endDate,
|
|
|
|
|
+ @RequestParam(required = false) Integer page,
|
|
|
|
|
+ @RequestParam(required = false) Integer pageSize) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<ReportDTO.DailyReportData>> response =
|
|
|
|
|
+ dailyReportClient.getComponentReport(accessToken, accountId, startDate, endDate, page, pageSize);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ==================== 公众号 ====================
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/wechat/profile/add")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Long>> addProfile(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestBody WechatDTO.ProfileAddRequest request) {
|
|
|
|
|
+ TencentApiResponse<Long> response = wechatClient.addProfile(accessToken, request);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @PostMapping("/wechat/profile/delete")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<Void>> deleteProfile(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam Long profileId) {
|
|
|
|
|
+ TencentApiResponse<Void> response = wechatClient.deleteProfile(accessToken, accountId, profileId);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @JwtIgnore
|
|
|
|
|
+ @GetMapping("/wechat/profile/get")
|
|
|
|
|
+ public CommonResponse<TencentApiResponse<TencentApiResponse.ListData<WechatDTO.ProfileInfo>>> getProfiles(
|
|
|
|
|
+ @RequestParam String accessToken,
|
|
|
|
|
+ @RequestParam Long accountId,
|
|
|
|
|
+ @RequestParam(required = false) Integer page,
|
|
|
|
|
+ @RequestParam(required = false) Integer pageSize) {
|
|
|
|
|
+ TencentApiResponse<TencentApiResponse.ListData<WechatDTO.ProfileInfo>> response =
|
|
|
|
|
+ wechatClient.getProfiles(accessToken, accountId, page, pageSize);
|
|
|
|
|
+ return CommonResponse.success(response);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|