TASK:1.修改affiliate状态 2.添加系统sketch到个人library 3.视频生成新增生成模型 4.获取所有pose,从过去gif改为获取video

This commit is contained in:
2025-11-13 11:40:37 +08:00
parent e5eecbfe8d
commit 8750ea355a
23 changed files with 311 additions and 48 deletions

View File

@@ -32,7 +32,8 @@ public class CommonConstant {
public static final String GENERATE_LOGO_SINGLE_CANCEL = "/api/generate_single_logo_cancel/";
public static final String POSE_TRANSFORMATION_CANCEL = "/api/pose_transform_cancel/";
// public static final String POSE_TRANSFORMATION_CANCEL = "/api/pose_transform_cancel/";
public static final String POSE_TRANSFORMATION_CANCEL = "/api/comfyui_i_2_video_cancel/";
public static final String PYTHON_PORT_9996 = "9996";

View File

@@ -68,4 +68,7 @@ public enum CollectionLevel2TypeEnum {
public static List<String> printType() {
return Arrays.asList(LOGO.getRealName(), SLOGAN.getRealName(), Pattern.getRealName());
}
public static CollectionLevel2TypeEnum ofWithLoweCase(String realName) {
return Stream.of(CollectionLevel2TypeEnum.values()).filter(v -> v.getRealName().toLowerCase().equals(realName)).findFirst().orElse(null);
}
}

View File

@@ -0,0 +1,29 @@
package com.ai.da.common.enums;
import lombok.Getter;
import java.util.stream.Stream;
@Getter
public enum MotionModeEnum {
POSE_TO_VIDEO(1, "/api/comfyui_image_pose_2_video"),
PROMPT_TO_VIDEO(2, "/api/comfyui_image_2_video"),
FIRST_LAST_FRAME_TO_VIDEO(3, "/api/comfyui_flf_2_video")
;
private int code;
private String url;
MotionModeEnum(int code, String url) {
this.code = code;
this.url = url;
}
public static MotionModeEnum of(int code) {
return Stream.of(MotionModeEnum.values()).filter(v -> v.getCode()== code).findFirst().orElse(null);
}
}

View File

@@ -64,6 +64,7 @@ public enum PoseEnum {
Map<String, String> map = new HashMap<>();
map.put("id", String.valueOf(id));
map.put("gif", gifPath);
map.put("video", videoPath);
map.put("firstFrame", firstFramePath);
return map;
}

View File

@@ -744,6 +744,47 @@ public class MinioUtil {
return false;
}
/**
* 将A桶中的对象复制到B桶中
* @return
*/
public void copyObject(String sourceBucket, String sourceObject, String targetBucket, String targetObject) {
// 检查目标桶是否存在
boolean found;
try {
found = minioClient.bucketExists(BucketExistsArgs.builder()
.bucket(targetBucket)
.build());
} catch (Exception e) {
log.error("目标桶{},不存在", targetBucket);
throw new BusinessException("Copy object failed");
}
if (found) {
// 复制对象
try {
minioClient.copyObject(
CopyObjectArgs.builder()
.bucket(targetBucket)
.object(targetObject)
.source(
CopySource.builder()
.bucket(sourceBucket)
.object(sourceObject)
.build()
)
.build()
);
} catch (Exception e) {
log.error("对象复制失败");
throw new BusinessException("Copy object failed");
}
log.info("对象复制成功");
} else {
log.error("目标桶{},不存在", targetBucket);
throw new BusinessException("Copy object failed");
}
}
}