package org.dromara.chat.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.chat.domain.ChatMessage;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.math.BigDecimal;

/**
 * 聊天消息业务对象 chat_message
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ChatMessage.class, reverseConvertGenerate = false)
public class ChatMessageBo extends BaseEntity {

    /**
     * 主键ID
     */
    @NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 会话ID
     */
    @NotNull(message = "会话ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long sessionId;

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long userId;

    /**
     * 消息类型（text/image/file）
     */
    @NotBlank(message = "消息类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String messageType;

    /**
     * 消息内容
     */
    @NotBlank(message = "消息内容不能为空", groups = {AddGroup.class, EditGroup.class})
    private String content;

    /**
     * 角色（user/assistant/system）
     */
    @NotBlank(message = "角色不能为空", groups = {AddGroup.class, EditGroup.class})
    private String role;

    /**
     * 扣费成本
     */
    private BigDecimal deductCost;

    /**
     * 总token数
     */
    private Long totalTokens;

    /**
     * 模型名称
     */
    private String modelName;

}