fix: fix code style

This commit is contained in:
chuntaojun 2020-05-13 18:14:27 +08:00
parent b6e5d9cc31
commit a68f5e22cf
2 changed files with 3 additions and 1 deletions

View File

@ -81,13 +81,14 @@ public class ConfigOpsController {
@GetMapping(value = "/derby")
public RestResult<Object> derbyOps(@RequestParam(value = "sql") String sql) {
String selectSign = "select";
String limitSign = "ROWS FETCH NEXT";
String limit = " OFFSET 0 ROWS FETCH NEXT 1000 ROWS ONLY";
try {
if (PropertyUtil.isEmbeddedStorage()) {
LocalDataSourceServiceImpl dataSourceService = (LocalDataSourceServiceImpl) DynamicDataSource
.getInstance().getDataSource();
if (StringUtils.startsWithIgnoreCase(sql, selectSign)) {
if (!StringUtils.containsIgnoreCase(sql, "ROWS FETCH NEXT")) {
if (!StringUtils.containsIgnoreCase(sql, limitSign)) {
sql += limit;
}
JdbcTemplate template = dataSourceService.getJdbcTemplate();

View File

@ -33,6 +33,7 @@ import java.util.Objects;
/**
* @author <a href="mailto:liaochuntao@live.com">liaochuntao</a>
*/
@SuppressWarnings("all")
public enum JRaftOps {
TRANSFER_LEADER("transferLeader") {