package com.backendsys.modules.material.entity;

import com.backendsys.config.Mybatis.handler.timezone.LocalDateTimeAdapter;
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.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("ai_material_feedback")
public class MaterialFeedback {

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

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

    @TableField("id")
    private Long feedback_id;

    private Long user_id;
    @TableField(exist = false)
    private String phone;

    @NotNull(message="素材风格ID不能为空", groups = { Create.class, Update.class })
    private Long lora_id;

    @TableField(exist = false)
    private String lora_name;

    @NotNull(message="素材分类ID不能为空", groups = { Create.class, Update.class })
    private Long category_id;

    @TableField(exist = false)
    private String category_name;

    @Size(max = 500, message = "需求说明长度不超过 {max} 个字符", groups = { Create.class, Update.class })
    @NotEmpty(message="需求说明不能为空", groups = { Create.class, Update.class })
    private String content;
    private String image_url;

    @JsonAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime create_time;

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