From 81e6486a9c1c6acb9b761dda9875b29ed6de1a14 Mon Sep 17 00:00:00 2001 From: BetterXT <io.better.chen@gmail.com> Date: Mon, 6 May 2019 12:13:59 +0800 Subject: [PATCH] modify dto --- src/main/java/io/better/toutiao/api/datareport/DataReportApi.java | 20 ++++++++++---------- src/main/java/io/better/toutiao/api/delivery/AdvertisingCreativeApi.java | 56 ++++++++++++++++++++++++++++---------------------------- src/main/java/io/better/toutiao/api/delivery/AdvertisingGroupApi.java | 26 +++++++++++++------------- src/main/java/io/better/toutiao/api/delivery/AdvertisingPlanApi.java | 34 +++++++++++++++++----------------- src/main/java/io/better/toutiao/api/util/FileManagerApi.java | 42 +++++++++++++++++++++--------------------- src/main/java/io/better/toutiao/dto/BaseRespDTO.java | 39 --------------------------------------- src/main/java/io/better/toutiao/dto/TouTiaoRespDTO.java | 39 +++++++++++++++++++++++++++++++++++++++ src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInDTO.java | 156 ------------------------------------------------------------------------------------------------------------------------------------------------------------ src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInfoDTO.java | 197 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeListInfoDTO.java | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeOutDTO.java | 227 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeRespDTO.java | 23 +++++++++++++++++++++++ src/main/java/io/better/toutiao/dto/delivery/creative/ImageCreativeOutDTO.java | 45 --------------------------------------------- src/main/java/io/better/toutiao/dto/delivery/creative/ImageInfo.java | 32 ++++++++++++++++++++++++++++++++ src/main/java/io/better/toutiao/dto/delivery/creative/MaterialInfo.java | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main/java/io/better/toutiao/dto/delivery/creative/TitleInfo.java | 23 +++++++++++++++++++++++ src/main/java/io/better/toutiao/dto/delivery/creative/VideoCreativeOutDTO.java | 46 ---------------------------------------------- 17 files changed, 529 insertions(+), 602 deletions(-) delete mode 100644 src/main/java/io/better/toutiao/dto/BaseRespDTO.java create mode 100644 src/main/java/io/better/toutiao/dto/TouTiaoRespDTO.java delete mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInDTO.java create mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInfoDTO.java create mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeListInfoDTO.java delete mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeOutDTO.java create mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeRespDTO.java delete mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/ImageCreativeOutDTO.java create mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/ImageInfo.java create mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/MaterialInfo.java create mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/TitleInfo.java delete mode 100644 src/main/java/io/better/toutiao/dto/delivery/creative/VideoCreativeOutDTO.java diff --git a/src/main/java/io/better/toutiao/api/datareport/DataReportApi.java b/src/main/java/io/better/toutiao/api/datareport/DataReportApi.java index e6f73c8..0b99d5e 100644 --- a/src/main/java/io/better/toutiao/api/datareport/DataReportApi.java +++ b/src/main/java/io/better/toutiao/api/datareport/DataReportApi.java @@ -1,6 +1,6 @@ package io.better.toutiao.api.datareport; -import io.better.toutiao.dto.BaseRespDTO; +import io.better.toutiao.dto.TouTiaoRespDTO; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestHeader; @@ -87,15 +87,15 @@ public interface DataReportApi { * @return advertising plan report data */ @GetMapping(value = "/ad/get/", consumes = "application/json") - BaseRespDTO<?> getAdvertisingPlanReportData(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam("start_date") String startDate, - @RequestParam("end_date") String endDate, - @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, - @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize, - @RequestParam(value = "group_by", required = false) String[] groupBy, - @RequestParam(value = "time_granularity", defaultValue = STAT_TIME_GRANULARITY_DAILY, required = false) String timeGranularity, - @RequestParam(value = "filtering", required = false) Map<String, Object> filtering); + TouTiaoRespDTO<?> getAdvertisingPlanReportData(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam("start_date") String startDate, + @RequestParam("end_date") String endDate, + @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, + @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize, + @RequestParam(value = "group_by", required = false) String[] groupBy, + @RequestParam(value = "time_granularity", defaultValue = STAT_TIME_GRANULARITY_DAILY, required = false) String timeGranularity, + @RequestParam(value = "filtering", required = false) Map<String, Object> filtering); /** * 获取广告创意报表数据 diff --git a/src/main/java/io/better/toutiao/api/delivery/AdvertisingCreativeApi.java b/src/main/java/io/better/toutiao/api/delivery/AdvertisingCreativeApi.java index 33c801d..cf3b9a1 100644 --- a/src/main/java/io/better/toutiao/api/delivery/AdvertisingCreativeApi.java +++ b/src/main/java/io/better/toutiao/api/delivery/AdvertisingCreativeApi.java @@ -1,8 +1,8 @@ package io.better.toutiao.api.delivery; -import io.better.toutiao.dto.BaseRespDTO; -import io.better.toutiao.dto.delivery.creative.AdvertisingCreativeInDTO; -import io.better.toutiao.dto.delivery.creative.AdvertisingCreativeOutDTO; +import io.better.toutiao.dto.TouTiaoRespDTO; +import io.better.toutiao.dto.delivery.creative.AdvertisingCreativeInfoDTO; +import io.better.toutiao.dto.delivery.creative.AdvertisingCreativeRespDTO; import io.better.toutiao.dto.status.UpdateStatusDTO; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.*; @@ -30,26 +30,26 @@ public interface AdvertisingCreativeApi { * @return 广告创意信息 base resp dto */ @GetMapping(value = "/get") - BaseRespDTO<AdvertisingCreativeInDTO> listAdvertisingCreative(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, - @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize, - @RequestParam(value = "filtering", required = false) Map<String, Object> filtering, - @RequestParam(value = "fields", required = false) String[] fields); + TouTiaoRespDTO<AdvertisingCreativeRespDTO> listAdvertisingCreative(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, + @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize, + @RequestParam(value = "filtering", required = false) Map<String, Object> filtering, + @RequestParam(value = "fields", required = false) String[] fields); /** * 广告投放-为某广告主下的某计划创建广告创意 * - * @param accessToken 访问凭证 - * @param advertisingCreativeOut 创建信息 + * @param accessToken 访问凭证 + * @param advertisingCreativeInfo 创建信息 * @return the base resp dto */ @PostMapping(value = "/create_v2") - BaseRespDTO<Integer> createAdvertisingCreative(@RequestHeader("Access-Token") String accessToken, - @RequestBody AdvertisingCreativeOutDTO advertisingCreativeOut); + TouTiaoRespDTO<Integer> createAdvertisingCreative(@RequestHeader("Access-Token") String accessToken, + @RequestBody AdvertisingCreativeInfoDTO advertisingCreativeInfo); /** - * 广告投放-查看某广告主下某计划下的创建详情信息 + * 广告投放-查看某广告主下某计划下的创意详情信息 * * @param accessToken 访问凭证 * @param advertiserId 广告主ID @@ -57,20 +57,20 @@ public interface AdvertisingCreativeApi { * @return the advertising creative detail info */ @GetMapping(value = "/read_v2") - BaseRespDTO<List<AdvertisingCreativeOutDTO>> getAdvertisingCreativeDetailInfo(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Integer advertiserId, - @RequestParam("ad_id") Integer adId); + TouTiaoRespDTO<AdvertisingCreativeInfoDTO> getAdvertisingCreativeDetailInfo(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Integer advertiserId, + @RequestParam("ad_id") Integer adId); /** - * 更新 + * 广告投放-更新具体广告计划下创意详情信息 * - * @param accessToken 访问凭证 - * @param advertisingCreativeOut 更新信息 + * @param accessToken 访问凭证 + * @param advertisingCreativeInfo 更新信息 * @return the base resp dto */ @PostMapping(value = "/update_v2") - BaseRespDTO<Integer> updateAdvertisingCreative(@RequestHeader("Access-Token") String accessToken, - @RequestBody AdvertisingCreativeOutDTO advertisingCreativeOut); + TouTiaoRespDTO<Integer> updateAdvertisingCreativeDetailInfo(@RequestHeader("Access-Token") String accessToken, + @RequestBody AdvertisingCreativeInfoDTO advertisingCreativeInfo); /** * 广告投放-更新某个广告创意状态 @@ -80,8 +80,8 @@ public interface AdvertisingCreativeApi { * @return the base resp dto */ @PostMapping(value = "/update/status") - BaseRespDTO<?> updateAdvertisingCreativeStatus(@RequestHeader("Access-Token") String accessToken, - @RequestBody UpdateStatusDTO updateStatus); + TouTiaoRespDTO<List<Long>> updateAdvertisingCreativeStatus(@RequestHeader("Access-Token") String accessToken, + @RequestBody UpdateStatusDTO updateStatus); /** * 广告投放-获取光广告创意下的素材信息 @@ -93,8 +93,8 @@ public interface AdvertisingCreativeApi { * @return */ @GetMapping(value = "/material/read") - BaseRespDTO<AdvertisingCreativeInDTO.CreativeMaterialInfo> getCreativeMaterial(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam("creative_ids") Long[] creativeIds, - @RequestParam("fields") String[] fields); + TouTiaoRespDTO<?> getCreativeMaterial(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam("creative_ids") Long[] creativeIds, + @RequestParam("fields") String[] fields); } diff --git a/src/main/java/io/better/toutiao/api/delivery/AdvertisingGroupApi.java b/src/main/java/io/better/toutiao/api/delivery/AdvertisingGroupApi.java index beab775..f9e3766 100644 --- a/src/main/java/io/better/toutiao/api/delivery/AdvertisingGroupApi.java +++ b/src/main/java/io/better/toutiao/api/delivery/AdvertisingGroupApi.java @@ -1,6 +1,6 @@ package io.better.toutiao.api.delivery; -import io.better.toutiao.dto.BaseRespDTO; +import io.better.toutiao.dto.TouTiaoRespDTO; import io.better.toutiao.dto.delivery.group.AdvertisingGroupOutDTO; import io.better.toutiao.dto.delivery.group.AdvertisingGroupInDTO; import io.better.toutiao.dto.status.UpdateStatusDTO; @@ -39,12 +39,12 @@ public interface AdvertisingGroupApi { * @return advertising group */ @GetMapping(value = "/get") - BaseRespDTO<AdvertisingGroupInDTO> getAdvertisingGroup(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, - @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize, - @RequestParam(value = "filtering", required = false) Map<String, Object> filtering, - @RequestParam(value = "fields", required = false) String[] fields); + TouTiaoRespDTO<AdvertisingGroupInDTO> getAdvertisingGroup(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, + @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize, + @RequestParam(value = "filtering", required = false) Map<String, Object> filtering, + @RequestParam(value = "fields", required = false) String[] fields); /** * 广告投放-为某广告主创建广告组信息 @@ -54,8 +54,8 @@ public interface AdvertisingGroupApi { * @return the list */ @PostMapping(value = "/create") - BaseRespDTO<Long> createAdvertisingGroup(@RequestHeader("Access-Token") String accessToken, - @RequestBody AdvertisingGroupOutDTO advertisingGroupOutDTO); + TouTiaoRespDTO<Long> createAdvertisingGroup(@RequestHeader("Access-Token") String accessToken, + @RequestBody AdvertisingGroupOutDTO advertisingGroupOutDTO); /** * 广告投放-修改某广告主的广告组信息 @@ -65,8 +65,8 @@ public interface AdvertisingGroupApi { * @return the list */ @PostMapping(value = "/update") - BaseRespDTO<Long> updateAdvertisingGroup(@RequestHeader("Access-Token") String accessToken, - @RequestBody AdvertisingGroupOutDTO advertisingGroupOutDTO); + TouTiaoRespDTO<Long> updateAdvertisingGroup(@RequestHeader("Access-Token") String accessToken, + @RequestBody AdvertisingGroupOutDTO advertisingGroupOutDTO); /** * 广告投放-修改某广告主的广告组状态信息 @@ -76,7 +76,7 @@ public interface AdvertisingGroupApi { * @return list list */ @PostMapping(value = "/update/status") - BaseRespDTO<Long> updateAdvertisingGroupStatus(@RequestHeader("Access-Token") String accessToken, - @RequestBody UpdateStatusDTO updateStatusDTO); + TouTiaoRespDTO<Long> updateAdvertisingGroupStatus(@RequestHeader("Access-Token") String accessToken, + @RequestBody UpdateStatusDTO updateStatusDTO); } diff --git a/src/main/java/io/better/toutiao/api/delivery/AdvertisingPlanApi.java b/src/main/java/io/better/toutiao/api/delivery/AdvertisingPlanApi.java index 613bd8c..1dc7769 100644 --- a/src/main/java/io/better/toutiao/api/delivery/AdvertisingPlanApi.java +++ b/src/main/java/io/better/toutiao/api/delivery/AdvertisingPlanApi.java @@ -1,6 +1,6 @@ package io.better.toutiao.api.delivery; -import io.better.toutiao.dto.BaseRespDTO; +import io.better.toutiao.dto.TouTiaoRespDTO; import io.better.toutiao.dto.delivery.plan.AdvertisingPlanInDTO; import io.better.toutiao.dto.budget.UpdateBidDTO; import io.better.toutiao.dto.budget.UpdateBudgetDTO; @@ -32,12 +32,12 @@ public interface AdvertisingPlanApi { * @return advertising plan */ @GetMapping(value = "/get") - BaseRespDTO<List<AdvertisingPlanInDTO>> getAdvertisingPlan(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, - @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize, - @RequestParam(value = "filtering", required = false) Map<String, Object> filtering, - @RequestParam(value = "fields", required = false) String[] fields); + TouTiaoRespDTO<List<AdvertisingPlanInDTO>> getAdvertisingPlan(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, + @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize, + @RequestParam(value = "filtering", required = false) Map<String, Object> filtering, + @RequestParam(value = "fields", required = false) String[] fields); /** @@ -48,8 +48,8 @@ public interface AdvertisingPlanApi { * @return 广告计划ID */ @PostMapping(value = "/create") - BaseRespDTO<Integer> createAdvertisingPlan(@RequestHeader("Access-Token") String accessToken, - @RequestBody AdvertisingPlanInDTO advertisingPlanIn + TouTiaoRespDTO<Integer> createAdvertisingPlan(@RequestHeader("Access-Token") String accessToken, + @RequestBody AdvertisingPlanInDTO advertisingPlanIn ); /** @@ -60,8 +60,8 @@ public interface AdvertisingPlanApi { * @return 广告计划ID */ @PostMapping(value = "/update") - BaseRespDTO<Integer> updateAdvertisingPlan(@RequestHeader("Access-Token") String accessToken, - @RequestBody AdvertisingPlanOutDTO advertisingPlanOut + TouTiaoRespDTO<Integer> updateAdvertisingPlan(@RequestHeader("Access-Token") String accessToken, + @RequestBody AdvertisingPlanOutDTO advertisingPlanOut ); /** @@ -72,8 +72,8 @@ public interface AdvertisingPlanApi { * @return 广告计划ID集合 */ @PostMapping(value = "/update/status") - BaseRespDTO<List<Integer>> updateAdvertisingPlanStatus(@RequestHeader("Access-Token") String accessToken, - @RequestBody UpdateStatusDTO updateStatusDTO); + TouTiaoRespDTO<List<Integer>> updateAdvertisingPlanStatus(@RequestHeader("Access-Token") String accessToken, + @RequestBody UpdateStatusDTO updateStatusDTO); /** * 广告投放-更新某广告主下广告计划预算,可以批量更新 @@ -83,8 +83,8 @@ public interface AdvertisingPlanApi { * @return 广告计划ID集合 */ @PostMapping(value = "/update/budget") - BaseRespDTO<List<Integer>> updateAdvertisingPlanBudget(@RequestHeader("Access-Token") String accessToken, - @RequestBody UpdateBudgetDTO updateBudget); + TouTiaoRespDTO<List<Integer>> updateAdvertisingPlanBudget(@RequestHeader("Access-Token") String accessToken, + @RequestBody UpdateBudgetDTO updateBudget); /** * 广告投放-更新某广告主下广告计划出价,可以批量更新 @@ -94,6 +94,6 @@ public interface AdvertisingPlanApi { * @return 广告计划ID集合 */ @PostMapping(value = "/update/bid") - BaseRespDTO<List<Integer>> updateAdvertisingPlanBid(@RequestHeader("Access-Token") String accessToken, - @RequestBody UpdateBidDTO updateBid); + TouTiaoRespDTO<List<Integer>> updateAdvertisingPlanBid(@RequestHeader("Access-Token") String accessToken, + @RequestBody UpdateBidDTO updateBid); } diff --git a/src/main/java/io/better/toutiao/api/util/FileManagerApi.java b/src/main/java/io/better/toutiao/api/util/FileManagerApi.java index 2640620..250c6ac 100644 --- a/src/main/java/io/better/toutiao/api/util/FileManagerApi.java +++ b/src/main/java/io/better/toutiao/api/util/FileManagerApi.java @@ -1,6 +1,6 @@ package io.better.toutiao.api.util; -import io.better.toutiao.dto.BaseRespDTO; +import io.better.toutiao.dto.TouTiaoRespDTO; import io.better.toutiao.dto.util.FileInfoInDTO; import io.better.toutiao.dto.util.FileInfoOutDTO; import org.springframework.cloud.netflix.feign.FeignClient; @@ -24,8 +24,8 @@ public interface FileManagerApi { * @return the base resp dto */ @PostMapping(value = "/image/advertiser") - BaseRespDTO<FileInfoInDTO> uploadAdvertiserImage(@RequestHeader("Access-Token") String accessToken, - @RequestBody FileInfoOutDTO fileInfoOut); + TouTiaoRespDTO<FileInfoInDTO> uploadAdvertiserImage(@RequestHeader("Access-Token") String accessToken, + @RequestBody FileInfoOutDTO fileInfoOut); /** * 工具-文件管理-上传广告图片 @@ -35,8 +35,8 @@ public interface FileManagerApi { * @return the base resp dto */ @PostMapping(value = "/image/ad") - BaseRespDTO<FileInfoInDTO> uploadAdvertisingImage(@RequestHeader("Access-Token") String accessToken, - @RequestBody FileInfoOutDTO fileInfoOut); + TouTiaoRespDTO<FileInfoInDTO> uploadAdvertisingImage(@RequestHeader("Access-Token") String accessToken, + @RequestBody FileInfoOutDTO fileInfoOut); /** * 工具-文件管理-查询图片信息 @@ -47,9 +47,9 @@ public interface FileManagerApi { * @return the image info */ @GetMapping(value = "/ad/get") - BaseRespDTO<FileInfoInDTO> getImageInfo(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam("image_ids") String[] imageIds); + TouTiaoRespDTO<FileInfoInDTO> getImageInfo(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam("image_ids") String[] imageIds); /** * 工具-文件管理-查询视频信息 @@ -60,9 +60,9 @@ public interface FileManagerApi { * @return the video info */ @GetMapping(value = "/video/ad/get") - BaseRespDTO<FileInfoInDTO> getVideoInfo(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam("video_ids") String[] videoIds); + TouTiaoRespDTO<FileInfoInDTO> getVideoInfo(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam("video_ids") String[] videoIds); /** @@ -76,11 +76,11 @@ public interface FileManagerApi { * @return the image material info */ @GetMapping(value = "/image/get") - BaseRespDTO<FileInfoInDTO> getImageMaterialInfo(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam(value = "video_ids", required = false) Map<String, Object> filtering, - @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, - @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize); + TouTiaoRespDTO<FileInfoInDTO> getImageMaterialInfo(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam(value = "video_ids", required = false) Map<String, Object> filtering, + @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, + @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize); /** * 工具-文件管理-获取视频素材 @@ -93,11 +93,11 @@ public interface FileManagerApi { * @return the video material info */ @GetMapping(value = "/video/get") - BaseRespDTO<FileInfoInDTO> getVideoMaterialInfo(@RequestHeader("Access-Token") String accessToken, - @RequestParam("advertiser_id") Long advertiserId, - @RequestParam(value = "video_ids", required = false) Map<String, Object> filtering, - @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, - @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize); + TouTiaoRespDTO<FileInfoInDTO> getVideoMaterialInfo(@RequestHeader("Access-Token") String accessToken, + @RequestParam("advertiser_id") Long advertiserId, + @RequestParam(value = "video_ids", required = false) Map<String, Object> filtering, + @RequestParam(value = "page", defaultValue = "1", required = false) Integer page, + @RequestParam(value = "page_size", defaultValue = "20", required = false) Integer pageSize); } diff --git a/src/main/java/io/better/toutiao/dto/BaseRespDTO.java b/src/main/java/io/better/toutiao/dto/BaseRespDTO.java deleted file mode 100644 index d7dc706..0000000 --- a/src/main/java/io/better/toutiao/dto/BaseRespDTO.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.better.toutiao.dto; - -import lombok.Data; - -/** - * @author better create in 2019-04-29 14:06 - */ -@Data -public class BaseRespDTO<T> { - - /** - * 成功响应码 - */ - private static final int SUCCESS_CODE = 0; - - /** - * 响应状态码 - */ - private Integer code; - - /** - * 响应消息 - */ - private String message; - - /** - * 响应数据 - */ - private T data; - - /** - * 是否成功 - * - * @return true: 表示成功,false: 表示失败 - */ - public Boolean isSuccess() { - return SUCCESS_CODE == code; - } -} diff --git a/src/main/java/io/better/toutiao/dto/TouTiaoRespDTO.java b/src/main/java/io/better/toutiao/dto/TouTiaoRespDTO.java new file mode 100644 index 0000000..2f6209a --- /dev/null +++ b/src/main/java/io/better/toutiao/dto/TouTiaoRespDTO.java @@ -0,0 +1,39 @@ +package io.better.toutiao.dto; + +import lombok.Data; + +/** + * @author better create in 2019-04-29 14:06 + */ +@Data +public class TouTiaoRespDTO<T> { + + /** + * 成功响应码 + */ + private static final int SUCCESS_CODE = 0; + + /** + * 响应状态码 + */ + private Integer code; + + /** + * 响应消息 + */ + private String message; + + /** + * 响应数据 + */ + private T data; + + /** + * 是否成功 + * + * @return true: 表示成功,false: 表示失败 + */ + public Boolean isSuccess() { + return SUCCESS_CODE == code; + } +} diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInDTO.java b/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInDTO.java deleted file mode 100644 index d8cf76b..0000000 --- a/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInDTO.java +++ /dev/null @@ -1,156 +0,0 @@ -package io.better.toutiao.dto.delivery.creative; - -import io.better.toutiao.dto.resp.PageRespDTO; -import lombok.Data; - -import java.util.List; - -/** - * @author better create in 2019-04-29 11:16 - */ -@Data -public class AdvertisingCreativeInDTO { - - /** - * 分页信息 - */ - private PageRespDTO pageInfo; - - /** - * 创意信息集合 - */ - private List<CreativeInfo> list; - - /** - * 创意信息 - */ - @Data - private static class CreativeInfo { - /** - * 创意ID - */ - private String creativeId; - - /** - * 广告计划ID - */ - private String adId; - - /** - * 广告主ID - */ - private String advertiserId; - - /** - * 创意素材标题 - */ - private String title; - - /** - * 动态词包列表 - */ - private String[] creativeWordIds; - - /** - * 创意素材状态 - */ - private String status; - - /** - * 创意素材操作状态 - */ - private String optStatus; - - /** - * 创意素材类型 - */ - private String imageMode; - - /** - * 图片素材id列表 - */ - private String[] imageIds; - - /** - * 视频素材封面 - */ - private String imageId; - - /** - * 视频id - */ - private String videoId; - - /** - * 第三方id - */ - private String thirdPartyId; - - /** - * 创意审核信息 - */ - private String auditRejectReason; - - /** - * 素材信息列表 - */ - private List<?> materials; - } - - /** - * 创意素材信息 - */ - @Data - public static class CreativeMaterialInfo { - - /** - * 创意ID - */ - private String id; - - /** - * 广告ID - */ - private String adId; - - /** - * 广告主ID - */ - private String advertiserId; - - /** - * 创意标题 - */ - private String title; - - /** - * 创意状态 - */ - private String optStatus; - - /** - * 创意类型 - */ - private String imageMode; - - /** - * 图片素材信息 - */ - private String[] imageInfo; - - /** - * - */ - private String imageId; - - /** - * - */ - private String videoId; - - /** - * - */ - private String auditRejectReason; - } -} diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInfoDTO.java b/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInfoDTO.java new file mode 100644 index 0000000..9b36e00 --- /dev/null +++ b/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeInfoDTO.java @@ -0,0 +1,197 @@ +package io.better.toutiao.dto.delivery.creative; + +import lombok.Data; + +import java.util.List; + +/** + * 广告创意详情信息DTO,粒度比较细 + * + * @author better create in 2019-04-29 11:16 + */ +@Data +public class AdvertisingCreativeInfoDTO { + + /** + * 广告主ID + */ + private String advertiserId; + + /** + * 广告计划ID + */ + private String adId; + + /** + * 展示监测链接 + */ + private String trackUrl; + + /** + * 点击监测链接 + */ + private String actionTrackUrl; + + /** + * 点击监测链接 + */ + private String videoPlayEffectiveTrackUrl; + + /** + * 视频播放完毕监测链接 + */ + private String videoPlayDoneTrackUrl; + + /** + * 视频播放监测链接 + */ + private String videoPlayTrackUrl; + + /** + * 是否关闭评论 + * <p> + * 允许值: 0, 1 + */ + private Integer isCommentDisable; + + + /** + * 是否关闭视频详情页落地页 + * 允许值: 0, 1 + */ + private Integer closeVideoDetail; + + /** + * 创意展现方式 + * <p> + * 允许值: "CREATIVE_DISPLAY_MODE_CTR", "CREATIVE_DISPLAY_MODE_RANDOM" + */ + private String creativeDisplayMode; + + + /** + * 是否使用优选广告位,0表示不使用优选,1表示使用, + * <p> + * 使用优选广告位的时候默认忽略inventory_type字段 + * <p> + * 默认值: 0 + * <p> + * 允许值: 0, 1 + */ + private Integer smartInventory; + + /** + * 场景广告位 + * <p> + * 使用场景广告位时默认忽略inventory_type字段,与scene_inventory不能同时传 + * <p> + * 允许值: "VIDEO_SCENE", "FEED_SCENE", "TAIL_SCENE" + */ + private String sceneInventory; + + /** + * 是否开启衍生计划,1为开启,0为不开启 + * <p> + * 默认值: 0 + */ + private String generateDerivedAd; + + /** + * 创意投放位置 + */ + private String[] inventoryType; + + /** + * 文章来源 + * <p> + * 当推广目的为非应用下载或推广目的为应用下载&download_type=EXTERNAL_URL时必填 + */ + private String source; + + /** + * 应用名 + * <p> + * 当推广应用下载[包含Android、iOS]时, 必填 + */ + private String appName; + + /** + * Android应用下载详情页 + * <p> + * 当推广应用下载Android时, 必填 + */ + private String webUrl; + + /** + * 创意标签 + * <p> + * 以英文逗号分隔,最多20个标签,且每个标签长度不超过10个字符 + */ + private String[] adKeywords; + + /** + * 创意分类-三级行业(新版),填写三级行业ID, + * <p> + * 可从tools/industry/get/ 接口获取 + */ + private Integer thirdIndustryId; + + /** + * 附加创意类型 + * 仅当推广目的landing_type=LINK时,填写 + * 允许值: "ATTACHED_CREATIVE_NONE", "ATTACHED_CREATIVE_PHONE","ATTACHED_CREATIVE_FORM" + */ + private String advancedCreativeType; + + /** + * 附加创意标题 + */ + private String advancedCreativeTitle; + + /** + * 电话号码 + * 当附加创意类型为ATTACHED_CREATIVE_PHONE时, 必填 + */ + private String phoneNumber; + + /** + * 按钮文本 + * 当附加创意类型不为ATTACHED_CREATIVE_NONE时, 必填 + */ + private String buttonText; + + /** + * 表单提交链接 + * 当附加创意类型为ATTACHED_CREATIVE_FORM时, 必填 + * 且当附加创意类型为当附加创意类型为ATTACHED_CREATIVE_FORM时, 必须为今日头条建站地址 + */ + private String formUrl; + + /** + * 创意类型 + * 该字段为STATIC_ASSEMBLE表示程序化创意,其他情况无该字段 + */ + private String creativeMaterialMode; + + /** + * 标题信息,程序化创意必填 + */ + private List<TitleInfo> titleList; + + /** + * 素材信息,程序化创意必填 + */ + private List<ImageInfo> imageList; + + /** + * 素材信息,投放位置和创意类型决定素材规格 + * + * @see MaterialInfo + */ + private List<MaterialInfo> creatives; + + /** + * 修改时间 + */ + private String modifyTime; +} diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeListInfoDTO.java b/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeListInfoDTO.java new file mode 100644 index 0000000..9578b71 --- /dev/null +++ b/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeListInfoDTO.java @@ -0,0 +1,83 @@ +package io.better.toutiao.dto.delivery.creative; + +import lombok.Data; + +import java.util.List; + +/** + * 广告创意列表信息DTO,粒度不够细 + * + * @author better create in 2019-04-29 11:16 + */ +@Data +public class AdvertisingCreativeListInfoDTO { + /** + * 创意ID + */ + private String creativeId; + + /** + * 广告计划ID + */ + private String adId; + + /** + * 广告主ID + */ + private String advertiserId; + + /** + * 创意素材标题 + */ + private String title; + + /** + * 动态词包列表 + */ + private String[] creativeWordIds; + + /** + * 创意素材状态 + */ + private String status; + + /** + * 创意素材操作状态 + */ + private String optStatus; + + /** + * 创意素材类型 + */ + private String imageMode; + + /** + * 图片素材id列表 + */ + private String[] imageIds; + + /** + * 视频素材封面 + */ + private String imageId; + + /** + * 视频id + */ + private String videoId; + + /** + * 第三方id + */ + private String thirdPartyId; + + /** + * 创意审核信息 + */ + private String auditRejectReason; + + /** + * 素材信息列表 + */ + private List<MaterialInfo> materials; +} \ No newline at end of file diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeOutDTO.java b/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeOutDTO.java deleted file mode 100644 index 5f309bc..0000000 --- a/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeOutDTO.java +++ /dev/null @@ -1,227 +0,0 @@ -package io.better.toutiao.dto.delivery.creative; - -import lombok.Data; - -import java.util.List; - -/** - * @author better create in 2019-04-29 11:16 - */ -@Data -public class AdvertisingCreativeOutDTO { - - /** - * 广告主ID - */ - private String advertiserId; - - /** - * 广告计划ID - */ - private String adId; - - /** - * 展示监测链接 - */ - private String trackUrl; - - /** - * 点击监测链接 - */ - private String actionTrackUrl; - - /** - * 点击监测链接 - */ - private String videoPlayEffectiveTrackUrl; - - /** - * 视频播放完毕监测链接 - */ - private String videoPlayDoneTrackUrl; - - /** - * 视频播放监测链接 - */ - private String videoPlayTrackUrl; - - /** - * 是否关闭评论 - * <p> - * 允许值: 0, 1 - */ - private Integer isCommentDisable; - - - /** - * 是否关闭视频详情页落地页 - * 允许值: 0, 1 - */ - private Integer closeVideoDetail; - - /** - * 创意展现方式 - * <p> - * 允许值: "CREATIVE_DISPLAY_MODE_CTR", "CREATIVE_DISPLAY_MODE_RANDOM" - */ - private String creativeDisplayMode; - - - /** - * 是否使用优选广告位,0表示不使用优选,1表示使用, - * <p> - * 使用优选广告位的时候默认忽略inventory_type字段 - * <p> - * 默认值: 0 - * <p> - * 允许值: 0, 1 - */ - private Integer smartInventory; - - /** - * 场景广告位 - * <p> - * 使用场景广告位时默认忽略inventory_type字段,与scene_inventory不能同时传 - * <p> - * 允许值: "VIDEO_SCENE", "FEED_SCENE", "TAIL_SCENE" - */ - private String sceneInventory; - - /** - * 是否开启衍生计划,1为开启,0为不开启 - * <p> - * 默认值: 0 - */ - private String generateDerivedAd; - - /** - * 创意投放位置 - */ - private String[] inventoryType; - - /** - * 文章来源 - * <p> - * 当推广目的为非应用下载或推广目的为应用下载&download_type=EXTERNAL_URL时必填 - */ - private String source; - - /** - * 应用名 - * <p> - * 当推广应用下载[包含Android、iOS]时, 必填 - */ - private String appName; - - /** - * Android应用下载详情页 - * <p> - * 当推广应用下载Android时, 必填 - */ - private String webUrl; - - /** - * 创意标签 - * <p> - * 以英文逗号分隔,最多20个标签,且每个标签长度不超过10个字符 - */ - private String[] adKeywords; - - /** - * 创意分类-三级行业(新版),填写三级行业ID, - * <p> - * 可从tools/industry/get/ 接口获取 - */ - private Integer thirdIndustryId; - - /** - * 附加创意类型 - * 仅当推广目的landing_type=LINK时,填写 - * 允许值: "ATTACHED_CREATIVE_NONE", "ATTACHED_CREATIVE_PHONE","ATTACHED_CREATIVE_FORM" - */ - private String advancedCreativeType; - - /** - * 副标题 - */ - private String advancedCreativeTitle; - - /** - * 电话号码 - * 当附加创意类型为ATTACHED_CREATIVE_PHONE时, 必填 - */ - private String phoneNumber; - - /** - * 按钮文本 - * 当附加创意类型不为ATTACHED_CREATIVE_NONE时, 必填 - */ - private String buttonText; - - /** - * 表单提交链接 - * 当附加创意类型为ATTACHED_CREATIVE_FORM时, 必填 - * 且当附加创意类型为当附加创意类型为ATTACHED_CREATIVE_FORM时, 必须为今日头条建站地址 - */ - private String formUrl; - - /** - * 创意类型 - * 该字段为STATIC_ASSEMBLE表示程序化创意,其他情况无该字段 - */ - private String creativeMaterialMode; - - /** - * 标题信息,程序化创意必填 - */ - private List<TitleCreativeInfo> titleList; - - /** - * 素材信息,程序化创意必填 - */ - private List<ImageCreativeInfo> imageList; - - /** - * 素材信息,投放位置和创意类型决定素材规格 - */ - private List<?> creatives; - - @Data - public static class TitleCreativeInfo { - - /** - * 创意标题 - */ - private String title; - - /** - * 动态词包ID - * 可使用动态词包查询接口获得 - */ - private List<?> creativeWordIds; - } - - @Data - public static class ImageCreativeInfo { - - /** - * 素材类型 - */ - private String imageMode; - - /** - * 图片ID - */ - private String imageId; - - /** - * 视频ID - */ - private String videoId; - - /** - * 图片id列表,非视频素材时填写 - */ - private List<?> imageIds; - } -} diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeRespDTO.java b/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeRespDTO.java new file mode 100644 index 0000000..5c9c5b1 --- /dev/null +++ b/src/main/java/io/better/toutiao/dto/delivery/creative/AdvertisingCreativeRespDTO.java @@ -0,0 +1,23 @@ +package io.better.toutiao.dto.delivery.creative; + +import io.better.toutiao.dto.resp.PageRespDTO; +import lombok.Data; + +import java.util.List; + +/** + * @author better create in 2019-04-29 11:16 + */ +@Data +public class AdvertisingCreativeRespDTO { + + /** + * 分页信息 + */ + private PageRespDTO pageInfo; + + /** + * 创意信息集合 + */ + private List<AdvertisingCreativeListInfoDTO> list; +} diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/ImageCreativeOutDTO.java b/src/main/java/io/better/toutiao/dto/delivery/creative/ImageCreativeOutDTO.java deleted file mode 100644 index 2952f7a..0000000 --- a/src/main/java/io/better/toutiao/dto/delivery/creative/ImageCreativeOutDTO.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.better.toutiao.dto.delivery.creative; - -import lombok.Data; - -import java.util.List; - -/** - * @author better create in 2019-04-30 09:50 - */ -@Data -public class ImageCreativeOutDTO { - - /** - * 创意标题,如果要使用动态词包 - * 格式如下:“XXX{词包名}XXX{词包名}XXX” - * 请注意当您使用动态词包需在下方creative_word_ids字段中按顺序传入词包ID - * 并且在一个标题中最多使用两个动态词包。长度为6-30个字, 两个英文字符占1位 - */ - private String title; - - /** - * 动态词包ID,可使用动态词包查询接口获得 - * 结合标题中的词包格式您需要填写相同个数与顺序的词包ID - * 如果实际ID顺序与标题中词包名顺序不一致我们将以词包ID顺序为准 - */ - private List<?> creativeWordIds; - - /** - * 素材类型 - */ - private String imageMode; - - /** - * 图片id列表,非视频素材时填写(组图传3张图,其他传1张) - * 图片ID和视频ID可通过文件管理 中的接口获得。 - */ - private List<?> imageIds; - - /** - * 创意自定义参数, - * 例如开发者可设定此参数为创意打标签用于区分使用的素材类型,选填 - */ - private String thirdPartyId; - -} diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/ImageInfo.java b/src/main/java/io/better/toutiao/dto/delivery/creative/ImageInfo.java new file mode 100644 index 0000000..b954679 --- /dev/null +++ b/src/main/java/io/better/toutiao/dto/delivery/creative/ImageInfo.java @@ -0,0 +1,32 @@ +package io.better.toutiao.dto.delivery.creative; + +import lombok.Data; + +import java.util.List; + +/** + * @author better create in 2019-04-30 09:50 + */ +@Data +public class ImageInfo { + + /** + * 素材类型 + */ + private String imageMode; + + /** + * 图片ID + */ + private String imageId; + + /** + * 视频ID + */ + private String videoId; + + /** + * 图片id列表,非视频素材时填写 + */ + private List<?> imageIds; +} \ No newline at end of file diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/MaterialInfo.java b/src/main/java/io/better/toutiao/dto/delivery/creative/MaterialInfo.java new file mode 100644 index 0000000..1d8c73b --- /dev/null +++ b/src/main/java/io/better/toutiao/dto/delivery/creative/MaterialInfo.java @@ -0,0 +1,43 @@ +package io.better.toutiao.dto.delivery.creative; + +import lombok.Data; + +import java.util.List; + +/** + * 素材信息 + * <p> + * 包含图片素材字段和视频素材字段 + * + * @author better create in 2019-04-30 09:50 + */ +@Data +public class MaterialInfo extends ImageInfo { + + /** + * 创意ID + */ + private Long creativeId; + + /** + * 创意标题,如果要使用动态词包 + * 格式如下:“XXX{词包名}XXX{词包名}XXX” + * 请注意当您使用动态词包需在下方creative_word_ids字段中按顺序传入词包ID + * 并且在一个标题中最多使用两个动态词包。长度为6-30个字, 两个英文字符占1位 + */ + private String title; + + /** + * 动态词包ID,可使用动态词包查询接口获得 + * 结合标题中的词包格式您需要填写相同个数与顺序的词包ID + * 如果实际ID顺序与标题中词包名顺序不一致我们将以词包ID顺序为准 + */ + private List<?> creativeWordIds; + + + /** + * 创意自定义参数, + * 例如开发者可设定此参数为创意打标签用于区分使用的素材类型,选填 + */ + private String thirdPartyId; +} diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/TitleInfo.java b/src/main/java/io/better/toutiao/dto/delivery/creative/TitleInfo.java new file mode 100644 index 0000000..94861b5 --- /dev/null +++ b/src/main/java/io/better/toutiao/dto/delivery/creative/TitleInfo.java @@ -0,0 +1,23 @@ +package io.better.toutiao.dto.delivery.creative; + +import lombok.Data; + +import java.util.List; + +/** + * @author better create in 2019-04-30 09:50 + */ +@Data +public class TitleInfo { + + /** + * 创意标题 + */ + private String title; + + /** + * 动态词包ID + * 可使用动态词包查询接口获得 + */ + private List<?> creativeWordIds; +} \ No newline at end of file diff --git a/src/main/java/io/better/toutiao/dto/delivery/creative/VideoCreativeOutDTO.java b/src/main/java/io/better/toutiao/dto/delivery/creative/VideoCreativeOutDTO.java deleted file mode 100644 index fe95166..0000000 --- a/src/main/java/io/better/toutiao/dto/delivery/creative/VideoCreativeOutDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -package io.better.toutiao.dto.delivery.creative; - -import lombok.Data; - -import java.util.List; - -/** - * @author better create in 2019-04-30 09:50 - */ -@Data -public class VideoCreativeOutDTO { - /** - * 创意标题,如果要使用动态词包 - * 格式如下:“XXX{词包名}XXX{词包名}XXX” - * 请注意当您使用动态词包需在下方creative_word_ids字段中按顺序传入词包ID - * 并且在一个标题中最多使用两个动态词包。标题,长度为6-30个字, 两个英文字符占1位 - */ - private String title; - - - /** - * 动态词包ID,可使用动态词包查询接口获得,结合标题中的词包格式您需要填写相同个数与顺序的词包ID, - * 如果实际ID顺序与标题中词包名顺序不一致我们将以词包ID顺序为准。 - */ - private List<?> creativeWordIds; - - /** - * 素材类型 - */ - private String imageMode; - - /** - * 图片id,视频素材时填写。图片ID和视频ID可通过文件管理 中的接口获得。 - */ - private String imageId; - - /** - * 视频id,视频素材时填写。图片ID和视频ID可通过文件管理 中的接口获得。 - */ - private String videoId; - - /** - * 创意自定义参数,例如开发者可设定此参数为创意打标签用于区分使用的素材类型,选填 - */ - private String thirdPartyId; -} -- libgit2 0.27.1