| | |
| | | } |
| | | |
| | | private String getConfigString(String flag, String defaultVal) { |
| | | Config c = configService.getOne(new LambdaQueryWrapper<Config>().eq(Config::getFlag, flag).last("LIMIT 1")); |
| | | Config c = configService.getOne(new LambdaQueryWrapper<Config>() |
| | | .eq(Config::getFlag, flag) |
| | | .orderByDesc(Config::getId) |
| | | .last("LIMIT 1")); |
| | | if (c != null && c.getVal() != null && !c.getVal().isEmpty()) { |
| | | return c.getVal().trim(); |
| | | } |
| | |
| | | /** 返回 null 表示未配置或解析失败 */ |
| | | private Integer getConfigInt(String flag) { |
| | | try { |
| | | Config c = configService.getOne(new LambdaQueryWrapper<Config>().eq(Config::getFlag, flag).last("LIMIT 1")); |
| | | Config c = configService.getOne(new LambdaQueryWrapper<Config>() |
| | | .eq(Config::getFlag, flag) |
| | | .orderByDesc(Config::getId) |
| | | .last("LIMIT 1")); |
| | | if (c != null && c.getVal() != null && !c.getVal().isEmpty()) { |
| | | return Integer.parseInt(c.getVal().trim()); |
| | | } |