package com.purui.prims.headless.server.persistence.dataobject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
@TableName("pr_sys_parameter")
public class SysParameterDO {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private String defaultValue;
    private String description;
    private String dataType;
    private String module;
    private String dataValue;

    public String getValue() {
        if (StringUtils.isBlank(dataValue)) {
            return defaultValue;
        }
        return dataValue;
    }

}
