package com.gxwebsoft.auto.dto;

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

/**
 * 微信扫码登录响应
 *
 * @author 科技小王子
 * @since 2026-04-06
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "微信扫码登录响应")
public class WechatScanResponse {

    @Schema(description = "状态：success-登录成功，bind_required-需要绑定账号，not_bound-账号未绑定")
    private String status;

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

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

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

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

    public static WechatScanResponse success(String accessToken, Object userInfo, Integer tenantId) {
        return new WechatScanResponse("success", accessToken, userInfo, "登录成功", tenantId);
    }

    public static WechatScanResponse needBind(String message) {
        return new WechatScanResponse("bind_required", null, null, message, null);
    }

    public static WechatScanResponse notBound(String message) {
        return new WechatScanResponse("not_bound", null, null, message, null);
    }

}
