Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da5dbdf23b | ||
|
|
4866a13365 | ||
|
|
9d4f849371 | ||
|
|
5dd679eb24 | ||
|
|
f788cb7e78 | ||
|
|
9ec99230ad | ||
|
|
9c390d7cb1 | ||
|
|
28aef61cea | ||
|
|
15ae96b04a | ||
|
|
a8764cf247 | ||
|
|
e5842b42f4 | ||
|
|
4d7a40d30f | ||
|
|
fe18621aa9 | ||
|
|
a029e6d56a | ||
|
|
73f64ca648 | ||
|
|
63e3bd03b4 | ||
|
|
4103bf1d6a | ||
|
|
7a33736d43 | ||
|
|
298d1adbba | ||
|
|
9be2959d7d | ||
|
|
0fad02369b | ||
|
|
548a747e19 | ||
|
|
e2101b438f | ||
|
|
bbcb4b937d | ||
|
|
bcde73efed | ||
|
|
a6ddb4ed16 | ||
|
|
59fbee7a2f |
@@ -4,8 +4,8 @@
|
|||||||
</p>
|
</p>
|
||||||
<h3 align="center" style="margin:30px 0 30px;font-weight:bold;font-size:30px;">快速开发平台 - Spring Boot</h3>
|
<h3 align="center" style="margin:30px 0 30px;font-weight:bold;font-size:30px;">快速开发平台 - Spring Boot</h3>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://jeesite.com/docs/upgrade/" target="__blank"><img alt="JeeSite-V4.5" src="https://img.shields.io/badge/JeeSite-V4.5-success.svg"></a>
|
<a href="https://jeesite.com/docs/upgrade/" target="__blank"><img alt="JeeSite-V4.6" src="https://img.shields.io/badge/JeeSite-V4.6-success.svg"></a>
|
||||||
<a href="https://spring.io/projects/spring-boot#learn" target="__blank"><img alt="SpringBoot-2.6" src="https://img.shields.io/badge/SpringBoot-2.6-blue.svg"></a>
|
<a href="https://spring.io/projects/spring-boot#learn" target="__blank"><img alt="SpringBoot-2.7" src="https://img.shields.io/badge/SpringBoot-2.7-blue.svg"></a>
|
||||||
<a href="https://gitee.com/thinkgem/jeesite4/stargazers" target="__blank"><img alt="star" src="https://gitee.com/thinkgem/jeesite4/badge/star.svg?theme=dark"></a>
|
<a href="https://gitee.com/thinkgem/jeesite4/stargazers" target="__blank"><img alt="star" src="https://gitee.com/thinkgem/jeesite4/badge/star.svg?theme=dark"></a>
|
||||||
<a href="https://gitee.com/thinkgem/jeesite4/members" target="__blank"><img alt="fork" src="https://gitee.com/thinkgem/jeesite4/badge/fork.svg?theme=dark"></a>
|
<a href="https://gitee.com/thinkgem/jeesite4/members" target="__blank"><img alt="fork" src="https://gitee.com/thinkgem/jeesite4/badge/fork.svg?theme=dark"></a>
|
||||||
</p>
|
</p>
|
||||||
@@ -51,7 +51,7 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
|
|||||||
|
|
||||||
## 技术选型
|
## 技术选型
|
||||||
|
|
||||||
* 主框架:Spring Boot 2.6、Spring Framework 5.3、Apache Shiro 1.9、J2Cache
|
* 主框架:Spring Boot 2.7、Spring Framework 5.3、Apache Shiro 1.11、J2Cache
|
||||||
* 持久层:Apache MyBatis 3.5、Hibernate Validator 6.2、Alibaba Druid 1.2
|
* 持久层:Apache MyBatis 3.5、Hibernate Validator 6.2、Alibaba Druid 1.2
|
||||||
* 视图层:Spring MVC 5.3、Beetl 3.3(替换JSP)、Bootstrap 3.3、AdminLTE 2.4
|
* 视图层:Spring MVC 5.3、Beetl 3.3(替换JSP)、Bootstrap 3.3、AdminLTE 2.4
|
||||||
* 前端组件:jQuery 3.5、jqGrid 4.7、layer 3.5、zTree 3.5、jQuery Validation
|
* 前端组件:jQuery 3.5、jqGrid 4.7、layer 3.5、zTree 3.5、jQuery Validation
|
||||||
@@ -88,7 +88,7 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
|
|||||||
### 本地运行
|
### 本地运行
|
||||||
|
|
||||||
1. 环境准备:`JDK 1.8 or 11、17`、`Maven 3.6+`、使用 `MySQL 5.7 or 8.0` 数据库、[其它数据库](https://jeesite.com/docs/technology/#_8、已支持数据库)
|
1. 环境准备:`JDK 1.8 or 11、17`、`Maven 3.6+`、使用 `MySQL 5.7 or 8.0` 数据库、[其它数据库](https://jeesite.com/docs/technology/#_8、已支持数据库)
|
||||||
2. 下载源码:<https://gitee.com/thinkgem/jeesite4/repository/archive/v4.5.zip> 并解压
|
2. 下载源码:<https://gitee.com/thinkgem/jeesite4/repository/archive/v4.6.zip> 并解压
|
||||||
3. 打开文件:`/web/src/main/resources/config/application.yml` 配置JDBC连接
|
3. 打开文件:`/web/src/main/resources/config/application.yml` 配置JDBC连接
|
||||||
4. 执行脚本:`/web/bin/init-data.bat` 初始化数据库
|
4. 执行脚本:`/web/bin/init-data.bat` 初始化数据库
|
||||||
5. 执行脚本:`/web/bin/run-tomcat.bat` 启动服务即可
|
5. 执行脚本:`/web/bin/run-tomcat.bat` 启动服务即可
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite-parent</artifactId>
|
<artifactId>jeesite-parent</artifactId>
|
||||||
<version>4.5.0-SNAPSHOT</version>
|
<version>4.6.1-SNAPSHOT</version>
|
||||||
<relativePath>../parent/pom.xml</relativePath>
|
<relativePath>../parent/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -1,172 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2005-2012 springside.org.cn
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
*/
|
|
||||||
package com.jeesite.common.mapper;
|
|
||||||
|
|
||||||
import java.io.StringReader;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.ConcurrentMap;
|
|
||||||
|
|
||||||
import javax.xml.bind.JAXBContext;
|
|
||||||
import javax.xml.bind.JAXBElement;
|
|
||||||
import javax.xml.bind.JAXBException;
|
|
||||||
import javax.xml.bind.Marshaller;
|
|
||||||
import javax.xml.bind.Unmarshaller;
|
|
||||||
import javax.xml.bind.annotation.XmlAnyElement;
|
|
||||||
import javax.xml.namespace.QName;
|
|
||||||
|
|
||||||
import com.jeesite.common.lang.ExceptionUtils;
|
|
||||||
import com.jeesite.common.lang.StringUtils;
|
|
||||||
import com.jeesite.common.reflect.ReflectUtils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用Jaxb2.0实现XML<->Java Object的Mapper.
|
|
||||||
*
|
|
||||||
* 在创建时需要设定所有需要序列化的Root对象的Class.
|
|
||||||
* 特别支持Root对象是Collection的情形.
|
|
||||||
*
|
|
||||||
* @author calvin
|
|
||||||
* @version 2013-01-15
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
public class JaxbMapper {
|
|
||||||
|
|
||||||
private static ConcurrentMap<Class, JAXBContext> jaxbContexts = new ConcurrentHashMap<Class, JAXBContext>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Java Object->Xml without encoding.
|
|
||||||
*/
|
|
||||||
public static String toXml(Object root) {
|
|
||||||
Class clazz = ReflectUtils.getUserClass(root);
|
|
||||||
return toXml(root, clazz, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Java Object->Xml with encoding.
|
|
||||||
*/
|
|
||||||
public static String toXml(Object root, String encoding) {
|
|
||||||
Class clazz = ReflectUtils.getUserClass(root);
|
|
||||||
return toXml(root, clazz, encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Java Object->Xml with encoding.
|
|
||||||
*/
|
|
||||||
public static String toXml(Object root, Class clazz, String encoding) {
|
|
||||||
try {
|
|
||||||
StringWriter writer = new StringWriter();
|
|
||||||
createMarshaller(clazz, encoding).marshal(root, writer);
|
|
||||||
return writer.toString();
|
|
||||||
} catch (JAXBException e) {
|
|
||||||
throw ExceptionUtils.unchecked(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Java Collection->Xml without encoding, 特别支持Root Element是Collection的情形.
|
|
||||||
*/
|
|
||||||
public static String toXml(Collection<?> root, String rootName, Class clazz) {
|
|
||||||
return toXml(root, rootName, clazz, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Java Collection->Xml with encoding, 特别支持Root Element是Collection的情形.
|
|
||||||
*/
|
|
||||||
public static String toXml(Collection<?> root, String rootName, Class clazz, String encoding) {
|
|
||||||
try {
|
|
||||||
CollectionWrapper wrapper = new CollectionWrapper();
|
|
||||||
wrapper.collection = root;
|
|
||||||
|
|
||||||
JAXBElement<CollectionWrapper> wrapperElement = new JAXBElement<CollectionWrapper>(new QName(rootName),
|
|
||||||
CollectionWrapper.class, wrapper);
|
|
||||||
|
|
||||||
StringWriter writer = new StringWriter();
|
|
||||||
createMarshaller(clazz, encoding).marshal(wrapperElement, writer);
|
|
||||||
|
|
||||||
return writer.toString();
|
|
||||||
} catch (JAXBException e) {
|
|
||||||
throw ExceptionUtils.unchecked(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Xml->Java Object.
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static <T> T fromXml(String xml, Class<T> clazz) {
|
|
||||||
try {
|
|
||||||
StringReader reader = new StringReader(xml);
|
|
||||||
return (T) createUnmarshaller(clazz).unmarshal(reader);
|
|
||||||
} catch (JAXBException e) {
|
|
||||||
throw ExceptionUtils.unchecked(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建Marshaller并设定encoding(可为null).
|
|
||||||
* 线程不安全,需要每次创建或pooling。
|
|
||||||
*/
|
|
||||||
public static Marshaller createMarshaller(Class clazz, String encoding) {
|
|
||||||
try {
|
|
||||||
JAXBContext jaxbContext = getJaxbContext(clazz);
|
|
||||||
|
|
||||||
Marshaller marshaller = jaxbContext.createMarshaller();
|
|
||||||
|
|
||||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(encoding)) {
|
|
||||||
marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
return marshaller;
|
|
||||||
} catch (JAXBException e) {
|
|
||||||
throw ExceptionUtils.unchecked(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建UnMarshaller.
|
|
||||||
* 线程不安全,需要每次创建或pooling。
|
|
||||||
*/
|
|
||||||
public static Unmarshaller createUnmarshaller(Class clazz) {
|
|
||||||
try {
|
|
||||||
JAXBContext jaxbContext = getJaxbContext(clazz);
|
|
||||||
return jaxbContext.createUnmarshaller();
|
|
||||||
} catch (JAXBException e) {
|
|
||||||
throw ExceptionUtils.unchecked(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static JAXBContext getJaxbContext(Class clazz) {
|
|
||||||
if (clazz == null){
|
|
||||||
throw new RuntimeException("'clazz' must not be null");
|
|
||||||
}
|
|
||||||
JAXBContext jaxbContext = jaxbContexts.get(clazz);
|
|
||||||
if (jaxbContext == null) {
|
|
||||||
try {
|
|
||||||
jaxbContext = JAXBContext.newInstance(clazz, CollectionWrapper.class);
|
|
||||||
jaxbContexts.putIfAbsent(clazz, jaxbContext);
|
|
||||||
} catch (JAXBException ex) {
|
|
||||||
// throw new HttpMessageConversionException("Could not instantiate JAXBContext for class [" + clazz
|
|
||||||
// + "]: " + ex.getMessage(), ex);
|
|
||||||
throw new RuntimeException("Could not instantiate JAXBContext for class [" + clazz
|
|
||||||
+ "]: " + ex.getMessage(), ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return jaxbContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 封装Root Element 是 Collection的情况.
|
|
||||||
*/
|
|
||||||
public static class CollectionWrapper {
|
|
||||||
|
|
||||||
@XmlAnyElement
|
|
||||||
protected Collection<?> collection;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite-parent</artifactId>
|
<artifactId>jeesite-parent</artifactId>
|
||||||
<version>4.5.0-SNAPSHOT</version>
|
<version>4.6.1-SNAPSHOT</version>
|
||||||
<relativePath>../../parent/pom.xml</relativePath>
|
<relativePath>../../parent/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -13,4 +13,6 @@
|
|||||||
4.3.3
|
4.3.3
|
||||||
4.4.0
|
4.4.0
|
||||||
4.4.1
|
4.4.1
|
||||||
4.5.0
|
4.5.0
|
||||||
|
4.6.0
|
||||||
|
4.6.1
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite-parent</artifactId>
|
<artifactId>jeesite-parent</artifactId>
|
||||||
<version>4.5.0-SNAPSHOT</version>
|
<version>4.6.1-SNAPSHOT</version>
|
||||||
<relativePath>../../parent/pom.xml</relativePath>
|
<relativePath>../../parent/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
<!-- MySQL -->
|
<!-- MySQL -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Oracle 11g -->
|
<!-- Oracle 11g -->
|
||||||
|
|||||||
@@ -55,7 +55,11 @@ public class EmpUtils {
|
|||||||
*/
|
*/
|
||||||
public static Employee get(User user){
|
public static Employee get(User user){
|
||||||
if (user != null && User.USER_TYPE_EMPLOYEE.equals(user.getUserType())){
|
if (user != null && User.USER_TYPE_EMPLOYEE.equals(user.getUserType())){
|
||||||
return user.getRefObj();
|
Employee employee = user.getRefObj();
|
||||||
|
if (employee == null) {
|
||||||
|
employee = Static.employeeService.get(user.getRefCode());
|
||||||
|
}
|
||||||
|
return employee;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ DIRECT_BYTE_OUTPUT = FALSE
|
|||||||
HTML_TAG_SUPPORT = true
|
HTML_TAG_SUPPORT = true
|
||||||
HTML_TAG_FLAG = #
|
HTML_TAG_FLAG = #
|
||||||
HTML_TAG_BINDING_ATTRIBUTE = var,export
|
HTML_TAG_BINDING_ATTRIBUTE = var,export
|
||||||
HTML_TAG_ATTR_CONVERT=org.beetl.core.text.DefaultAttributeNameConvert
|
HTML_TAG_ATTR_CONVERT=com.jeesite.common.beetl.text.BlankAttributeNameConvert
|
||||||
NATIVE_CALL = TRUE
|
NATIVE_CALL = TRUE
|
||||||
TEMPLATE_CHARSET = UTF-8
|
TEMPLATE_CHARSET = UTF-8
|
||||||
#ERROR_HANDLER = org.beetl.core.ConsoleErrorHandler
|
#ERROR_HANDLER = org.beetl.core.ConsoleErrorHandler
|
||||||
|
|||||||
@@ -659,7 +659,7 @@ file:
|
|||||||
# 设置允许上传的文件后缀(全局设置)
|
# 设置允许上传的文件后缀(全局设置)
|
||||||
imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
||||||
mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
||||||
fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||||
|
|
||||||
# 允许上传的文件内容类型(图片、word、excel、ppt)防止修改后缀恶意上传文件(默认不启用验证)
|
# 允许上传的文件内容类型(图片、word、excel、ppt)防止修改后缀恶意上传文件(默认不启用验证)
|
||||||
# allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,
|
# allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import com.jeesite.modules.bpm.entity.BpmTreeEntity;
|
|||||||
import com.jeesite.modules.bpm.entity.BpmEntity;
|
import com.jeesite.modules.bpm.entity.BpmEntity;
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||||
import com.jeesite.common.utils.excel.annotation.ExcelField;
|
import com.jeesite.common.utils.excel.annotation.ExcelField;
|
||||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
|
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
|
||||||
import com.jeesite.common.utils.excel.annotation.ExcelFields;
|
import com.jeesite.common.utils.excel.annotation.ExcelFields;
|
||||||
@@ -215,7 +215,7 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
|
|||||||
// 生成构造方法
|
// 生成构造方法
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||||
@ExcelFields({
|
@ExcelFields({
|
||||||
<% for(c in table.columnList){ if(c.optionMap['isImportExport'] == @Global.YES){ %>
|
<% for(c in table.columnList){ if(c.optionMap['isImportExport'] == @Global.YES){ %>
|
||||||
@ExcelField(title="${c.columnLabel}", attrName="${c.attrName}"${
|
@ExcelField(title="${c.columnLabel}", attrName="${c.attrName}"${
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ cd app
|
|||||||
jar -xvf web.war
|
jar -xvf web.war
|
||||||
rm web.war
|
rm web.war
|
||||||
cd WEB-INF
|
cd WEB-INF
|
||||||
exec ./startup.sh
|
sh ./startup.sh
|
||||||
]]>
|
]]>
|
||||||
</content>
|
</content>
|
||||||
</template>
|
</template>
|
||||||
@@ -70,7 +70,7 @@ spring:
|
|||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
group: jeesite-cloud-yml
|
group: jeesite-cloud-yml
|
||||||
ext-config:
|
extension-configs:
|
||||||
- data-id: application.yml
|
- data-id: application.yml
|
||||||
group: jeesite-cloud-yml
|
group: jeesite-cloud-yml
|
||||||
|
|
||||||
|
|||||||
@@ -4,34 +4,24 @@
|
|||||||
*/
|
*/
|
||||||
package com.jeesite.test;
|
package com.jeesite.test;
|
||||||
|
|
||||||
import java.util.Date;
|
import com.jeesite.common.collect.ListUtils;
|
||||||
import java.util.List;
|
import com.jeesite.common.entity.DataScope;
|
||||||
|
import com.jeesite.common.entity.Page;
|
||||||
|
import com.jeesite.common.idgen.IdGen;
|
||||||
|
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||||
|
import com.jeesite.common.tests.BaseSpringContextTests;
|
||||||
|
import com.jeesite.modules.file.dao.FileUploadDao;
|
||||||
|
import com.jeesite.modules.file.entity.FileUpload;
|
||||||
|
import com.jeesite.modules.sys.dao.*;
|
||||||
|
import com.jeesite.modules.sys.entity.*;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.test.context.ActiveProfiles;
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
|
|
||||||
import com.jeesite.common.collect.ListUtils;
|
import java.util.Date;
|
||||||
import com.jeesite.common.entity.DataScope;
|
import java.util.List;
|
||||||
import com.jeesite.common.entity.Page;
|
|
||||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
|
||||||
import com.jeesite.common.tests.BaseSpringContextTests;
|
|
||||||
import com.jeesite.modules.file.dao.FileUploadDao;
|
|
||||||
import com.jeesite.modules.file.entity.FileUpload;
|
|
||||||
import com.jeesite.modules.sys.dao.AreaDao;
|
|
||||||
import com.jeesite.modules.sys.dao.CompanyDao;
|
|
||||||
import com.jeesite.modules.sys.dao.ConfigDao;
|
|
||||||
import com.jeesite.modules.sys.dao.DictDataDao;
|
|
||||||
import com.jeesite.modules.sys.dao.EmpUserDao;
|
|
||||||
import com.jeesite.modules.sys.dao.UserDao;
|
|
||||||
import com.jeesite.modules.sys.entity.Area;
|
|
||||||
import com.jeesite.modules.sys.entity.Company;
|
|
||||||
import com.jeesite.modules.sys.entity.Config;
|
|
||||||
import com.jeesite.modules.sys.entity.DictData;
|
|
||||||
import com.jeesite.modules.sys.entity.EmpUser;
|
|
||||||
import com.jeesite.modules.sys.entity.User;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper测试
|
* Mapper测试
|
||||||
@@ -56,67 +46,110 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
|||||||
private FileUploadDao fileUploadDao;
|
private FileUploadDao fileUploadDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmpUserDao empUserDao;
|
private EmpUserDao empUserDao;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTableAnnotation() throws Exception{
|
public void testTableAnnotation() throws Exception{
|
||||||
try{
|
try{
|
||||||
|
|
||||||
System.out.println("============ 插入和批量插入测试 ============");
|
System.out.println("============ 插入测试 ============");
|
||||||
Config config = new Config();
|
Config config = new Config();
|
||||||
config.setId("1");
|
config.setId("1");
|
||||||
config.setConfigKey("test");
|
config.setConfigKey("test");
|
||||||
config.setConfigName("test");
|
config.setConfigName("test");
|
||||||
config.setConfigValue("1");
|
config.setConfigValue("1");
|
||||||
config.setIsSys("1");
|
config.setIsSys("1");
|
||||||
|
long configInsertNum = configDao.insert(config);
|
||||||
|
Assert.assertEquals("configDao.insert", configInsertNum , 1);
|
||||||
|
Config configInsertRes = configDao.get(config);
|
||||||
|
Assert.assertEquals("configDao.insert result", configInsertRes.getId() , "1");
|
||||||
|
|
||||||
|
System.out.println("============ 批量插入测试 ============");
|
||||||
Config config2 = (Config)config.clone();
|
Config config2 = (Config)config.clone();
|
||||||
config2.setId("2");
|
config2.setId("2");
|
||||||
config.setConfigKey("test2");
|
config2.setConfigKey("test2");
|
||||||
Config config3 = (Config)config.clone();
|
Config config3 = (Config)config.clone();
|
||||||
config3.setId("3");
|
config3.setId("3");
|
||||||
config.setConfigKey("test3");
|
config3.setConfigKey("test3");
|
||||||
System.out.println(configDao.insert(config));
|
long configinsertBatchNum = configDao.insertBatch(ListUtils.newArrayList(config2, config3));
|
||||||
System.out.println(configDao.insertBatch(ListUtils.newArrayList(config2, config3)));
|
Assert.assertEquals("configDao.insertBatch", configinsertBatchNum , 2);
|
||||||
|
Config configInsertBatchRes2 = configDao.get(config2);
|
||||||
System.out.println("============ 更新测试 ============");
|
Assert.assertEquals("configDao.insertBatch result", configInsertBatchRes2.getId() , "2");
|
||||||
|
Config configInsertBatchRes3 = configDao.get(config3);
|
||||||
|
Assert.assertEquals("configDao.insertBatch result", configInsertBatchRes3.getId() , "3");
|
||||||
|
|
||||||
|
System.out.println("============ 按主键更新测试 ============");
|
||||||
Area area = new Area();
|
Area area = new Area();
|
||||||
area.setAreaCode("1");
|
area.setAreaCode("1");
|
||||||
area.setAreaName("你好");
|
area.setAreaName("你好");
|
||||||
|
area.setParentCode("0");
|
||||||
|
area.setParentCodes("0,");
|
||||||
|
area.setTreeSort(1);
|
||||||
|
area.setTreeSorts("1,");
|
||||||
|
area.setTreeLevel(0);
|
||||||
|
area.setTreeLeaf("1");
|
||||||
|
area.setTreeNames(area.getAreaName());
|
||||||
area.setStatus("0");
|
area.setStatus("0");
|
||||||
|
Area area2 = (Area) area.clone();
|
||||||
|
area2.setAreaCode("2");
|
||||||
|
Area area3 = (Area) area.clone();
|
||||||
|
area3.setAreaCode("3");
|
||||||
|
long areaInsertNum = areaDao.insertBatch(ListUtils.newArrayList(area, area2, area3));
|
||||||
|
Assert.assertEquals("areaDao.insert", areaInsertNum , 3);
|
||||||
|
area.setAreaName("你好2");
|
||||||
|
long areaUpdateNum = areaDao.update(area);
|
||||||
|
Assert.assertEquals("areaDao.update", areaUpdateNum , 1);
|
||||||
|
Area areaUpdateRes = areaDao.get(area);
|
||||||
|
Assert.assertEquals("areaDao.update result", areaUpdateRes.getAreaName() , "你好2");
|
||||||
|
|
||||||
|
System.out.println("============ 按主键批量更新测试 ============");
|
||||||
|
long areaUpdateBatchNum = areaDao.updateBatch(ListUtils.newArrayList(area2, area3));
|
||||||
|
Assert.assertEquals("areaDao.update", areaUpdateBatchNum , 2);
|
||||||
|
|
||||||
|
System.out.println("============ 自定义更新条件测试 ============");
|
||||||
Area where = new Area();
|
Area where = new Area();
|
||||||
where.setId("2");
|
where.setId(areaUpdateRes.getId());
|
||||||
where.setId_in(new String[]{"1","2"});
|
where.setId_in(new String[]{areaUpdateRes.getId()});
|
||||||
where.setAreaName("你好2");
|
where.setAreaName(areaUpdateRes.getAreaName());
|
||||||
where.setStatus("0");
|
where.setStatus(areaUpdateRes.getStatus());
|
||||||
System.out.println(areaDao.update(area));
|
long areaUpdateByEntityNum = areaDao.updateByEntity(area, where);
|
||||||
System.out.println(areaDao.updateByEntity(area, where));
|
Assert.assertEquals("areaDao.updateByEntity", areaUpdateByEntityNum , 1);
|
||||||
System.out.println(areaDao.updateStatus(area));
|
|
||||||
System.out.println(areaDao.updateStatusByEntity(area, where));
|
System.out.println("============ 更新数据状态测试 ============");
|
||||||
|
long areaStatusNum = areaDao.updateStatus(area);
|
||||||
|
Assert.assertEquals("areaDao.updateStatus", areaUpdateByEntityNum , 1);
|
||||||
|
long areaStatusByEntityNum = areaDao.updateStatusByEntity(area, where);
|
||||||
|
Assert.assertEquals("areaDao.updateStatusByEntity", areaUpdateByEntityNum , 1);
|
||||||
|
|
||||||
System.out.println("============ 逻辑删除测试 ============");
|
System.out.println("============ 逻辑删除测试 ============");
|
||||||
System.out.println(areaDao.delete(area));
|
long areaDeleteNum = areaDao.delete(area);
|
||||||
System.out.println(areaDao.delete((Area)where.clone()));
|
Assert.assertEquals("areaDao.delete", areaDeleteNum , 1);
|
||||||
System.out.println(areaDao.deleteByEntity((Area)where.clone()));
|
where.setStatus("1");
|
||||||
|
long areaDeleteByEntityNum = areaDao.deleteByEntity(where);
|
||||||
|
Assert.assertEquals("areaDao.deleteByEntity", areaDeleteByEntityNum , 1);
|
||||||
|
|
||||||
System.out.println("============ 物理删除测试 ============");
|
System.out.println("============ 物理删除测试 ============");
|
||||||
System.out.println(areaDao.phyDelete((Area)where.clone()));
|
long areaPhyDeleteNum = areaDao.phyDelete(area2);
|
||||||
System.out.println(areaDao.phyDeleteByEntity((Area)where.clone()));
|
Assert.assertEquals("areaDao.phyDelete", areaPhyDeleteNum , 1);
|
||||||
|
long areaPhyDeleteByEntityNum = areaDao.phyDeleteByEntity(area3);
|
||||||
|
Assert.assertEquals("areaDao.phyDeleteByEntity", areaPhyDeleteByEntityNum , 1);
|
||||||
|
|
||||||
System.out.println("============ 基本信息查询测试 ============");
|
System.out.println("============ 基本查询测试 ============");
|
||||||
System.out.println(areaDao.findList(area));
|
List<Area> areaList = areaDao.findList(area);
|
||||||
|
Assert.assertEquals("areaDao.findList", areaList.size() , 1);
|
||||||
User user = new User();
|
User user = new User();
|
||||||
user.setUserType(User.USER_TYPE_NONE);
|
user.setUserType(User.USER_TYPE_NONE);
|
||||||
System.out.println(userDao.findList(user));
|
List<User> userList = userDao.findList(user);
|
||||||
|
Assert.assertTrue("userDao.findList", userList.size() > 0);
|
||||||
|
|
||||||
System.out.println("============ 条件嵌套,日期范围,自定义sqlMap测试 ============");
|
System.out.println("============ 条件嵌套,日期范围,自定义sqlMap测试 ============");
|
||||||
Company company = new Company("1");
|
Company company = new Company("1");
|
||||||
company.setCompanyName("a");
|
company.setCompanyName("a");
|
||||||
company.setCreateDate_gte(new Date());
|
company.setCreateDate_gte(new Date());
|
||||||
company.setCreateDate_lte(new Date());
|
company.setCreateDate_lte(new Date());
|
||||||
company.setArea(new Area("2"));
|
company.setArea(areaList.get(0));
|
||||||
company.getArea().setAreaName("a");
|
company.getArea().setCreateDate_gte(company.getCreateDate_gte());
|
||||||
company.getArea().setCreateDate_gte(new Date());
|
company.getArea().setCreateDate_lte(company.getCreateDate_gte());
|
||||||
company.getArea().setCreateDate_lte(new Date());
|
company.setFullName(IdGen.nextId());
|
||||||
company.setFullName("a");
|
|
||||||
company.setViewCode("1");
|
company.setViewCode("1");
|
||||||
company.setParentCode("0");
|
company.setParentCode("0");
|
||||||
company.setParentCodes("0,");
|
company.setParentCodes("0,");
|
||||||
@@ -124,47 +157,73 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
|||||||
company.setTreeSorts("1,");
|
company.setTreeSorts("1,");
|
||||||
company.setTreeLevel(0);
|
company.setTreeLevel(0);
|
||||||
company.setTreeLeaf("1");
|
company.setTreeLeaf("1");
|
||||||
company.setTreeNames("a");
|
company.setTreeNames(company.getCompanyName());
|
||||||
System.out.println(companyDao.insert(company));
|
Company company2 = (Company) company.clone();
|
||||||
System.out.println(companyDao.get(company));
|
company2.setParentCode(company.getCompanyCode());
|
||||||
System.out.println(companyDao.findCount(company));
|
company2.setParentCodes("0,1," + company.getCompanyCode());
|
||||||
|
company2.setCompanyCode("12");
|
||||||
|
Company company3 = (Company) company.clone();
|
||||||
|
company3.setParentCode(company.getCompanyCode());
|
||||||
|
company3.setParentCodes("0,1," + company.getCompanyCode());
|
||||||
|
company3.setCompanyCode("13");
|
||||||
|
company3.setCompanyName("b");
|
||||||
|
long companyInsertNum = companyDao.insertBatch(ListUtils.newArrayList(company, company2, company3));
|
||||||
|
Assert.assertEquals("advanced query init", companyInsertNum , 3);
|
||||||
|
Company companyWhere = (Company) company.clone();
|
||||||
|
companyWhere.setCompanyCode(null);
|
||||||
|
companyWhere.setParentCode(null);
|
||||||
|
long companyFindCount = companyDao.findCount(companyWhere);
|
||||||
|
Assert.assertEquals("advanced query list", companyFindCount , 2);
|
||||||
|
|
||||||
System.out.println("============ 分页测试,查询子节点 ============");
|
System.out.println("============ 分页测试,查询子节点 ============");
|
||||||
company.setPage(new Page<Company>(1, 20));
|
Company company4 = new Company("1");
|
||||||
company.setIsQueryChildren(true);
|
company4.setFullName(company.getFullName());
|
||||||
System.out.println(companyDao.findList(company));
|
company4.setPage(new Page<Company>(1, 2));
|
||||||
|
company4.setIsQueryChildren(true);
|
||||||
|
List<Company> companyListPage = companyDao.findList(company4);
|
||||||
|
Assert.assertEquals("find page list size", companyListPage.size(), 2);
|
||||||
|
Assert.assertEquals("find page list get(1)", companyListPage.get(1).getCompanyCode(), company2.getCompanyCode());
|
||||||
|
Assert.assertEquals("find page count", company4.getPage().getCount(), 3);
|
||||||
|
|
||||||
System.out.println("============ 扩展条件语句前带AND容错测试 ============");
|
System.out.println("============ 扩展条件语句前带AND容错测试 ============");
|
||||||
Company company2 = new Company();
|
Company company5 = new Company();
|
||||||
company2.getSqlMap().getWhere().disableAutoAddStatusWhere();
|
company5.getSqlMap().getWhere().disableAutoAddStatusWhere();
|
||||||
company2.getSqlMap().getDataScope().addFilter("dsf",
|
company5.getSqlMap().getDataScope().addFilter("dsf",
|
||||||
"Company", "a.`company_code`", DataScope.CTRL_PERMI_HAVE);
|
"Company", "a.`company_code`", DataScope.CTRL_PERMI_HAVE);
|
||||||
System.out.println(companyDao.findList(company2));
|
List<Company> companyList = companyDao.findList(company5);
|
||||||
|
System.out.println(companyList);
|
||||||
|
Assert.assertEquals("companyDao.findList extWhere", companyList.size(), 0);
|
||||||
|
|
||||||
System.out.println("============ 联合查询未设定columns和attrName为this时测试 ============");
|
System.out.println("============ 联合查询未设定columns和attrName为this时测试 ============");
|
||||||
FileUpload fileUpload = new FileUpload();
|
FileUpload fileUpload = new FileUpload();
|
||||||
fileUpload.getSqlMap().getWhere().and("u.`user_name`", QueryType.EQ, "user1");
|
fileUpload.getSqlMap().getWhere().and("u.`user_name`", QueryType.EQ, "user1");
|
||||||
System.out.println(fileUploadDao.findList(fileUpload));
|
List<FileUpload> fileUploadList = fileUploadDao.findList(fileUpload);
|
||||||
|
System.out.println(fileUploadList);
|
||||||
|
Assert.assertEquals("fileUploadDao.findList attrName this", fileUploadList.size(), 0);
|
||||||
|
|
||||||
System.out.println("============ 树结构基本查询测试 ============");
|
System.out.println("============ 树结构基本查询测试 ============");
|
||||||
DictData dictData = new DictData();
|
DictData dictData = new DictData();
|
||||||
dictData.setParentCodes("0,");
|
dictData.setParentCodes("0,");
|
||||||
System.out.println(dictDataDao.findByParentCodesLike(dictData));
|
List<DictData> dictDataList = dictDataDao.findByParentCodesLike(dictData);
|
||||||
System.out.println(dictDataDao.findList(dictData));
|
Assert.assertTrue("dictDataDao.findByParentCodesLike", dictDataList.size() > 0);
|
||||||
|
List<DictData> dictDataList2 = dictDataDao.findList(dictData);
|
||||||
|
System.out.println(dictDataList2);
|
||||||
|
Assert.assertTrue("dictDataDao.findList", dictDataList2.size() > 0);
|
||||||
|
|
||||||
System.out.println("============ 分页情况下foreach测试 ============");
|
System.out.println("============ 分页情况下foreach测试 ============");
|
||||||
EmpUser empUser = new EmpUser();
|
EmpUser empUser = new EmpUser();
|
||||||
empUser.setCodes(new String[]{"SDJN01","SDJN02"});
|
empUser.setCodes(new String[]{"SDJN01","SDJN02"});
|
||||||
empUser.setPage(new Page<>(1, 3));
|
empUser.setPage(new Page<>(1, 3));
|
||||||
List<EmpUser> list = empUserDao.findUserListByOfficeCodes(empUser);
|
List<EmpUser> empUserList = empUserDao.findUserListByOfficeCodes(empUser);
|
||||||
System.out.println(list);
|
System.out.println(empUserList);
|
||||||
|
Assert.assertTrue("empUserDao.findUserListByOfficeCodes", empUserList.size() > 0);
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception(e);
|
throw new Exception(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String a = null, b = null;
|
String a = null, b = null;
|
||||||
System.out.println("============ 基本测试 ============");
|
System.out.println("============ 基本测试 ============");
|
||||||
@@ -172,25 +231,25 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
|||||||
.getWhere().and("name", QueryType.EQ, "abc").toSql();
|
.getWhere().and("name", QueryType.EQ, "abc").toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name = #{sqlMap.where.name#EQ1.val}";
|
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name = #{sqlMap.where.name#EQ1.val}";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.and("name", QueryType.IN, new String[]{"1", "2", "3"}).toSql();
|
.and("name", QueryType.IN, new String[]{"1", "2", "3"}).toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name IN ( #{sqlMap.where.name#IN1.val[0]},"
|
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name IN ( #{sqlMap.where.name#IN1.val[0]},"
|
||||||
+ " #{sqlMap.where.name#IN1.val[1]}, #{sqlMap.where.name#IN1.val[2]} )";
|
+ " #{sqlMap.where.name#IN1.val[1]}, #{sqlMap.where.name#IN1.val[2]} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.or("name", QueryType.IN, new String[]{"1", "2", "3"}).toSql();
|
.or("name", QueryType.IN, new String[]{"1", "2", "3"}).toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} OR a.name IN ( #{sqlMap.where.name#IN1.val[0]},"
|
b = "a.`id` = #{sqlMap.where#id#EQ1} OR a.name IN ( #{sqlMap.where.name#IN1.val[0]},"
|
||||||
+ " #{sqlMap.where.name#IN1.val[1]}, #{sqlMap.where.name#IN1.val[2]} )";
|
+ " #{sqlMap.where.name#IN1.val[1]}, #{sqlMap.where.name#IN1.val[2]} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.out.println("============ 重复赋值测试 ============");
|
System.out.println("============ 重复赋值测试 ============");
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.and("name", QueryType.LIKE, "abc").and("name", QueryType.LIKE, "def").toSql();
|
.and("name", QueryType.LIKE, "abc").and("name", QueryType.LIKE, "def").toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name LIKE #{sqlMap.where.name#LIKE1.val}";
|
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name LIKE #{sqlMap.where.name#LIKE1.val}";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.out.println("============ IN、NOT IN 测试 ============");
|
System.out.println("============ IN、NOT IN 测试 ============");
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.and("name", QueryType.IN, new String[]{"abc","def"})
|
.and("name", QueryType.IN, new String[]{"abc","def"})
|
||||||
@@ -198,21 +257,21 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
|||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name IN ( #{sqlMap.where.name#IN1.val[0]}, #{sqlMap.where.name#IN1.val[1]} )"
|
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name IN ( #{sqlMap.where.name#IN1.val[0]}, #{sqlMap.where.name#IN1.val[1]} )"
|
||||||
+ " AND a.name2 NOT IN ( #{sqlMap.where.name2#NOT_IN1.val[0]}, #{sqlMap.where.name2#NOT_IN1.val[1]} )";
|
+ " AND a.name2 NOT IN ( #{sqlMap.where.name2#NOT_IN1.val[0]}, #{sqlMap.where.name2#NOT_IN1.val[1]} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.and("name", QueryType.IN, null).and("name2", QueryType.IN, new String[]{})
|
.and("name", QueryType.IN, null).and("name2", QueryType.IN, new String[]{})
|
||||||
.and("name3", QueryType.NOT_IN, ListUtils.newArrayList()).toSql();
|
.and("name3", QueryType.NOT_IN, ListUtils.newArrayList()).toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1}";
|
b = "a.`id` = #{sqlMap.where#id#EQ1}";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.out.println("============ 带括号测试 ============");
|
System.out.println("============ 带括号测试 ============");
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.andBracket("name", QueryType.EQ, "abc", 1).or("name", QueryType.EQ, "def", 2)
|
.andBracket("name", QueryType.EQ, "abc", 1).or("name", QueryType.EQ, "def", 2)
|
||||||
.or("name", QueryType.EQ, "ghi", 3).endBracket().toSql();
|
.or("name", QueryType.EQ, "ghi", 3).endBracket().toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ1.val}"
|
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ1.val}"
|
||||||
+ " OR a.name = #{sqlMap.where.name#EQ2.val} OR a.name = #{sqlMap.where.name#EQ3.val} )";
|
+ " OR a.name = #{sqlMap.where.name#EQ2.val} OR a.name = #{sqlMap.where.name#EQ3.val} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
a = new Config().getSqlMap().getWhere()
|
a = new Config().getSqlMap().getWhere()
|
||||||
.andBracket("name", QueryType.EQ, "val1", 1).and("name", QueryType.NE, "val2", 11).endBracket(1)
|
.andBracket("name", QueryType.EQ, "val1", 1).and("name", QueryType.NE, "val2", 11).endBracket(1)
|
||||||
.orBracket("name", QueryType.NE, "val3", 2).and("name", QueryType.NE, "val4", 22).endBracket(2)
|
.orBracket("name", QueryType.NE, "val3", 2).and("name", QueryType.NE, "val4", 22).endBracket(2)
|
||||||
@@ -222,41 +281,41 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
|||||||
+ " OR ( a.name != #{sqlMap.where.name#NE2.val} AND a.name != #{sqlMap.where.name#NE22.val} )"
|
+ " OR ( a.name != #{sqlMap.where.name#NE2.val} AND a.name != #{sqlMap.where.name#NE22.val} )"
|
||||||
+ " OR ( a.name != #{sqlMap.where.name#NE3.val} AND a.name = #{sqlMap.where.name#EQ33.val} )";
|
+ " OR ( a.name != #{sqlMap.where.name#NE3.val} AND a.name = #{sqlMap.where.name#EQ33.val} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.out.println("============ 带括号部分空值测试 ============");
|
System.out.println("============ 带括号部分空值测试 ============");
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "def", 2)
|
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "def", 2)
|
||||||
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ2.val} )";
|
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ2.val} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.andBracket("name", QueryType.EQ, "abc", 1).or("name", QueryType.EQ, "def", 2)
|
.andBracket("name", QueryType.EQ, "abc", 1).or("name", QueryType.EQ, "def", 2)
|
||||||
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ1.val}"
|
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ1.val}"
|
||||||
+ " OR a.name = #{sqlMap.where.name#EQ2.val} )";
|
+ " OR a.name = #{sqlMap.where.name#EQ2.val} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "def", 2)
|
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "def", 2)
|
||||||
.or("name", QueryType.EQ, "ghi", 3).endBracket().toSql();
|
.or("name", QueryType.EQ, "ghi", 3).endBracket().toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ2.val}"
|
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ2.val}"
|
||||||
+ " OR a.name = #{sqlMap.where.name#EQ3.val} )";
|
+ " OR a.name = #{sqlMap.where.name#EQ3.val} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.out.println("============ 带括号全部空值测试 ============");
|
System.out.println("============ 带括号全部空值测试 ============");
|
||||||
a = new Config("1").getSqlMap().getWhere()
|
a = new Config("1").getSqlMap().getWhere()
|
||||||
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "", 2)
|
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "", 2)
|
||||||
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
||||||
b = "a.`id` = #{sqlMap.where#id#EQ1} ";
|
b = "a.`id` = #{sqlMap.where#id#EQ1} ";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
a = new Config().getSqlMap().getWhere()
|
a = new Config().getSqlMap().getWhere()
|
||||||
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "", 2)
|
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "", 2)
|
||||||
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
||||||
b = "";
|
b = "";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.out.println("============ 实体嵌套测试 ============");
|
System.out.println("============ 实体嵌套测试 ============");
|
||||||
Company company = new Company("1");
|
Company company = new Company("1");
|
||||||
company.setCreateDate_gte(new Date());
|
company.setCreateDate_gte(new Date());
|
||||||
@@ -280,7 +339,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
|||||||
a = new FileUpload().getSqlMap().getWhere().and("u.`user_name`", QueryType.EQ, "user1").toSql();
|
a = new FileUpload().getSqlMap().getWhere().and("u.`user_name`", QueryType.EQ, "user1").toSql();
|
||||||
b = "a.`status` != #{STATUS_DELETE} AND u.`user_name` = #{sqlMap.where.u#_user_name_#EQ1.val}";
|
b = "a.`status` != #{STATUS_DELETE} AND u.`user_name` = #{sqlMap.where.u#_user_name_#EQ1.val}";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.out.println("============ 联合查询,返回到当前实体测试 ============");
|
System.out.println("============ 联合查询,返回到当前实体测试 ============");
|
||||||
FileUpload fileUpload = new FileUpload();
|
FileUpload fileUpload = new FileUpload();
|
||||||
fileUpload.getSqlMap().getWhere().and("create_by", QueryType.IN, new String[]{"user1","user2"});
|
fileUpload.getSqlMap().getWhere().and("create_by", QueryType.IN, new String[]{"user1","user2"});
|
||||||
@@ -288,7 +347,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
|||||||
b = "a.`status` != #{STATUS_DELETE} AND a.create_by IN ( #{sqlMap.where.create_by#IN1.val[0]},"
|
b = "a.`status` != #{STATUS_DELETE} AND a.create_by IN ( #{sqlMap.where.create_by#IN1.val[0]},"
|
||||||
+ " #{sqlMap.where.create_by#IN1.val[1]} )";
|
+ " #{sqlMap.where.create_by#IN1.val[1]} )";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.out.println("============ 联合查询,属性为this时也可作为查询条件 ============");
|
System.out.println("============ 联合查询,属性为this时也可作为查询条件 ============");
|
||||||
FileUpload fileUpload2 = new FileUpload();
|
FileUpload fileUpload2 = new FileUpload();
|
||||||
fileUpload2.setCreateByName("ThinkGem/JeeSite");
|
fileUpload2.setCreateByName("ThinkGem/JeeSite");
|
||||||
@@ -297,7 +356,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
|||||||
b = "a.`status` != #{STATUS_DELETE} AND a.create_by IN ( #{sqlMap.where.create_by#IN1.val[0]},"
|
b = "a.`status` != #{STATUS_DELETE} AND a.create_by IN ( #{sqlMap.where.create_by#IN1.val[0]},"
|
||||||
+ " #{sqlMap.where.create_by#IN1.val[1]} ) AND u.`user_name` LIKE #{sqlMap.where#user_name#LIKE1}";
|
+ " #{sqlMap.where.create_by#IN1.val[1]} ) AND u.`user_name` LIKE #{sqlMap.where#user_name#LIKE1}";
|
||||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||||
|
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ productName: JeeSite Demo
|
|||||||
companyName: ThinkGem
|
companyName: ThinkGem
|
||||||
|
|
||||||
# 产品版本、版权年份
|
# 产品版本、版权年份
|
||||||
productVersion: V4.5
|
productVersion: V4.6
|
||||||
copyrightYear: 2022
|
copyrightYear: 2023
|
||||||
|
|
||||||
# 数据库连接
|
# 数据库连接
|
||||||
jdbc:
|
jdbc:
|
||||||
|
|||||||
@@ -3,9 +3,16 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.7.8</version>
|
||||||
|
<relativePath />
|
||||||
|
</parent>
|
||||||
|
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite-parent</artifactId>
|
<artifactId>jeesite-parent</artifactId>
|
||||||
<version>4.5.0-SNAPSHOT</version>
|
<version>4.6.1-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>JeeSite Parent</name>
|
<name>JeeSite Parent</name>
|
||||||
@@ -16,11 +23,11 @@
|
|||||||
|
|
||||||
<!-- common version setting -->
|
<!-- common version setting -->
|
||||||
<commons-io.version>2.11.0</commons-io.version>
|
<commons-io.version>2.11.0</commons-io.version>
|
||||||
<commons-text.version>1.9</commons-text.version>
|
<commons-text.version>1.10.0</commons-text.version>
|
||||||
<commons-beanutils.version>1.9.4</commons-beanutils.version>
|
<commons-beanutils.version>1.9.4</commons-beanutils.version>
|
||||||
<commons-email.version>1.5</commons-email.version>
|
<commons-email.version>1.5</commons-email.version>
|
||||||
<fst.version>2.57</fst.version>
|
<fst.version>2.57</fst.version>
|
||||||
<fastjson.version>1.2.83</fastjson.version>
|
<fastjson.version>1.2.83_noneautotype</fastjson.version>
|
||||||
<!-- <jackson.version>2.12.6</jackson.version> -->
|
<!-- <jackson.version>2.12.6</jackson.version> -->
|
||||||
<!-- <activation.version>1.1.1</activation.version> -->
|
<!-- <activation.version>1.1.1</activation.version> -->
|
||||||
<UserAgentUtils.version>1.21</UserAgentUtils.version>
|
<UserAgentUtils.version>1.21</UserAgentUtils.version>
|
||||||
@@ -35,19 +42,17 @@
|
|||||||
<groovy.version>3.0.10</groovy.version>
|
<groovy.version>3.0.10</groovy.version>
|
||||||
|
|
||||||
<!-- framework version setting -->
|
<!-- framework version setting -->
|
||||||
<spring-boot.version>2.6.10</spring-boot.version>
|
<mybatis.version>3.5.11</mybatis.version>
|
||||||
<mybatis.version>3.5.9</mybatis.version>
|
|
||||||
<mybatis-spring.version>2.0.7</mybatis-spring.version>
|
<mybatis-spring.version>2.0.7</mybatis-spring.version>
|
||||||
<jsqlparser.version>4.4</jsqlparser.version>
|
<jsqlparser.version>4.5</jsqlparser.version>
|
||||||
<druid.version>1.2.10</druid.version>
|
<druid.version>1.2.11</druid.version>
|
||||||
<shiro.version>1.9.1</shiro.version>
|
<shiro.version>1.11.0</shiro.version>
|
||||||
<j2cache.version>2.8.0-release</j2cache.version>
|
<j2cache.version>2.8.0-release</j2cache.version>
|
||||||
<swagger.version>1.6.0</swagger.version>
|
<swagger.version>1.6.6</swagger.version>
|
||||||
<log4j2.version>2.17.0</log4j2.version>
|
<log4j2.version>2.18.0</log4j2.version>
|
||||||
|
|
||||||
<!-- jdbc setting -->
|
<!-- jdbc setting -->
|
||||||
<!-- <mysql.version>5.1.49</mysql.version> -->
|
<h2.version>1.4.200</h2.version>
|
||||||
<mysql.version>8.0.29</mysql.version>
|
|
||||||
|
|
||||||
<!-- environment setting -->
|
<!-- environment setting -->
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
@@ -56,7 +61,7 @@
|
|||||||
<resource.delimiter>@</resource.delimiter>
|
<resource.delimiter>@</resource.delimiter>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version><!-- 降级到该版本,新版本可能会出现VM崩溃 -->
|
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version><!-- 其它版本可能会出现VM崩溃 -->
|
||||||
<eclipse-plugin-download-sources>false</eclipse-plugin-download-sources>
|
<eclipse-plugin-download-sources>false</eclipse-plugin-download-sources>
|
||||||
<eclipse-plugin-download-javadocs>false</eclipse-plugin-download-javadocs>
|
<eclipse-plugin-download-javadocs>false</eclipse-plugin-download-javadocs>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
@@ -69,18 +74,6 @@
|
|||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-dependencies</artifactId>
|
|
||||||
<version>${spring-boot.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
@@ -199,7 +192,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>${spring-boot.version}</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>repackage</id>
|
<id>repackage</id>
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite</artifactId>
|
<artifactId>jeesite</artifactId>
|
||||||
<version>4.5.0-SNAPSHOT</version>
|
<version>4.6.1-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>JeeSite</name>
|
<name>JeeSite</name>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite-root</artifactId>
|
<artifactId>jeesite-root</artifactId>
|
||||||
<version>4.5.0-SNAPSHOT</version>
|
<version>4.6.1-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>JeeSite Root</name>
|
<name>JeeSite Root</name>
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ ENTRYPOINT jar -xvf app.war && rm app.war && cd WEB-INF && sh startup.sh
|
|||||||
|
|
||||||
EXPOSE 8980
|
EXPOSE 8980
|
||||||
|
|
||||||
#docker run -p 8980:8980 thinkgem/jeesite-web:4.4
|
#docker run -p 8980:8980 thinkgem/jeesite-web:4.6
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ cd app
|
|||||||
jar -xvf web.war
|
jar -xvf web.war
|
||||||
rm web.war
|
rm web.war
|
||||||
cd WEB-INF
|
cd WEB-INF
|
||||||
exec ./startup.sh
|
sh ./startup.sh
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ set global read_only=0;
|
|||||||
|
|
||||||
create user 'jeesite'@'%' identified by 'jeesite';
|
create user 'jeesite'@'%' identified by 'jeesite';
|
||||||
|
|
||||||
create database jeesite DEFAULT CHARSET 'utf8' COLLATE 'utf8_general_ci';
|
create database jeesite DEFAULT CHARSET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
|
||||||
|
|
||||||
grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite';
|
grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite';
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.jeesite</groupId>
|
<groupId>com.jeesite</groupId>
|
||||||
<artifactId>jeesite-parent</artifactId>
|
<artifactId>jeesite-parent</artifactId>
|
||||||
<version>4.5.0-SNAPSHOT</version>
|
<version>4.6.1-SNAPSHOT</version>
|
||||||
<relativePath>../parent/pom.xml</relativePath>
|
<relativePath>../parent/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ productName: JeeSite Demo
|
|||||||
companyName: ThinkGem
|
companyName: ThinkGem
|
||||||
|
|
||||||
# 产品版本、版权年份
|
# 产品版本、版权年份
|
||||||
productVersion: V4.5
|
productVersion: V4.6
|
||||||
copyrightYear: 2022
|
copyrightYear: 2023
|
||||||
|
|
||||||
# 是否演示模式
|
# 是否演示模式
|
||||||
demoMode: false
|
demoMode: false
|
||||||
@@ -24,7 +24,7 @@ server:
|
|||||||
servlet:
|
servlet:
|
||||||
context-path: /js
|
context-path: /js
|
||||||
register-default-servlet: false
|
register-default-servlet: false
|
||||||
encoding.enabled: true
|
#encoding.enabled: true
|
||||||
tomcat:
|
tomcat:
|
||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
# 表单请求数据的最大大小
|
# 表单请求数据的最大大小
|
||||||
@@ -818,7 +818,7 @@ file:
|
|||||||
# # 设置允许上传的文件后缀(全局设置)
|
# # 设置允许上传的文件后缀(全局设置)
|
||||||
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
||||||
# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
||||||
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||||
#
|
#
|
||||||
# # 允许上传的文件内容类型(图片、word、excel、ppt)防止修改后缀恶意上传文件(默认不启用验证)
|
# # 允许上传的文件内容类型(图片、word、excel、ppt)防止修改后缀恶意上传文件(默认不启用验证)
|
||||||
# #allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,
|
# #allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,
|
||||||
|
|||||||
Reference in New Issue
Block a user