package com.gxwebsoft.auto.dto;

import com.gxwebsoft.common.system.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 扫码登录状态响应
 *
 * @author 科技小王子
 * @since 2025-08-31
 */
@Data
@NoArgsConstructor
@Schema(description = "扫码登录状态响应")
public class QrLoginStatusResponse {

    @Schema(description = "状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, bind_phone-待绑定手机号, expired-已过期")
    private String status;

    @Schema(description = "JWT访问令牌(仅在confirmed状态时返回)")
    private String accessToken;

    @Schema(description = "用户信息")
    private User userInfo;

    @Schema(description = "剩余过期时间(秒)")
    private Long expiresIn;

    @Schema(description = "租户ID")
    private Integer tenantId;

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

    @Schema(description = "状态提示信息")
    private String message;

    @Schema(description = "下一步操作：bind_phone-绑定手机号, redirect-跳转, login-直接登录")
    private String nextAction;

    @Schema(description = "跳转URL（当nextAction为redirect时使用）")
    private String redirectUrl;

    @Schema(description = "成功消息")
    private String successMessage;

    public QrLoginStatusResponse(String status, String accessToken, User userInfo, Long expiresIn, Integer tenantId) {
        this.status = status;
        this.accessToken = accessToken;
        this.userInfo = userInfo;
        this.expiresIn = expiresIn;
        this.tenantId = tenantId;
    }

}
