package com.qmth.jkserver.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.jkserver.base.BaseEntity;
import com.qmth.jkserver.constant.SystemConstant;
import com.qmth.jkserver.enums.AuthEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 激活授权配置表
 * </p>
 *
 * @author wangliang
 * @since 2022-04-26
 */
@ApiModel(value = "TSAuth对象", description = "激活授权配置表")
public class TSAuth extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "学校id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long schoolId;

    @ApiModelProperty(value = "accessKey")
    private String accessKey;

    @ApiModelProperty(value = "accessSecret")
    private String accessSecret;

    @ApiModelProperty(value = "离线授权证书")
    private String description;

    @ApiModelProperty(value = "授权类型")
    private AuthEnum type;

    @ApiModelProperty(value = "过期时间")
    private Long expireTime;

    @ApiModelProperty(value = "文件数据")
    private byte[] file;

    public TSAuth() {

    }

    public TSAuth(Long schoolId, String accessKey, String accessSecret, AuthEnum type, Long expireTime) {
        setId(SystemConstant.getDbUuid());
        this.schoolId = schoolId;
        this.accessKey = accessKey;
        this.accessSecret = accessSecret;
        this.type = type;
        this.expireTime = expireTime;
    }

    public TSAuth(Long schoolId, String description, AuthEnum type, Long expireTime) {
        setId(SystemConstant.getDbUuid());
        this.schoolId = schoolId;
        this.description = description;
        this.type = type;
        this.expireTime = expireTime;
    }

    public TSAuth(Long schoolId, byte[] file, AuthEnum type, Long expireTime) {
        setId(SystemConstant.getDbUuid());
        this.schoolId = schoolId;
        this.file = file;
        this.type = type;
        this.expireTime = expireTime;
    }

    public byte[] getFile() {
        return file;
    }

    public void setFile(byte[] file) {
        this.file = file;
    }

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getAccessSecret() {
        return accessSecret;
    }

    public void setAccessSecret(String accessSecret) {
        this.accessSecret = accessSecret;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public AuthEnum getType() {
        return type;
    }

    public void setType(AuthEnum type) {
        this.type = type;
    }
}
