package com.backendsys.entity.Ai; import com.backendsys.entity.Cms.CmsArticleDTO; import com.backendsys.entity.validator.RangeStringArray; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; import lombok.Data; @Data public class AiChatDTO { public static interface Create{} public static interface Update{} public static interface Delete{} /** * ai_chat */ private Long id; @NotNull(message = "对话ID不能为空", groups = { AiChatDTO.Update.class, AiChatDTO.Delete.class }) private Long chat_id; @Size(max = 36, message = "对话历史记录ID长度不超过 {max} 字符", groups = { AiChatDTO.Create.class, AiChatDTO.Update.class }) @NotNull(message = "对话历史记录ID不能为空", groups = { AiChatDTO.Update.class }) private String history_code; private Long user_id; @Size(min = 2, max = 20, message = "用户昵称长度在 {min}-{max} 字符", groups = { AiChatDTO.Create.class, AiChatDTO.Update.class }) private String user_nickname; @Size(max = 1000, message = "用户头像路径长度不超过 {max} 字符", groups = { AiChatDTO.Create.class, AiChatDTO.Update.class }) private String user_avatar; @Size(max = 255, message = "机器人编码长度不超过 {max} 字符", groups = { AiChatDTO.Create.class, AiChatDTO.Update.class }) private String robot_code; @RangeStringArray(message="对话角色取值有误,范围应是(user, assistant)", value = {"user", "assistant"}, groups = {CmsArticleDTO.Create.class, CmsArticleDTO.Update.class}) private String role; @Size(max = 2500, message = "对话内容长度不超过 {max} 字符", groups = { AiChatDTO.Create.class, AiChatDTO.Update.class }) private String content; private String create_time; private String update_time; }