package com.ruoyi.xq.manager.systemconfig;

import cn.hutool.core.util.NumberUtil;
import com.ruoyi.common.utils.StringUtils;

public class NumberSystemConfigCheck implements ISystemConfigCheck{
    @Override
    public SystemCheckResp check(String value) {
        if(StringUtils.isEmpty(value)){
            return SystemCheckResp.fail("该配置必填");
        }
        boolean b = NumberUtil.isLong(value);
        if(!b){
            return SystemCheckResp.fail("请填写正确的整数");
        }
        Long of = Long.valueOf(value);
        if(of < 0){
            return SystemCheckResp.fail("请填写整数，不要填负数");
        }
        return SystemCheckResp.ok();
    }
}
