diff --git a/chopperbot-account/src/main/java/org/example/core/exchange/Exchange.java b/chopperbot-account/src/main/java/org/example/core/exchange/Exchange.java index 97bff1a..a82f77b 100644 --- a/chopperbot-account/src/main/java/org/example/core/exchange/Exchange.java +++ b/chopperbot-account/src/main/java/org/example/core/exchange/Exchange.java @@ -3,6 +3,7 @@ package org.example.core.exchange; import org.example.api.VedioPublishApi; import org.example.bean.section.PackageSection; import org.example.core.route.DefaultRouteRuler; +import org.example.pojo.Video; import org.example.pojo.VideoQueue; import org.example.pojo.VideoToPublish; @@ -38,17 +39,13 @@ public class Exchange { private void checkAndProcessMessages() { // 在这里检查消息队列,提取消息并调用publish方法 - for (String routingKey : bindings.keySet()) { - if (bindings.containsKey(routingKey)) { - List queues = bindings.get(routingKey); - for (VideoQueue queue : queues) { - Object message = queue.dequeue(); - if (message != null) { - VedioPublishApi.publishVideo(new VideoToPublish.Buider(message.toString(),queue.getCookies(),1).build()); - } - } - } - } +// for (String channel : channels.keySet()) { +// List packageSections = channels.get(channel); +// for (PackageSection packageSection : packageSections) { +// VedioPublishApi.publishVideo(VideoToPublish.builder() +// .videoPath(packageSection.getVideoPath()).cookies().build()) +// } +// } } public void publish(String routingKey,PackageSection packageSection) { diff --git a/chopperbot-account/src/main/java/org/example/mapper/LabelMapper.java b/chopperbot-account/src/main/java/org/example/mapper/LabelMapper.java index cc122ab..7518536 100644 --- a/chopperbot-account/src/main/java/org/example/mapper/LabelMapper.java +++ b/chopperbot-account/src/main/java/org/example/mapper/LabelMapper.java @@ -1,7 +1,6 @@ package org.example.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.example.pojo.Video; import org.example.pojo.VideoLabel; public interface LabelMapper extends BaseMapper { diff --git a/chopperbot-account/src/main/java/org/example/pojo/Video.java b/chopperbot-account/src/main/java/org/example/pojo/Video.java index 174202e..bfac9aa 100644 --- a/chopperbot-account/src/main/java/org/example/pojo/Video.java +++ b/chopperbot-account/src/main/java/org/example/pojo/Video.java @@ -1,33 +1,22 @@ package org.example.pojo; -import java.util.List; +import lombok.*; +import org.example.bean.section.PackageSection; + /** * @Description * @Author welsir * @Date 2023/9/4 22:08 */ -public class Video { +@EqualsAndHashCode(callSuper = true) +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class Video extends PackageSection { private Object message; private String videoUrl; - private List videoType; + private String cookies; - public Video() { - } - - public List getVideoType() { - return this.videoType; - } - - public void setVideoType(List videoType) { - this.videoType = videoType; - } - - public Object getMessage() { - return this.message; - } - - public void setMessage(Object message) { - this.message = message; - } } diff --git a/chopperbot-account/src/main/java/org/example/pojo/VideoToPublish.java b/chopperbot-account/src/main/java/org/example/pojo/VideoToPublish.java index 9cc56c6..952c702 100644 --- a/chopperbot-account/src/main/java/org/example/pojo/VideoToPublish.java +++ b/chopperbot-account/src/main/java/org/example/pojo/VideoToPublish.java @@ -1,6 +1,9 @@ package org.example.pojo; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; /** * @Description @@ -9,6 +12,9 @@ import lombok.Data; */ @Data +@Builder +@AllArgsConstructor +@NoArgsConstructor public class VideoToPublish { private String videoPath; @@ -20,89 +26,4 @@ public class VideoToPublish { private String title; private String type; - private VideoToPublish(Buider buider){ - this.videoPath = buider.videoPath; - this.cookies = buider.cookies; - this.coverPath = buider.coverPath; - this.devicePath = buider.devicePath; - this.tag = buider.tag; - this.title = buider.title; - this.type = buider.type; - } - - public static class Buider{ - private String videoPath; - private String cookies; - private PlatformType platform; - private String coverPath; - private String devicePath; - private String tag; - private String title; - private String type; - - public Buider(String videoPath,String cookies,int platform){ - this.videoPath = videoPath; - this.cookies = cookies; - this.platform = PlatformType.getPlatform(platform); - } - - public Buider setCoverPath(String coverPath) { - this.coverPath = coverPath; - return this; - } - - public Buider setDevicePath(String devicePath) { - this.devicePath = devicePath; - return this; - } - - public Buider setTag(String tag) { - this.tag = tag; - return this; - } - - public Buider setTitle(String title) { - this.title = title; - return this; - } - - public Buider setType(String type) { - this.type = type; - return this; - } - - public String getVideoPath() { - return videoPath; - } - - public String getCookies() { - return cookies; - } - - public String getCoverPath() { - return coverPath; - } - - public String getDevicePath() { - return devicePath; - } - - public String getTag() { - return tag; - } - - public String getTitle() { - return title; - } - - public String getType() { - return type; - } - - public VideoToPublish build(){ - return new VideoToPublish(this); - } - - } - }