package com.snack.server.module.category.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

/**
 * 分类树节点 VO
 */
@Data
@Schema(description = "分类树节点")
public class CategoryTreeVO implements Serializable {

    @Schema(description = "分类 ID")
    private Long id;

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

    @Schema(description = "父分类 ID，0 = 顶级")
    private Long parentId;

    @Schema(description = "层级：1 一级 / 2 二级 / 3 三级")
    private Integer level;

    @Schema(description = "排序号")
    private Integer sort;

    @Schema(description = "分类图标")
    private String icon;

    @Schema(description = "状态：0-禁用 1-启用")
    private Integer status;

    @Schema(description = "子分类列表")
    private List<CategoryTreeVO> children;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
}
