package com.yiqi.common.core.domain;

import com.yiqi.app.domain.AppUser;
import com.yiqi.common.core.domain.entity.SysUser;
import com.yiqi.common.enums.PlatformType;
import com.yiqi.common.enums.SourceType;
import lombok.Data;

/**
 * @author xiaohei
 * @date 2023/7/24
 */
@Data
public class AuthInfoDO {

    public AuthInfoDO(){

    }

    public AuthInfoDO(SysUser user){
        userId = user.getUserId();
        userName = user.getUserName();
        nickName = user.getNickName();
        platform = user.getUserType();
    }

    public AuthInfoDO(AppUser user){
        userId = user.getId();
        userName = user.getPhoneNumber();
        nickName = user.getRealName();
        openId = user.getWxOpenId();
        platform = PlatformType.USER.getCode();
    }

    private Long userId;

    private String doctorId;

    private String unionId;

    private String openId;

    private String userType;

    private String userName;

    private String nickName;

    private String platform;

    private String phone;

    private String token;

    /**
     * 登录时间
     */
    private Long loginTime;

    /**
     * 过期时间
     */
    private Long expireTime;

    /**
     * 登录IP地址
     */
    private String ipaddr;

    /**
     * 登录地点
     */
    private String loginLocation;

    /**
     * 浏览器类型
     */
    private String browser;

    /**
     * 操作系统
     */
    private String os;
}
