package com.jeesharp.business.modules.member.entity;

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

import java.time.LocalDateTime;

/**
 * 登录结果VO
 *
 * @author jeesharp
 */
@Data
@Schema(description = "登录结果")
public class LoginResultVO {

    @Schema(description = "访问令牌")
    private String accessToken;

    @Schema(description = "令牌类型", example = "Bearer")
    private String tokenType = "Bearer";

    @Schema(description = "过期时间（秒）", example = "604800")
    private Long expiresIn;

    @Schema(description = "刷新令牌")
    private String refreshToken;

    @Schema(description = "是否新用户")
    private Boolean isNewUser;

    @Schema(description = "是否需要绑定手机号")
    private Boolean needBindMobile;

    @Schema(description = "会员ID")
    private String memberId;

    @Schema(description = "会员编号")
    private String memberNo;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "手机号（脱敏）", example = "138****5678")
    private String mobile;

    @Schema(description = "OpenID（第三方登录时返回）")
    private String openid;

    // ==================== 成长等级（与 Member 表一致，便于登录后展示） ====================

    @Schema(description = "当前会员等级ID")
    private String levelId;

    @Schema(description = "当前会员等级编码")
    private String levelCode;

    @Schema(description = "成长值")
    private Integer growthValue;

    @Schema(description = "等级过期时间")
    private LocalDateTime levelExpireDate;

    // ==================== 付费等级（便于 App 判断是否曾付费 / 当前是否有效 VIP） ====================

    @Schema(description = "是否付费会员：0-否 1-是")
    private Integer isVip;

    @Schema(description = "当前有效付费等级编码")
    private String vipLevelCode;

    @Schema(description = "付费到期时间")
    private LocalDateTime vipExpireDate;
}
