2025-12-25 23:25:54 +08:00
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
using Volo.Abp.Domain.Entities.Auditing;
|
|
|
|
|
|
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.AiHub.Domain.Entities.Chat;
|
|
|
|
|
|
|
|
|
|
|
|
[SugarTable("Ai_ImageStoreTask")]
|
|
|
|
|
|
public class ImageStoreTaskAggregateRoot : FullAuditedAggregateRoot<Guid>
|
|
|
|
|
|
{
|
2025-12-26 18:29:47 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 提示词
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
|
|
|
|
|
public string Prompt { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2026-01-02 19:26:09 +08:00
|
|
|
|
/// 参考图PrefixBase64(带前缀,如 data:image/png;base64,xxx)
|
2025-12-26 18:29:47 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SugarColumn(IsJson = true)]
|
2026-01-02 19:26:09 +08:00
|
|
|
|
public List<string> ReferenceImagesPrefixBase64 { get; set; }
|
2025-12-26 18:29:47 +08:00
|
|
|
|
|
2025-12-26 18:32:41 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 参考图url
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SugarColumn(IsJson = true)]
|
|
|
|
|
|
public List<string> ReferenceImagesUrl { get; set; }
|
2026-01-02 19:26:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-12-26 18:32:41 +08:00
|
|
|
|
/// <summary>
|
2026-01-02 19:26:09 +08:00
|
|
|
|
/// 生成图片PrefixBase64(带前缀,如 data:image/png;base64,xxx)
|
2025-12-26 18:32:41 +08:00
|
|
|
|
/// </summary>
|
2026-01-02 19:26:09 +08:00
|
|
|
|
public string? StorePrefixBase64 { get; set; }
|
2025-12-26 18:32:41 +08:00
|
|
|
|
|
2025-12-25 23:25:54 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图片绝对路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string? StoreUrl { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 任务状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public TaskStatusEnum TaskStatus { get; set; } = TaskStatusEnum.Processing;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用户id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Guid UserId { get; set; }
|
|
|
|
|
|
|
2026-01-02 19:26:09 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 模型id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string ModelId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 错误信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
|
|
|
|
|
public string? ErrorInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 发布状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public PublishStatusEnum PublishStatus { get; set; } = PublishStatusEnum.Unpublished;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 分类标签
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SugarColumn(IsJson = true)]
|
|
|
|
|
|
public List<string> Categories { get; set; } = new();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 密钥id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Guid? TokenId { get; set; }
|
|
|
|
|
|
|
2025-12-25 23:25:54 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置成功
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="storeUrl"></param>
|
|
|
|
|
|
public void SetSuccess(string storeUrl)
|
|
|
|
|
|
{
|
|
|
|
|
|
TaskStatus = TaskStatusEnum.Success;
|
|
|
|
|
|
StoreUrl = storeUrl;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|