package com.ghy.web.pojo.vo;

import com.ghy.system.domain.SysGlobalConfig;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

/**
 * @Author 但星霖
 * @Date 2023-03-20 20：37：16
 * 说明：系统配置返回vo
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Schema(description = "系统配置请求返回vo")
public class SysGlobalConfigRequestVO {

    @Schema(description = "配置项主键ID")
    private Long id;

    @Schema(description = "配置项名称")
    private String name;

    @Schema(description = "配置项内容json串")
    private String content;

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

    @Schema(description = "描述")
    private String describe;

    @Schema(description = "配置类型")
    private Integer type;

    @Schema(description = "数据内容类型")
    private Integer dataType;

    @Schema(description = "单位")
    private String configUnit;

    public static SysGlobalConfig toModel(SysGlobalConfigRequestVO vo){
        SysGlobalConfig sysConfig = new SysGlobalConfig();
        BeanUtils.copyProperties(vo, sysConfig);
        return sysConfig;
    }
}
