From d782e9cc178a59eb4313bb8e20fbc8e28c86b3dc Mon Sep 17 00:00:00 2001 From: danmo <775144922@qq.com> Date: Thu, 11 Apr 2024 14:24:07 +0800 Subject: [PATCH] posting-task commit --- .../{DyConfigEnum.java => DyUrlPathEnum.java} | 23 +++- .../dyj/spring/DyConfigurationRegister.java | 4 +- .../main/java/com/dyj/web/DyWebClient.java | 34 +++++ .../com/dyj/web/client/PostingTaskClient.java | 60 +++++++++ .../com/dyj/web/domain/VideoBasicInfo.java | 123 ++++++++++++++++++ .../domain/query/ConfirmPostingTaskQuery.java | 107 +++++++++++++++ .../domain/query/CreatePostingTaskQuery.java | 123 ++++++++++++++++++ .../domain/query/PostingTaskCondition.java | 60 +++++++++ .../web/domain/query/PostingTaskQuery.java | 87 +++++++++++++ .../web/domain/vo/ConfirmPostingTaskVo.java | 27 ++++ .../com/dyj/web/domain/vo/PostingTaskVo.java | 44 +++++++ .../dyj/web/domain/vo/VideoBasicListVo.java | 31 +++++ .../dyj/web/handler/AbstractWebHandler.java | 4 + .../dyj/web/handler/PostingTaskHandler.java | 64 +++++++++ 14 files changed, 786 insertions(+), 5 deletions(-) rename dy-java-common/src/main/java/com/dyj/common/enums/{DyConfigEnum.java => DyUrlPathEnum.java} (91%) create mode 100644 dy-java-web/src/main/java/com/dyj/web/client/PostingTaskClient.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/domain/VideoBasicInfo.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/domain/query/ConfirmPostingTaskQuery.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/domain/query/CreatePostingTaskQuery.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/domain/query/PostingTaskCondition.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/domain/query/PostingTaskQuery.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/domain/vo/ConfirmPostingTaskVo.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/domain/vo/PostingTaskVo.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/domain/vo/VideoBasicListVo.java create mode 100644 dy-java-web/src/main/java/com/dyj/web/handler/PostingTaskHandler.java diff --git a/dy-java-common/src/main/java/com/dyj/common/enums/DyConfigEnum.java b/dy-java-common/src/main/java/com/dyj/common/enums/DyUrlPathEnum.java similarity index 91% rename from dy-java-common/src/main/java/com/dyj/common/enums/DyConfigEnum.java rename to dy-java-common/src/main/java/com/dyj/common/enums/DyUrlPathEnum.java index 7359a22..24c151f 100644 --- a/dy-java-common/src/main/java/com/dyj/common/enums/DyConfigEnum.java +++ b/dy-java-common/src/main/java/com/dyj/common/enums/DyUrlPathEnum.java @@ -1,6 +1,6 @@ package com.dyj.common.enums; -public enum DyConfigEnum { +public enum DyUrlPathEnum { /** * 域名 @@ -266,6 +266,23 @@ public enum DyConfigEnum { */ SCHEMA_GET_LIVE("schemaGetLive","/api/douyin/v1/schema/get_live"), + /** + * 创建投稿任务 + */ + CREATE_POSTING_TASK("createPostingTask","/task/posting/create"), + + /** + * 绑定视频 + */ + POSTING_TASK_BIND_VIDEO("postingTaskBindVideo","/task/posting/bind_video"), + /** + * 核销投稿任务 + */ + POSTING_TASK_CONFIRM("postingTaskConfirm","/task/posting/user"), + /** + * 查询视频基础信息 + */ + QUERY_VIDEO_BASIC_INFO("queryVideoBasicInfo","/api/douyin/v1/video/video_basic_info"), ; @@ -273,7 +290,7 @@ public enum DyConfigEnum { private String key; private String value; - DyConfigEnum(String key, String value) { + DyUrlPathEnum(String key, String value) { this.key = key; this.value = value; } @@ -295,7 +312,7 @@ public enum DyConfigEnum { } public static String getValueByKey(String key) { - for (DyConfigEnum e : DyConfigEnum.values()) { + for (DyUrlPathEnum e : DyUrlPathEnum.values()) { if (e.getKey().equals(key)) { return e.getValue(); } diff --git a/dy-java-spring/src/main/java/com/dyj/spring/DyConfigurationRegister.java b/dy-java-spring/src/main/java/com/dyj/spring/DyConfigurationRegister.java index 17e760f..31aca92 100644 --- a/dy-java-spring/src/main/java/com/dyj/spring/DyConfigurationRegister.java +++ b/dy-java-spring/src/main/java/com/dyj/spring/DyConfigurationRegister.java @@ -2,7 +2,7 @@ package com.dyj.spring; import com.dtflys.forest.config.ForestConfiguration; import com.dyj.common.config.DyConfiguration; -import com.dyj.common.enums.DyConfigEnum; +import com.dyj.common.enums.DyUrlPathEnum; import com.dyj.common.handler.RequestHandler; import com.dyj.common.service.IAgentConfigService; import com.dyj.common.service.IAgentTokenService; @@ -110,7 +110,7 @@ public class DyConfigurationRegister implements ResourceLoaderAware, BeanPostPro forestConfiguration.setLogResponseStatus(forestProperties.isLogResponseStatus()); forestConfiguration.setLogResponseContent(forestProperties.isLogResponseContent()); forestConfiguration.setAsyncMode(forestProperties.getAsyncMode()); - for (DyConfigEnum value : DyConfigEnum.values()) { + for (DyUrlPathEnum value : DyUrlPathEnum.values()) { forestProperties.getVariables().put(value.getKey(), value.getValue()); } forestConfiguration.setVariables(forestProperties.getVariables()); diff --git a/dy-java-web/src/main/java/com/dyj/web/DyWebClient.java b/dy-java-web/src/main/java/com/dyj/web/DyWebClient.java index bf286af..26940fb 100644 --- a/dy-java-web/src/main/java/com/dyj/web/DyWebClient.java +++ b/dy-java-web/src/main/java/com/dyj/web/DyWebClient.java @@ -601,4 +601,38 @@ public class DyWebClient { return new SchemaHandler(configuration().getAgentConfigService().loadAgentByTenantId(tenantId, clientKey)).getLive(openId, account, expireAt); } + /** + * 创建投稿任务 + * + * @param query 入参 + * @return DyResult + */ + public DyResult createPostingTask(CreatePostingTaskQuery query){ + return new PostingTaskHandler(configuration().getAgentConfigService().loadAgentByTenantId(tenantId, clientKey)).createPostingTask(query); + } + /** + * 绑定视频 + * @param query 入参 + * @return DyResult + */ + public DyResult postingTaskBindVideo(PostingTaskQuery query){ + return new PostingTaskHandler(configuration().getAgentConfigService().loadAgentByTenantId(tenantId, clientKey)).postingTaskBindVideo(query); + } + /** + * 核销投稿任务 + * @param query 入参 + * @return DyResult + */ + public DyResult confirmPostingTask(ConfirmPostingTaskQuery query){ + return new PostingTaskHandler(configuration().getAgentConfigService().loadAgentByTenantId(tenantId, clientKey)).confirmPostingTask(query); + } + /** + * 查询视频基础信息 + * @param query 入参 + * @return DyResult + */ + public DyResult queryVideoBasicInfo(VideoDataQuery query){ + return new PostingTaskHandler(configuration().getAgentConfigService().loadAgentByTenantId(tenantId, clientKey)).queryVideoBasicInfo(query); + } + } diff --git a/dy-java-web/src/main/java/com/dyj/web/client/PostingTaskClient.java b/dy-java-web/src/main/java/com/dyj/web/client/PostingTaskClient.java new file mode 100644 index 0000000..87c61ba --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/client/PostingTaskClient.java @@ -0,0 +1,60 @@ +package com.dyj.web.client; + +import com.dtflys.forest.annotation.BaseRequest; +import com.dtflys.forest.annotation.JSONBody; +import com.dtflys.forest.annotation.Post; +import com.dtflys.forest.backend.ContentType; +import com.dyj.common.domain.DyResult; +import com.dyj.web.domain.query.ConfirmPostingTaskQuery; +import com.dyj.web.domain.query.CreatePostingTaskQuery; +import com.dyj.web.domain.query.PostingTaskQuery; +import com.dyj.web.domain.query.VideoDataQuery; +import com.dyj.web.domain.vo.BaseVo; +import com.dyj.web.domain.vo.ConfirmPostingTaskVo; +import com.dyj.web.domain.vo.PostingTaskVo; +import com.dyj.web.domain.vo.VideoBasicListVo; +import com.dyj.web.interceptor.ClientTokenInterceptor; +import com.dyj.web.interceptor.TokenHeaderInterceptor; + +/** + * 投稿任务 + * + * @author danmo + * @date 2024/04/09 14:08 + */ +@BaseRequest(baseURL = "${domain}", contentType = ContentType.APPLICATION_JSON) +public interface PostingTaskClient { + + /** + * 创建投稿任务 + * + * @param query 入参 + * @return DyResult + */ + @Post(value = "${createPostingTask}", interceptor = ClientTokenInterceptor.class) + DyResult createPostingTask(@JSONBody CreatePostingTaskQuery query); + + /** + * 绑定视频 + * @param query 入参 + * @return DyResult + */ + @Post(value = "${postingTaskBindVideo}", interceptor = TokenHeaderInterceptor.class) + DyResult postingTaskBindVideo(@JSONBody PostingTaskQuery query); + + /** + * 核销投稿任务 + * @param query 入参 + * @return DyResult + */ + @Post(value = "${postingTaskConfirm}", interceptor = ClientTokenInterceptor.class) + DyResult postingTaskConfirm(@JSONBody ConfirmPostingTaskQuery query); + + /** + * 查询视频基础信息 + * @param query 入参 + * @return DyResult + */ + @Post(value = "${queryVideoBasicInfo}", interceptor = TokenHeaderInterceptor.class) + DyResult queryVideoBasicInfo(@JSONBody VideoDataQuery query); +} diff --git a/dy-java-web/src/main/java/com/dyj/web/domain/VideoBasicInfo.java b/dy-java-web/src/main/java/com/dyj/web/domain/VideoBasicInfo.java new file mode 100644 index 0000000..babc16f --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/domain/VideoBasicInfo.java @@ -0,0 +1,123 @@ +package com.dyj.web.domain; + +/** + * @author danmo + * @date 2024-04-11 14:12 + **/ +public class VideoBasicInfo { + + /** + * 视频id + */ + private String item_id; + + /** + * 视频真实id + */ + private String video_id; + + /** + * 媒体类型 + * NONE=0 + * TEXT=1 + * PIC=2 + * GIF=3 + * VIDEO=4 + * PIC_LIST=5 + * STORY=1 + * 1VR=12 + * FORWARD=21 + * STORY_LIVE=22 + * STORY_PIC=23 + */ + private Integer media_type; + + /** + * 视频标题 + */ + private String title; + + /** + * 视频状态。2:不适宜公开;4:审核中;5:公开视频 + */ + private Integer video_status; + + /** + * 视频封面 + */ + private String cover; + + /** + * 视频创建时间戳 + */ + private Long create_time; + + public String getItem_id() { + return item_id; + } + + public void setItem_id(String item_id) { + this.item_id = item_id; + } + + public String getVideo_id() { + return video_id; + } + + public void setVideo_id(String video_id) { + this.video_id = video_id; + } + + public Integer getMedia_type() { + return media_type; + } + + public void setMedia_type(Integer media_type) { + this.media_type = media_type; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Integer getVideo_status() { + return video_status; + } + + public void setVideo_status(Integer video_status) { + this.video_status = video_status; + } + + public String getCover() { + return cover; + } + + public void setCover(String cover) { + this.cover = cover; + } + + public Long getCreate_time() { + return create_time; + } + + public void setCreate_time(Long create_time) { + this.create_time = create_time; + } + + @Override + public String toString() { + return "VideoBasicInfo{" + + "item_id='" + item_id + '\'' + + ", video_id='" + video_id + '\'' + + ", media_type=" + media_type + + ", title='" + title + '\'' + + ", video_status=" + video_status + + ", cover='" + cover + '\'' + + ", create_time=" + create_time + + '}'; + } +} diff --git a/dy-java-web/src/main/java/com/dyj/web/domain/query/ConfirmPostingTaskQuery.java b/dy-java-web/src/main/java/com/dyj/web/domain/query/ConfirmPostingTaskQuery.java new file mode 100644 index 0000000..9a6b514 --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/domain/query/ConfirmPostingTaskQuery.java @@ -0,0 +1,107 @@ +package com.dyj.web.domain.query; + +/** + * @author danmo + * @date 2024-04-11 14:00 + **/ +public class ConfirmPostingTaskQuery extends UserInfoQuery{ + + /** + * 任务ID + */ + private String task_id; + + /** + * 目标用户open_id + */ + private String target_open_id; + + /** + * 视频ID + */ + private String video_id; + + public String getTask_id() { + return task_id; + } + + public void setTask_id(String task_id) { + this.task_id = task_id; + } + + public String getTarget_open_id() { + return target_open_id; + } + + public void setTarget_open_id(String target_open_id) { + this.target_open_id = target_open_id; + } + + public String getVideo_id() { + return video_id; + } + + public void setVideo_id(String video_id) { + this.video_id = video_id; + } + + public static ConfirmPostingTaskQueryBuild builder() { + return new ConfirmPostingTaskQueryBuild(); + } + + public static class ConfirmPostingTaskQueryBuild { + private String taskId; + private String targetOpenId; + private String videoId; + private Integer tenantId; + private String clientKey; + private String openId; + public ConfirmPostingTaskQueryBuild taskId(String taskId) { + this.taskId = taskId; + return this; + } + public ConfirmPostingTaskQueryBuild targetOpenId(String targetOpenId) { + this.targetOpenId = targetOpenId; + return this; + } + public ConfirmPostingTaskQueryBuild videoId(String videoId) { + this.videoId = videoId; + return this; + } + public ConfirmPostingTaskQueryBuild tenantId(Integer tenantId) { + this.tenantId = tenantId; + return this; + } + public ConfirmPostingTaskQueryBuild clientKey(String clientKey) { + this.clientKey = clientKey; + return this; + } + public ConfirmPostingTaskQueryBuild openId(String openId) { + this.openId = openId; + return this; + } + + public ConfirmPostingTaskQuery build() { + ConfirmPostingTaskQuery postingTaskQuery = new ConfirmPostingTaskQuery(); + postingTaskQuery.setTask_id(taskId); + postingTaskQuery.setTarget_open_id(targetOpenId); + postingTaskQuery.setVideo_id(videoId); + postingTaskQuery.setTenantId(tenantId); + postingTaskQuery.setClientKey(clientKey); + postingTaskQuery.setOpen_id(openId); + return postingTaskQuery; + } + } + + @Override + public String toString() { + return "ConfirmPostingTaskQuery{" + + "task_id='" + task_id + '\'' + + ", target_open_id='" + target_open_id + '\'' + + ", video_id='" + video_id + '\'' + + ", open_id='" + open_id + '\'' + + ", tenantId=" + tenantId + + ", clientKey='" + clientKey + '\'' + + '}'; + } +} diff --git a/dy-java-web/src/main/java/com/dyj/web/domain/query/CreatePostingTaskQuery.java b/dy-java-web/src/main/java/com/dyj/web/domain/query/CreatePostingTaskQuery.java new file mode 100644 index 0000000..5d22180 --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/domain/query/CreatePostingTaskQuery.java @@ -0,0 +1,123 @@ +package com.dyj.web.domain.query; + +/** + * @author danmo + * @date 2024-04-11 13:51 + **/ +public class CreatePostingTaskQuery extends BaseQuery { + + /** + * 开始时间秒级时间戳 + */ + private Long start_time; + + /** + * 开始时间秒级时间戳 + */ + private Long end_time; + + /** + * 任务名称,长度不超过50个字符 + */ + private String task_name; + + /** + * 任务条件 + */ + private PostingTaskCondition task_condition; + + public Long getStart_time() { + return start_time; + } + + public void setStart_time(Long start_time) { + this.start_time = start_time; + } + + public Long getEnd_time() { + return end_time; + } + + public void setEnd_time(Long end_time) { + this.end_time = end_time; + } + + public String getTask_name() { + return task_name; + } + + public void setTask_name(String task_name) { + this.task_name = task_name; + } + + public PostingTaskCondition getTask_condition() { + return task_condition; + } + + public void setTask_condition(PostingTaskCondition task_condition) { + this.task_condition = task_condition; + } + + public static CreatePostingTaskQueryBuild builder(){ + return new CreatePostingTaskQueryBuild(); + } + + public static class CreatePostingTaskQueryBuild{ + private String taskName; + private Long startTime; + private Long endTime; + private PostingTaskCondition taskCondition; + + private String clientKey; + private Integer tenantId; + + public CreatePostingTaskQueryBuild taskName(String taskName) { + this.taskName = taskName; + return this; + } + public CreatePostingTaskQueryBuild startTime(Long startTime) { + this.startTime = startTime; + return this; + } + public CreatePostingTaskQueryBuild endTime(Long endTime) { + this.endTime = endTime; + return this; + } + public CreatePostingTaskQueryBuild taskCondition(PostingTaskCondition taskCondition) { + this.taskCondition = taskCondition; + return this; + } + public CreatePostingTaskQueryBuild clientKey(String clientKey) { + this.clientKey = clientKey; + return this; + } + + public CreatePostingTaskQueryBuild tenantId(Integer tenantId) { + this.tenantId = tenantId; + return this; + } + + public CreatePostingTaskQuery build(){ + CreatePostingTaskQuery createPostingTaskQuery = new CreatePostingTaskQuery(); + createPostingTaskQuery.setStart_time(startTime); + createPostingTaskQuery.setEnd_time(endTime); + createPostingTaskQuery.setTask_name(taskName); + createPostingTaskQuery.setTask_condition(taskCondition); + createPostingTaskQuery.setTenantId(tenantId); + createPostingTaskQuery.setClientKey(clientKey); + return createPostingTaskQuery; + } + } + + @Override + public String toString() { + return "CreatePostingTaskQuery{" + + "start_time=" + start_time + + ", end_time=" + end_time + + ", task_name='" + task_name + '\'' + + ", task_condition=" + task_condition + + ", tenantId=" + tenantId + + ", clientKey='" + clientKey + '\'' + + '}'; + } +} diff --git a/dy-java-web/src/main/java/com/dyj/web/domain/query/PostingTaskCondition.java b/dy-java-web/src/main/java/com/dyj/web/domain/query/PostingTaskCondition.java new file mode 100644 index 0000000..1d83198 --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/domain/query/PostingTaskCondition.java @@ -0,0 +1,60 @@ +package com.dyj.web.domain.query; + +/** + * @author danmo + * @date 2024-04-11 13:52 + **/ +public class PostingTaskCondition { + + /** + * 收藏:collection + * 评论:comment + * 点赞:digg + * 播放:play + * 分享:share + * 下载:download + */ + private String condition; + + /** + * 右区间, 播放数:最大为1000w, 其他:最大10w + */ + private Integer max_value; + /** + * 左区间, 最小为0 + */ + private Integer min_value; + + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public Integer getMax_value() { + return max_value; + } + + public void setMax_value(Integer max_value) { + this.max_value = max_value; + } + + public Integer getMin_value() { + return min_value; + } + + public void setMin_value(Integer min_value) { + this.min_value = min_value; + } + + @Override + public String toString() { + return "PostingTaskCondition{" + + "condition='" + condition + '\'' + + ", max_value=" + max_value + + ", min_value=" + min_value + + '}'; + } +} diff --git a/dy-java-web/src/main/java/com/dyj/web/domain/query/PostingTaskQuery.java b/dy-java-web/src/main/java/com/dyj/web/domain/query/PostingTaskQuery.java new file mode 100644 index 0000000..cd9e158 --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/domain/query/PostingTaskQuery.java @@ -0,0 +1,87 @@ +package com.dyj.web.domain.query; + +/** + * @author danmo + * @date 2024-04-11 14:00 + **/ +public class PostingTaskQuery extends UserInfoQuery{ + + /** + * 任务ID + */ + private String task_id; + + /** + * 视频ID + */ + private String video_id; + + public String getTask_id() { + return task_id; + } + + public void setTask_id(String task_id) { + this.task_id = task_id; + } + + public String getVideo_id() { + return video_id; + } + + public void setVideo_id(String video_id) { + this.video_id = video_id; + } + + public static PostingTaskQueryBuild builder() { + return new PostingTaskQueryBuild(); + } + + public static class PostingTaskQueryBuild { + private String taskId; + private String videoId; + private Integer tenantId; + private String clientKey; + private String openId; + public PostingTaskQueryBuild taskId(String taskId) { + this.taskId = taskId; + return this; + } + public PostingTaskQueryBuild videoId(String videoId) { + this.videoId = videoId; + return this; + } + public PostingTaskQueryBuild tenantId(Integer tenantId) { + this.tenantId = tenantId; + return this; + } + public PostingTaskQueryBuild clientKey(String clientKey) { + this.clientKey = clientKey; + return this; + } + public PostingTaskQueryBuild openId(String openId) { + this.openId = openId; + return this; + } + + public PostingTaskQuery build() { + PostingTaskQuery postingTaskQuery = new PostingTaskQuery(); + postingTaskQuery.setTask_id(taskId); + postingTaskQuery.setVideo_id(videoId); + postingTaskQuery.setTenantId(tenantId); + postingTaskQuery.setClientKey(clientKey); + postingTaskQuery.setOpen_id(openId); + return postingTaskQuery; + } + } + + @Override + public String toString() { + return "PostingTaskQuery{" + + "task_id='" + task_id + '\'' + + ", video_id='" + video_id + '\'' + + ", open_id='" + open_id + '\'' + + ", tenantId=" + tenantId + + ", clientKey='" + clientKey + '\'' + + '}'; + } +} diff --git a/dy-java-web/src/main/java/com/dyj/web/domain/vo/ConfirmPostingTaskVo.java b/dy-java-web/src/main/java/com/dyj/web/domain/vo/ConfirmPostingTaskVo.java new file mode 100644 index 0000000..104bc14 --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/domain/vo/ConfirmPostingTaskVo.java @@ -0,0 +1,27 @@ +package com.dyj.web.domain.vo; + +/** + * @author danmo + * @date 2024-04-11 14:08 + **/ +public class ConfirmPostingTaskVo extends BaseVo{ + + private Boolean result; + + public Boolean getResult() { + return result; + } + + public void setResult(Boolean result) { + this.result = result; + } + + @Override + public String toString() { + return "ConfirmPostingTaskVo{" + + "result=" + result + + ", description='" + description + '\'' + + ", error_code=" + error_code + + '}'; + } +} diff --git a/dy-java-web/src/main/java/com/dyj/web/domain/vo/PostingTaskVo.java b/dy-java-web/src/main/java/com/dyj/web/domain/vo/PostingTaskVo.java new file mode 100644 index 0000000..969f97d --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/domain/vo/PostingTaskVo.java @@ -0,0 +1,44 @@ +package com.dyj.web.domain.vo; + +/** + * @author danmo + * @date 2024-04-11 13:57 + **/ +public class PostingTaskVo extends BaseVo{ + + /** + * 任务id + */ + private String task_id; + + /** + * 任务状态 1-进行中,2-未开始,3-已过期 + */ + private String task_status; + + public String getTask_id() { + return task_id; + } + + public void setTask_id(String task_id) { + this.task_id = task_id; + } + + public String getTask_status() { + return task_status; + } + + public void setTask_status(String task_status) { + this.task_status = task_status; + } + + @Override + public String toString() { + return "PostingTaskVo{" + + "task_id='" + task_id + '\'' + + ", task_status='" + task_status + '\'' + + ", description='" + description + '\'' + + ", error_code=" + error_code + + '}'; + } +} diff --git a/dy-java-web/src/main/java/com/dyj/web/domain/vo/VideoBasicListVo.java b/dy-java-web/src/main/java/com/dyj/web/domain/vo/VideoBasicListVo.java new file mode 100644 index 0000000..63d2a00 --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/domain/vo/VideoBasicListVo.java @@ -0,0 +1,31 @@ +package com.dyj.web.domain.vo; + +import com.dyj.web.domain.VideoBasicInfo; + +import java.util.List; + +/** + * @author danmo + * @date 2024-04-11 14:11 + **/ +public class VideoBasicListVo extends BaseVo { + + private List list; + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + @Override + public String toString() { + return "VideoBasicListVo{" + + "list=" + list + + ", description='" + description + '\'' + + ", error_code=" + error_code + + '}'; + } +} diff --git a/dy-java-web/src/main/java/com/dyj/web/handler/AbstractWebHandler.java b/dy-java-web/src/main/java/com/dyj/web/handler/AbstractWebHandler.java index cb98262..b58be63 100644 --- a/dy-java-web/src/main/java/com/dyj/web/handler/AbstractWebHandler.java +++ b/dy-java-web/src/main/java/com/dyj/web/handler/AbstractWebHandler.java @@ -52,6 +52,10 @@ public abstract class AbstractWebHandler { return SpringUtils.getBean(SchemaClient.class); } + protected PostingTaskClient getPostingTaskClient() { + return SpringUtils.getBean(PostingTaskClient.class); + } + void setBaseQuery(BaseQuery query){ query.setTenantId(agentConfiguration.getTenantId()); query.setClientKey(agentConfiguration.getClientKey()); diff --git a/dy-java-web/src/main/java/com/dyj/web/handler/PostingTaskHandler.java b/dy-java-web/src/main/java/com/dyj/web/handler/PostingTaskHandler.java new file mode 100644 index 0000000..8cb4051 --- /dev/null +++ b/dy-java-web/src/main/java/com/dyj/web/handler/PostingTaskHandler.java @@ -0,0 +1,64 @@ +package com.dyj.web.handler; + +import com.dtflys.forest.annotation.JSONBody; +import com.dyj.common.config.AgentConfiguration; +import com.dyj.common.domain.DyResult; +import com.dyj.web.domain.query.ConfirmPostingTaskQuery; +import com.dyj.web.domain.query.CreatePostingTaskQuery; +import com.dyj.web.domain.query.PostingTaskQuery; +import com.dyj.web.domain.query.VideoDataQuery; +import com.dyj.web.domain.vo.BaseVo; +import com.dyj.web.domain.vo.ConfirmPostingTaskVo; +import com.dyj.web.domain.vo.PostingTaskVo; +import com.dyj.web.domain.vo.VideoBasicListVo; + +/** + * @author danmo + * @date 2024-04-11 14:18 + **/ +public class PostingTaskHandler extends AbstractWebHandler{ + + public PostingTaskHandler(AgentConfiguration agentConfiguration) { + super(agentConfiguration); + } + + /** + * 创建投稿任务 + * + * @param query 入参 + * @return DyResult + */ + public DyResult createPostingTask(CreatePostingTaskQuery query){ + setBaseQuery(query); + return getPostingTaskClient().createPostingTask(query); + } + /** + * 绑定视频 + * @param query 入参 + * @return DyResult + */ + public DyResult postingTaskBindVideo(PostingTaskQuery query){ + setBaseQuery(query); + return getPostingTaskClient().postingTaskBindVideo(query); + } + /** + * 核销投稿任务 + * @param query 入参 + * @return DyResult + */ + public DyResult confirmPostingTask(ConfirmPostingTaskQuery query){ + setBaseQuery(query); + return getPostingTaskClient().postingTaskConfirm(query); + } + /** + * 查询视频基础信息 + * @param query 入参 + * @return DyResult + */ + public DyResult queryVideoBasicInfo(VideoDataQuery query){ + setBaseQuery(query); + return getPostingTaskClient().queryVideoBasicInfo(query); + } + + +}