package com.greenorange.promotion.model.dto.fileInfo;

import com.greenorange.promotion.annotation.EnumValue;
import com.greenorange.promotion.model.enums.FileUploadBizEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 文件添加请求体
 */
@Data
@Schema(description = "文件添加请求体", requiredProperties = {
                "name",
                "type",
                "size",
                "fileView",
                "biz",
})
public class FileInfoAddRequest implements Serializable {

    /**
     * 文件名
     */
    @NotBlank(message = "文件名不能为空")
    @Schema(description = "文件名", example = "file.png")
    private String name;

    /**
     * 文件类型
     */
    @NotBlank(message = "文件类型不能为空")
    @Schema(description = "文件类型", example = "png")
    private String type;

    /**
     * 文件大小(KB)
     */
    @Schema(description = "文件大小", example = "3000")
    private Double size;

    /**
     * 文件view值
     */
    @NotBlank(message = "文件view值不能为空")
    @Schema(description = "文件view值", example = "3E8U2AM8")
    private String fileView;

    /**
     * 文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]
     */
    @EnumValue(enumClass = FileUploadBizEnum.class)
    @Schema(description = "文件业务类型[头像(avatar)|项目(project)|富文本(richText)|默认(default))]", example = "avatar")
    private String biz;

    /**
     * 文件hash值
     */
    @NotBlank(message = "文件hash值不能为空")
    @Schema(description = "文件hash值", example = "3E8U2AM8")
    private String hashValue;



    @Serial
    private static final long serialVersionUID = 1L;
}

