package com.backendsys.modules.ai.chat.entity;

import com.backendsys.config.Mybatis.handler.timezone.LocalDateTimeAdapter;
import com.backendsys.entity.validator.RangeStringArray;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.google.gson.annotations.JsonAdapter;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("ai_chat_history")
public class ChatHistory {

    public static interface Create{}
    public static interface Update{}
    public static interface Delete{}

    @TableId(type = IdType.AUTO)
    private Long id;

    @NotEmpty(message = "history_code 不能为空", groups = { Delete.class })
    private String history_code;
    private Long user_id;
    private String robot_code;
    private String last_prompt;

    @TableField(exist = false)
    private Integer chat_count;

    private Integer del_flag;

    @JsonAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime create_time;
    @JsonAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime update_time;

}
