LaiTool_PRO/src/main/service/book/bookIndex/bookImageEntrance.ts
lq1405 d94e21b3b2 优化 MJ 转视频
优化视频的显示
添加图片的上传
2025-09-14 16:25:54 +08:00

68 lines
2.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 图书小说入口类
*
* 提供小说分镜图片相关的操作接口,包括图片上传、下载、处理和管理等功能。
* 作为小说操作的统一入口点内部委托给BookImageHandle处理具体业务逻辑。
*
* @class BookImageEntrance
*/
import { OperateBookType } from "@/define/enum/bookEnum"
import { BookImageHandle } from "../subBookHandle/bookImageHandle"
export class BookImageEntrance {
bookImageHandle: BookImageHandle
constructor() {
this.bookImageHandle = new BookImageHandle()
}
//#region 出图相关
/** 将指定图片设置为分镜的主图片 */
MoveImageToMainImage = async (
bookTaskId: string,
bookTaskDetailId: string,
sourceImagePath: string
) =>
await this.bookImageHandle.MoveImageToMainImage(bookTaskId, bookTaskDetailId, sourceImagePath)
/** 重置(删除)所有未锁定的分镜图片数据 */
ResetGenerateImage = async (id: string, operateBookType: OperateBookType) =>
await this.bookImageHandle.ResetGenerateImage(id, operateBookType)
/** 上传图片到分镜并更新相关信息 */
UpLoadImageToBookAndUpdateMessage = async (
bookTaskDetailId: string,
imageFile: string | string[],
option: string
) =>
await this.bookImageHandle.UpLoadImageToBookAndUpdateMessage(
bookTaskDetailId,
imageFile,
option
)
/** 对分镜图片进行高清处理 */
HDOneImage = async (bookTaskDetailId: string, scale: number) =>
await this.bookImageHandle.HDOneImage(bookTaskDetailId, scale)
/** 获取Midjourney图片URL并下载应用到分镜 */
GetImageUrlAndDownload = async (
bookTaskDetailId: string
) => await this.bookImageHandle.GetImageUrlAndDownload(bookTaskDetailId)
/** 下载图片并拆分处理应用到分镜 */
DownloadImageUrlAndSplit = async (bookTaskDetailId: string, imageUrl: string) =>
await this.bookImageHandle.DownloadImageUrlAndSplit(bookTaskDetailId, imageUrl)
/** 同步主图文件到批次任务 */
SyncMainImageForBookTask = async (bookTaskId: string) =>
await this.bookImageHandle.SyncMainImageForBookTask(bookTaskId)
/** 同步子图文件到批次任务 */
SyncSubImageForBookTask = async (bookTaskId: string) =>
await this.bookImageHandle.SyncSubImageForBookTask(bookTaskId)
//#endregion
}