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

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

/**
 * 苹果登录请求
 *
 * @author jeesharp
 */
@Data
@Schema(description = "苹果登录请求")
public class LoginByAppleDTO {

    @Schema(description = "Apple Identity Token", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "identityToken不能为空")
    private String identityToken;

    @Schema(description = "Apple Authorization Code", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "authorizationCode不能为空")
    private String authorizationCode;

    @Schema(description = "用户姓名（首次授权时返回）")
    private AppleFullName fullName;

    @Schema(description = "邀请码", example = "ABC123")
    private String inviteCode;

    // ==================== 推送设备（可选，登录成功后自动注册并绑定） ====================

    @Schema(description = "应用ID（与 pushToken 同时传入时生效）")
    private String appId;

    @Schema(description = "推送通道Token（HMS/APNS/FCM 等）")
    private String pushToken;

    @Schema(description = "推送通道：HMS、APNS、FCM、JPUSH")
    private String pushChannel;

    @Schema(description = "设备ID", example = "device_xxx")
    private String deviceId;

    @Schema(description = "平台：APP、MINI、H5", example = "APP")
    private String platform;

    @Data
    @Schema(description = "苹果用户姓名")
    public static class AppleFullName {
        @Schema(description = "姓")
        private String familyName;
        @Schema(description = "名")
        private String givenName;
    }
}
