package com.yolo.keyboard.controller.admin.usercalllog.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import cn.idev.excel.annotation.*;

@Schema(description = "管理后台 - 用户每次调用日志（用于记录token、模型、耗时、成功率等） Response VO")
@Data
@ExcelIgnoreUnannotated
public class KeyboardUserCallLogRespVO {

    @Schema(description = "主键 id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32537")
    @ExcelProperty("主键 id")
    private Long id;

    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22552")
    @ExcelProperty("用户ID")
    private Long userId;

    @Schema(description = "幂等请求ID，避免重试导致重复记录", requiredMode = Schema.RequiredMode.REQUIRED, example = "12645")
    @ExcelProperty("幂等请求ID，避免重试导致重复记录")
    private String requestId;

    @Schema(description = "调用功能来源", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("调用功能来源")
    private String feature;

    @Schema(description = "调用的模型名称")
    @ExcelProperty("调用的模型名称")
    private String model;

    @Schema(description = "输入token数", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("输入token数")
    private Integer inputTokens;

    @Schema(description = "输出token数", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("输出token数")
    private Integer outputTokens;

    @Schema(description = "总token数（input+output）", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("总token数（input+output）")
    private Integer totalTokens;

    @Schema(description = "调用是否成功", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("调用是否成功")
    private Boolean success;

    @Schema(description = "调用耗时（毫秒）")
    @ExcelProperty("调用耗时（毫秒）")
    private Integer latencyMs;

    @Schema(description = "失败错误码（可空）")
    @ExcelProperty("失败错误码（可空）")
    private String errorCode;

    @Schema(description = "调用记录创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("调用记录创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "生成 id", example = "2813")
    @ExcelProperty("生成 id")
    private String genId;

}