package cn.reghao.oss.console.app.model.vo;

import cn.reghao.oss.storeapi.constant.ObjectScope;
import cn.reghao.oss.storeapi.constant.ObjectType;
import cn.reghao.oss.console.app.model.po.UploadChannel;
import lombok.Getter;

/**
 * @author reghao
 * @date 2024-02-28 13:16:02
 */
@Getter
public class UploadChannelVo {
    private int id;
    private int channelId;
    private String name;
    private String prefix;
    private String maxSize;
    private String fileType;
    private boolean seturl;
    private String scope;
    private String bindDomain;

    public UploadChannelVo(UploadChannel uploadChannel, String maxSize, String bindDomain) {
        this.id = uploadChannel.getId();
        this.channelId = uploadChannel.getChannelId();
        this.name = uploadChannel.getName();
        this.prefix = uploadChannel.getPrefix();
        this.maxSize = maxSize;
        this.fileType = ObjectType.getDescByCode(uploadChannel.getFileType());
        this.seturl = uploadChannel.getSeturl();
        this.scope = ObjectScope.getByCode(uploadChannel.getScope()).name();
        this.bindDomain = bindDomain;
    }
}
