package com.qmth.exam.reserve.bean.login;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qmth.boot.core.security.model.AccessEntity;
import com.qmth.exam.reserve.bean.IModel;
import com.qmth.exam.reserve.enums.Role;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class LoginUser implements AccessEntity, IModel {

    private static final long serialVersionUID = 8254087838589213068L;

    @ApiModelProperty(value = "用户ID")
    private Long id;

    @ApiModelProperty(value = "账号")
    private String account;

    @ApiModelProperty(value = "用户姓名")
    private String name;

    @ApiModelProperty(value = "角色")
    private Role role;

    @ApiModelProperty(value = "学校ID")
    private Long orgId;

    @ApiModelProperty(value = "教学点ID")
    private Long categoryId;

    @ApiModelProperty(value = "预约任务ID")
    private Long applyTaskId;

    @ApiModelProperty(value = "微信OID")
    private String openId;

    @ApiModelProperty(value = "鉴权信息")
    private String sessionId;

    @ApiModelProperty(value = "鉴权信息")
    private String token;

    @Override
    @JsonIgnore
    @ApiModelProperty(hidden = true)
    public String getIdentity() {
        return sessionId;
    }

    @Override
    @JsonIgnore
    @ApiModelProperty(hidden = true)
    public String getSecret() {
        return token;
    }

    @Override
    @JsonIgnore
    @ApiModelProperty(hidden = true)
    public String getLogName() {
        return sessionId + " | " + account;
    }

}
