package cn.iocoder.yudao.module.server.controller.admin.materialinfo.vo;

import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 资料库 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialInfoRespVO {

    @Schema(description = "资料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4385")
//    @ExcelProperty("资料ID")
    private Long id;

    @Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14107")
//    @ExcelProperty("分类ID")
    private Long categoryId;

    @Schema(description = "分类名称")
    @ExcelProperty("分类名称")
    private String categoryName;

    @Schema(description = "资料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    @ExcelProperty("资料名称")
    private String name;

    @Schema(description = "资料介绍", example = "你猜")
    @ExcelProperty("资料介绍")
    private String description;

    @Schema(description = "失效日期")
    @ExcelProperty("有效期")
    @ColumnWidth(20)
    private LocalDateTime expireTime;

    @Schema(description = "生效日期")
    private LocalDateTime startTime;

    @Schema(description = "开启过期提醒")
    private Boolean remind;

    @Schema(description = "提前提醒天数")
    private Integer dayleft;

    @Schema(description = "共享类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "共享类型", converter = DictConvert.class)
    @DictFormat("trs_material_share") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer shareType;

    @Schema(description = "下载次数", example = "21516")
    @ExcelProperty("下载次数")
    private Integer downloadCount;

    @Schema(description = "状态")
    @ExcelProperty("状态")
    private Integer status;

    @Schema(description = "备注信息", example = "你说的对")
    @ExcelProperty("备注信息")
    private String reportRemark;

    @Schema(description = "附件名称")
    @ExcelProperty("附件名称")
    private String attachment;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    @ColumnWidth(20)
    private LocalDateTime createTime;

    @Schema(description = "部门ID", example = "31665")
    private Long departmentId;

    @Schema(description = "部门/盟市")
    private String departmentName;

    @Schema(description = "共享用户列表")
    private List<ShareUserVO> shareUsers;
    @Data
    public static class ShareUserVO {
        @Schema(description = "用户ID")
        private Long userId;

        @Schema(description = "部门名称")
        private String deptName;
    }

}