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

import lombok.Data;

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

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;

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

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

    @Serial
    private static final long serialVersionUID = 1L;

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

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

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

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

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

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

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

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

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

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

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

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