package com.seer.teach.user.api.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(name = "UserAuthDTO", description = "RPC 服务 - 用户权限查询 Response DTO")
@Data
public class UserAuthDTO {

    @Schema(description = "关联的用户ID")
    private Integer userId;

    @Schema(description = "提供商: wechat,alipay,apple,phone")
    private String provider;

    @Schema(description = "认证类型: wechat_mini(微信小程序),wechat_mp(公众号),alipay_mini(支付宝小程序),phone_sms(短信验证)")
    private String authType;

    @Schema(description = "平台用户唯一ID")
    private String openId;

    @Schema(description = "跨平台统一ID(如微信union_id)")
    private String unionId;

    @Schema(description = "应用ID")
    private String appId;

    @Schema(description = "访问令牌(加密存储)")
    private String accessToken;

    @Schema(description = "刷新令牌(加密存储)")
    private String refreshToken;

    @Schema(description = "令牌过期时间")
    private LocalDateTime tokenExpiresAt;

    @Schema(description = "扩展凭证(如小程序session_key)")
    private String credentialJson;

    @Schema(description = "用户资料原始JSON")
    private String profileJson;

    @Schema(description = "是否绑定: 1=是, 0=否（解绑后保留记录）")
    private Boolean isBound;

    @Schema(description = "是否已验证: 1=是, 0=否（如手机号未验证）")
    private Boolean isVerified;

    @Schema(description = "状态: 1=正常, 0=禁用, -1=已删除")
    private Integer status;

    @Schema(description = "登录次数统计")
    private Integer loginCount;

    @Schema(description = "最后登录时间")
    private LocalDateTime lastLoginAt;
}
