package cn.reghao.oss.web.app.model.po;

import cn.reghao.oss.web.app.model.dto.UploadChannelDto;
import cn.reghao.oss.web.util.db.BaseEntity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Entity;

/**
 * @author reghao
 * @date 2024-02-23 15:05:30
 */
@NoArgsConstructor
@Getter
@Setter
@Entity
public class UploadChannel extends BaseEntity {
    private Integer channelId;
    private String name;
    private String prefix;
    private Long maxSize;
    private String contentType;
    private String description;
    private String bindDomain;
    private Integer createBy;

    public UploadChannel(int channelId, UploadChannelDto uploadChannelDto, int createBy) {
        this.channelId = channelId;
        this.prefix = uploadChannelDto.getChannelPrefix();
        this.maxSize = uploadChannelDto.getMaxSize();
        this.description = uploadChannelDto.getDescription();
        this.bindDomain = uploadChannelDto.getDomain();
        this.createBy = createBy;
    }
}
