fix: fix code style
This commit is contained in:
parent
b6e5d9cc31
commit
a68f5e22cf
@ -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();
|
||||
|
@ -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") {
|
||||
|
Loading…
Reference in New Issue
Block a user