package com.cf.imes.module.system.controller.admin.notify.vo.template;

import com.cf.imes.module.system.validation.common.CommonStatus;
import com.cf.imes.module.system.validation.notify.NotifyTemplateTypeValid;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

@Schema(description = "管理后台 - 站内信模版创建/修改 Request VO")
@Data
public class NotifyTemplateSaveReqVO {

    @Schema(description = "ID", example = "1024")
    private Long id;

    @Schema(description = "模版名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试模版")
    @NotEmpty(message = "模版名称不能为空")
    @Length(min = 1, max = 64, message = "模版名称长度不能超过64个字符")
    private String name;

    @Schema(description = "模版编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "SEND_TEST")
    @NotNull(message = "模版编码不能为空")
    @Length(min = 1, max = 64, message = "模版编码长度不能超过64个字符")
    private String code;

    @Schema(description = "模版类型，对应 system_notify_template_type 字典", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "模版类型不能为空")
    @NotifyTemplateTypeValid
    private Integer type;

    @Schema(description = "发送人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土豆")
    @NotEmpty(message = "发送人名称不能为空")
    @Length(min = 1, max = 255, message = "发送人名称长度不能超过255个字符")
    private String nickname;

    @Schema(description = "模版内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "我是模版内容")
    @NotEmpty(message = "模版内容不能为空")
    @Length(min = 1, max = 1024, message = "模版内容长度不能超过1024个字符")
    private String content;

    @Schema(description = "状态，参见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "状态不能为空")
    @CommonStatus
    private Integer status;

    @Schema(description = "备注", example = "我是备注")
    @Length(max = 255, message = "备注长度不能超过255个字符")
    private String remark;

}
