package com.tashow.cloud.ai.controller.admin.aisample.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.tashow.cloud.ai.dal.dataobject.aisample.AiSampleTagDO;
import com.tashow.cloud.common.serializer.ImgJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 样本库 Response VO")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ExcelIgnoreUnannotated
public class AiSampleRespVO {

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

    @Schema(description = "标签列表（已废弃，使用enumTags和customTags代替）")
    @Deprecated
    private List<AiSampleTagDO> tags;

    @Schema(description = "枚举标签列表（包含分组信息）")
    private List<TagInfo> enumTags;

//    @Schema(description = "个性标签列表")
//    private List<TagInfo> customTags;

    @Schema(description = "关联模型列表")
    private List<ModelInfo> relatedModels;

    @Schema(description = "样本文件地址")
    @JsonSerialize(using = ImgJsonSerializer.class)
    private String sampleFilePath;

    @Schema(description = "样本名称", example = "张三")
    private String sampleName;

    @Schema(description = "样本时长")
    private String sampleTime;

    @Schema(description = "样本格式", example = "1")
    private String sampleMineType;

    @Schema(description = "样本大小")
    private String sampleSize;

    @Schema(description = "样本注释", example = "随便")
    private String remark;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;


    @Schema(description = "文件后缀")
    private String suffix;

    @Schema(description = "标签信息")
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class TagInfo {
        @Schema(description = "标签ID")
        private Long id;

        @Schema(description = "标签名称")
        private String tagName;

        @Schema(description = "枚举值")
        private String enumValue;

        @Schema(description = "分组ID")
        private Long groupId;

        @Schema(description = "分组名称")
        private String groupName;
    }

    @Schema(description = "模型信息")
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ModelInfo {
        @Schema(description = "模型ID")
        private Long id;

        @Schema(description = "模型名称")
        private String modelName;

        @Schema(description = "版本号")
        private String version;
    }

}