package cn.reghao.tnb.file.app.zoss.model.dto;

import cn.reghao.jutil.jdk.web.validator.ValidEnum;
import cn.reghao.tnb.oss.api.constant.ObjectSize;
import cn.reghao.tnb.oss.api.constant.ObjectScope;
import cn.reghao.tnb.oss.api.constant.ObjectType;
import lombok.Getter;
import lombok.Setter;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

/**
 * @author reghao
 * @date 2021-06-03 16:15:23
 */
@Setter
@Getter
public class UploadChannelDto {
    @Pattern(regexp = "([^\\\\:*<>|\"?\\r\\n\\s/]+/)*([^\\\\:*<>|\"?\\r\\n\\s/]+)/$", message = "通道前缀不匹配")
    @Size(min = 2, max = 128, message = "通道前缀长度应在 2 ~ 128 个字符之间")
    private String channelPrefix;
    @NotNull
    @Size(min = 2, max = 128, message = "通道名长度应在 2 ~ 128 个字符之间")
    private String channelName;
    @ValidEnum(value = ObjectSize.class, message = "通道允许上传的文件大小不合法")
    private Long maxSize;
    @ValidEnum(value = ObjectType.class, message = "通道允许上传的文件类型不合法")
    private Integer objectType;
    @ValidEnum(value = ObjectScope.class, message = "通道作用域不合法")
    private Integer scope;
    @NotNull
    private Integer userNodeId;
}
