init
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.cai.enums.systemconfig;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
public class Rate1000IntegerSystemConfigCheck implements ISystemConfigCheck{
|
||||
|
||||
@Override
|
||||
public SystemCheckResp check(String value) {
|
||||
if(StringUtils.isEmpty(value)){
|
||||
return SystemCheckResp.fail("该配置必填");
|
||||
}
|
||||
boolean b = NumberUtil.isInteger(value);
|
||||
if(!b){
|
||||
return SystemCheckResp.fail("请填写[0-1000]之间的整数");
|
||||
}
|
||||
int val = Integer.parseInt(value);
|
||||
if(val < 0 || val > 1000){
|
||||
return SystemCheckResp.fail("请填写[0-1000]之间的整数");
|
||||
}
|
||||
return SystemCheckResp.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.cai.enums.systemconfig;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
public class Rate100IntegerSystemConfigCheck implements ISystemConfigCheck{
|
||||
@Override
|
||||
public SystemCheckResp check(String value) {
|
||||
if(StringUtils.isEmpty(value)){
|
||||
return SystemCheckResp.fail("该配置必填");
|
||||
}
|
||||
boolean b = NumberUtil.isInteger(value);
|
||||
if(!b){
|
||||
return SystemCheckResp.fail("请填写[0-100]之间的整数");
|
||||
}
|
||||
int val = Integer.parseInt(value);
|
||||
if(val < 0 || val > 100){
|
||||
return SystemCheckResp.fail("请填写[0-100]之间的整数");
|
||||
}
|
||||
return SystemCheckResp.ok();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user