.
This commit is contained in:
@@ -4,12 +4,9 @@ import org.redkale.convert.json.JsonConvert;
|
||||
import org.redkale.net.http.RestMapping;
|
||||
import org.redkale.service.Service;
|
||||
import org.redkale.source.CacheSource;
|
||||
import org.redkale.util.AnyValue;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Logger;
|
||||
@@ -39,28 +36,6 @@ public class BaseService implements Service {
|
||||
|
||||
private static boolean tplInit = false;
|
||||
|
||||
@Override
|
||||
public void init(AnyValue config) {
|
||||
try {
|
||||
File file = new File(APP_HOME.toPath() + "/conf/config.txt");
|
||||
if (file.exists()) {
|
||||
prop.load(new FileInputStream(file));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
if (!tplInit) {
|
||||
tplInit = true;
|
||||
//tplKit.addTpl(new File(FileKit.rootPath(), tplPath));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RestMapping(ignore = true)
|
||||
public <T> T getT(String key, Class<T> clazz, Supplier<T> supplier) {
|
||||
Object obj = cacheSource.getAndRefresh(key, 1000 * 60 * 3, clazz);
|
||||
@@ -75,21 +50,12 @@ public class BaseService implements Service {
|
||||
return t;
|
||||
}
|
||||
|
||||
@RestMapping(ignore = true)
|
||||
public String getProperty(String k, String defaultValue){
|
||||
return prop.getProperty(k, defaultValue).replace("${APP_HOME}", APP_HOME.getPath());
|
||||
}
|
||||
@RestMapping(ignore = true)
|
||||
public String getProperty(String k){
|
||||
return prop.getProperty(k);
|
||||
}
|
||||
|
||||
@RestMapping(ignore = true)
|
||||
public String platId(String token) {
|
||||
return MetaKit.getPlatId(token);
|
||||
}
|
||||
|
||||
public boolean isEmpty(Object obj) {
|
||||
return X.isEmpty(obj);
|
||||
return Utils.isEmpty(obj);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user