package com.sz.admin.monitor.pojo.po;

import cn.hutool.core.bean.BeanUtil;
import com.mybatisflex.annotation.Table;
import com.sz.admin.monitor.pojo.dto.dataModel.GridCfgDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 网格配置数据对象
 * @description: 存储网格的基本配置信息
 * @author xq
 * @date 2026/1/29 11:35
 */
@Table("grid_cfg")
@Schema(description = "存储网格的基本配置信息")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class GridCfgDO {
    /**
     * 网格id
     */
    @Schema(description = "主键ID")
    private String id;

    /**
     * 用户id
     */
    @Schema(description = "主键ID")
    private String userId;

    /**
     * 网格是否启用
     */
    @Schema(description = "主键ID")
    private Boolean enabled;

    /**
     * 对齐
     */
    @Schema(description = "主键ID")
    private Boolean align;

    /**
     * 大小
     */
    @Schema(description = "主键ID")
    private Integer size;

    /**
     * 转换为DTO对象
     * @param gridCfgDO
     * @return
     */
    public static GridCfgDTO doConvertDTO(GridCfgDO gridCfgDO){
        GridCfgDTO gridCfgDTO = BeanUtil.copyProperties(gridCfgDO, GridCfgDTO.class);
        return gridCfgDTO;
    }


    public static final String ID = "id";
    public static final String USER_ID = "user_id";
    public static final String ENABLED = "enabled";
    public static final String ALIGN = "align";
    public static final String SIZE = "size";
}
