更新beetlsql api

This commit is contained in:
zhuangqian 2017-02-11 22:53:04 +08:00
parent 8cfa74b829
commit 774ec56703
5 changed files with 898 additions and 860 deletions

View File

@ -19,7 +19,7 @@
<shiro.version>1.3.2</shiro.version>
<log4j2.version>2.7</log4j2.version>
<beetl.version>2.7.11</beetl.version>
<beetlsql.version>2.8.2</beetlsql.version>
<beetlsql.version>2.8.3</beetlsql.version>
</properties>
<dependencies>

View File

@ -1,57 +1,57 @@
/**
* Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.smallchill.core.listener;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import com.smallchill.core.constant.Const;
import com.smallchill.core.toolbox.Func;
import com.smallchill.core.toolbox.kit.ObjectKit;
import com.smallchill.core.toolbox.kit.PropKit;
public class ConfigListener implements ServletContextListener {
private static Map<String, String> conf = new HashMap<String, String>();
public static Map<String, String> getConf() {
return ObjectKit.clone(conf);
}
@Override
public void contextDestroyed(ServletContextEvent arg0) {
conf.clear();
}
@Override
public void contextInitialized(ServletContextEvent evt) {
ServletContext sc = evt.getServletContext();
// 项目路径
conf.put("realPath", sc.getRealPath("/").replaceFirst("/", ""));
conf.put("contextPath", sc.getContextPath());
Properties prop = PropKit.use(Const.PROPERTY_FILE).getProperties();
for (Object name : prop.keySet()) {
conf.put(name.toString(), Func.toStr(prop.get(name)));
}
}
}
/**
* Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.smallchill.core.listener;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import com.smallchill.core.constant.Const;
import com.smallchill.core.toolbox.Func;
import com.smallchill.core.toolbox.kit.ObjectKit;
import com.smallchill.core.toolbox.kit.PropKit;
public class ConfigListener implements ServletContextListener {
private static Map<String, String> conf = new HashMap<String, String>();
public static Map<String, String> getConf() {
return ObjectKit.clone(conf);
}
@Override
public void contextDestroyed(ServletContextEvent arg0) {
conf.clear();
}
@Override
public void contextInitialized(ServletContextEvent evt) {
ServletContext sc = evt.getServletContext();
// 项目路径
conf.put("realPath", sc.getRealPath("/"));
conf.put("contextPath", sc.getContextPath());
Properties prop = PropKit.use(Const.PROPERTY_FILE).getProperties();
for (Object name : prop.keySet()) {
conf.put(name.toString(), Func.toStr(prop.get(name)));
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,7 @@ public class DefaultFileProxyFactory implements IFileProxy {
//避免网络延迟导致时间不同步
long time = System.currentTimeMillis();
StringBuilder uploadPath = new StringBuilder().append(File.separator)
StringBuilder uploadPath = new StringBuilder()
.append(getFileDir(dir, Cst.me().getUploadRealPath()))
.append(time)
.append(getFileExt(f.getName()));

View File

@ -116,9 +116,9 @@ public class GenerateController extends CurdController<Generate> {
String tableName = gen.getTablename();
String pkName = gen.getPkname();
String path = File.separator + realPath + File.separator + "java" + File.separator + packageName.replace(StrKit.DOT, File.separator);
String resourcesPath = File.separator + realPath + File.separator + "resources";
String webappPath = File.separator + realPath + File.separator + "webapp" + File.separator + "WEB-INF" + File.separator + "view";
String path = realPath + File.separator + "java" + File.separator + packageName.replace(StrKit.DOT, File.separator);
String resourcesPath = realPath + File.separator + "resources";
String webappPath = realPath + File.separator + "webapp" + File.separator + "WEB-INF" + File.separator + "view";
//java
String controllerPath = path + File.separator + "controller" + File.separator + upperModelName + "Controller.java";