package com.pavis.admin.aigc.model.resp;

import lombok.Data;

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

import com.pavis.admin.common.model.resp.BaseResp;
import java.io.Serial;
import java.time.*;

/**
 * 应用API密钥信息
 *
 * @author semi
 * @since 2025/05/26 17:28
 */
@Data
@Schema(description = "应用API密钥信息")
public class AppApiResp extends BaseResp {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 关联应用ID
     */
    @Schema(description = "关联应用ID")
    private Long appId;

    /**
     * 渠道类型:web/mobile/api/sdk
     */
    @Schema(description = "渠道类型:web/mobile/api/sdk")
    private String channel;

    /**
     * API密钥
     */
    @Schema(description = "API密钥")
    private String apiKey;

    /**
     * API密钥(双密钥)
     */
    @Schema(description = "API密钥(双密钥)")
    private String secretKey;

    /**
     * 状态:0停用 1启用 2限流
     */
    @Schema(description = "状态:0停用 1启用 2限流")
    private Boolean status;

    /**
     * 过期时间
     */
    @Schema(description = "过期时间")
    private LocalDateTime expireTime;

    /**
     * IP白名单
     */
    @Schema(description = "IP白名单")
    private String ipWhitelist;

    /**
     * 每分钟最大请求数
     */
    @Schema(description = "每分钟最大请求数")
    private Integer rateLimit;

    /**
     * 权限范围
     */
    @Schema(description = "权限范围")
    private String scopes;

    /**
     * 允许访问的模型ID列表
     */
    @Schema(description = "允许访问的模型ID列表")
    private String modelWhitelist;

    /**
     * 总调用次数
     */
    @Schema(description = "总调用次数")
    private Long totalCalls;

    /**
     * 最后调用时间
     */
    @Schema(description = "最后调用时间")
    private LocalDateTime lastUsedTime;

    /**
     * 修改人
     */
    @Schema(description = "修改人")
    private Long updateUser;

    /**
     * 修改时间
     */
    @Schema(description = "修改时间")
    private LocalDateTime updateTime;
}