package com.qmth.jkserver.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qmth.jkserver.base.BaseEntity;
import com.qmth.jkserver.constant.SystemConstant;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Objects;

/**
 * <p>
 * 学校表
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
@TableName("basic_school")
public class BasicSchool extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    private String code;

    @TableField("domain_name")
    private String domainName;

    private String name;

    @ApiModelProperty(value = "是否启用，0：停用，1：启用")
    private Boolean enable = true;

    @TableField("access_key")
    private String accessKey;

    @TableField("access_secret")
    private String accessSecret;

    private String remark;

    @ApiModelProperty(value = "学校logo")
    @TableField(value = "logo")
    private String logo;

    public BasicSchool() {

    }

    public BasicSchool(Long id, String code, String name, String accessKey, String accessSecret) {
        this.code = code;
        this.domainName = code;
        this.name = name;
        this.accessKey = accessKey;
        this.accessSecret = accessSecret;
        setId(id);
        this.enable = true;
    }

    public BasicSchool(String code, String name, String accessKey, String accessSecret, String logo) {
        this.code = code;
        this.domainName = code;
        this.name = name;
        this.accessKey = accessKey;
        this.accessSecret = accessSecret;
        this.logo = logo;
        setId(SystemConstant.getDbUuid());
        this.enable = true;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BasicSchool that = (BasicSchool) o;
        return code.equals(that.code) && name.equals(that.name) && enable.equals(that.enable) && accessKey.equals(that.accessKey) && accessSecret.equals(that.accessSecret) && remark.equals(that.remark) && logo.equals(that.logo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(code, name, enable, accessKey, accessSecret, remark, logo);
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDomainName() {
        return domainName;
    }

    public void setDomainName(String domainName) {
        this.domainName = domainName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    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 getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
