Flipper.sort兼容多余的空格
This commit is contained in:
@@ -253,7 +253,7 @@ public abstract class AbstractDataSqlSource extends AbstractDataSource
|
||||
if (sort.indexOf(';') >= 0 || sort.indexOf('\n') >= 0) {
|
||||
return "";
|
||||
}
|
||||
return sortOrderbySqls.computeIfAbsent(sort, s -> {
|
||||
return sortOrderbySqls.computeIfAbsent(sort.trim(), s -> {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(" ORDER BY ");
|
||||
if (info.getBuilder().isNoAlias()) {
|
||||
@@ -261,6 +261,7 @@ public abstract class AbstractDataSqlSource extends AbstractDataSource
|
||||
} else {
|
||||
boolean flag = false;
|
||||
for (String item : s.split(",")) {
|
||||
item = item.trim();
|
||||
if (item.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ import org.redkale.util.RedkaleException;
|
||||
public class CachedInstance implements Service {
|
||||
|
||||
@Resource
|
||||
private CachedManager cacheManager;
|
||||
private CachedManager cachedManager;
|
||||
|
||||
// 修改远程缓存的key值
|
||||
public void updateName(String code, Map<String, Long> map) {
|
||||
cacheManager.remoteSetString(code, code + "_" + map.get("id"), Duration.ofMillis(60));
|
||||
cachedManager.remoteSetString(code + "_" + map.get("id"), code + "-" + map, Duration.ofMillis(60));
|
||||
}
|
||||
|
||||
@Cached(key = "#{code}_#{map.id}", remoteExpire = "60", timeUnit = TimeUnit.MILLISECONDS)
|
||||
@@ -41,7 +41,7 @@ public class CachedInstance implements Service {
|
||||
}
|
||||
|
||||
public void updateName(String val) {
|
||||
cacheManager.bothSet("name_2", String.class, val, Duration.ofSeconds(31), Duration.ofSeconds(60));
|
||||
cachedManager.bothSet("name_2", String.class, val, Duration.ofSeconds(31), Duration.ofSeconds(60));
|
||||
}
|
||||
|
||||
@Cached(key = "name_2", localExpire = "31", remoteExpire = "60")
|
||||
@@ -86,8 +86,8 @@ public class CachedInstance implements Service {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
|
||||
public CachedManager getCacheManager() {
|
||||
return cacheManager;
|
||||
public CachedManager getCachedManager() {
|
||||
return cachedManager;
|
||||
}
|
||||
|
||||
public static class ParamBean {
|
||||
|
||||
@@ -80,8 +80,8 @@ public class CachedInstanceTest {
|
||||
Assertions.assertEquals("haha", instance.getName2());
|
||||
Assertions.assertEquals("haha", instance2.getName2());
|
||||
System.out.println("准备设置 updateName");
|
||||
System.out.println("instance1.manager = " + instance.getCacheManager());
|
||||
System.out.println("instance2.manager = " + instance2.getCacheManager());
|
||||
System.out.println("instance1.manager = " + instance.getCachedManager());
|
||||
System.out.println("instance2.manager = " + instance2.getCachedManager());
|
||||
manager.updateBroadcastable(false);
|
||||
instance.updateName("gege");
|
||||
Assertions.assertEquals("gege", instance.getName2());
|
||||
|
||||
Reference in New Issue
Block a user