package org.jeecg.modules.app.dto;

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

import java.util.List;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "个人认证授权参数DTO")
public class GetPsnAuthUrlDTO {
    @Schema(description = "个人认证配置")
    private PsnAuthConfig psnAuthConfig;

    @Schema(description = "授权配置")
    private AuthorizeConfig authorizeConfig;

    @Schema(description = "通知回调地址")
    private String notifyUrl;

    @Schema(description = "客户端类型")
    private String clientType = "ALL";

    @Schema(description = "重定向配置")
    private RedirectConfig redirectConfig;

    /**
     * 个人认证配置
     */
    @Data
    @Accessors(chain = true)
    @Schema(description = "个人认证配置")
    public static class PsnAuthConfig {
        @Schema(description = "用户账号")
        private String psnAccount;

        @Schema(description = "个人认证页面配置")
        private PsnAuthPageConfig psnAuthPageConfig;
    }

    /**
     * 个人认证页面配置
     */
    @Data
    @Accessors(chain = true)
    @Schema(description = "个人认证页面配置")
    public static class PsnAuthPageConfig {
        @Schema(description = "默认认证方式")
        private String psnDefaultAuthMode = "PSN_MOBILE3";

        @Schema(description = "可用认证方式列表")
        private List<String> psnAvailableAuthModes = List.of("PSN_MOBILE3");
    }

    /**
     * 授权配置
     */
    @Data
    @Accessors(chain = true)
    @Schema(description = "授权配置")
    public static class AuthorizeConfig {
        @Schema(description = "授权范围列表")
        private List<String> authorizedScopes = List.of("get_psn_identity_info");
    }

    /**
     * 重定向配置
     */
    @Data
    @Accessors(chain = true)
    @Schema(description = "重定向配置")
    public static class RedirectConfig {
        @Schema(description = "重定向地址")
        private String redirectUrl;
    }
}
