This commit is contained in:
2019-06-21 18:23:44 +08:00
parent 831de78b9c
commit a8b4c096db
21 changed files with 604 additions and 305 deletions

View File

@@ -3,6 +3,7 @@ import net.tccn.dbq.fbean.FBean;
import net.tccn.dbq.jdbc.api.DbAccount;
import net.tccn.dbq.jdbc.api.DbKit;
import net.tccn.dbq.parser.ParseMysql;
import net.tccn.dict.DictKit;
import net.tccn.meta.MetaService;
import net.tccn.meta.MetaTable;
import net.tccn.qtask.TaskEntity;
@@ -19,10 +20,8 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import static java.util.Arrays.asList;
@@ -52,6 +51,7 @@ public class RunTest<T> {
//System.out.println(query.getClass());
}*/
ParseMysql parser = new ParseMysql();
//@Test
public void parseFBeanTest() {
String str = "{name:'user_service', filters:[{col:'a.username',type:'like',value:'lxy'}], orders:[{col:a.`id`,desc: -1},{col:a.`deptName`,desc: 1}], limit:{ps:2,pn:10}}";
@@ -150,7 +150,7 @@ public class RunTest<T> {
public void findMaxNum() {
int xx = asList("1", "5", "3").stream().filter(x -> !x.isEmpty()).mapToInt(x -> {
return Integer.parseInt(x) * 2;
}).min().orElseGet(()-> 0);
}).min().orElseGet(() -> 0);
System.out.println(xx);
}
@@ -229,7 +229,8 @@ public class RunTest<T> {
String tpl = tplKit.getTpl("service.method", kv, false);
System.out.println(tpl);
}
private String toUpperCaseFirst(String str){
private String toUpperCaseFirst(String str) {
return str.substring(0, 1).toUpperCase() + str.substring(1);
}
@@ -249,14 +250,10 @@ public class RunTest<T> {
MetaKit metaKit = new MetaKit();
try {
File file = new File("tmp/metaKit.json");
file.getParentFile().mkdirs();
File file = new File("tmp/metaKit.json");
file.getParentFile().mkdirs();
FileKit.strToFile(convert.convertTo(metaKit), file);
} catch (IOException e) {
e.printStackTrace();
}
FileKit.strToFile(convert.convertTo(metaKit), file);
}
@Test
@@ -357,7 +354,7 @@ public class RunTest<T> {
@Test
public void switchTest() {
String a = "2";
switch (a){
switch (a) {
case "1":
System.out.println(1);
case "2":