mirror of https://github.com/elunez/eladmin
Merge branch 'master' into deploy
commit
92d38e51df
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>eladmin</artifactId>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
|
|
|
@ -15,9 +15,7 @@
|
|||
*/
|
||||
package me.zhengjie.exception.handler;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
|
@ -27,12 +25,11 @@ import java.time.LocalDateTime;
|
|||
class ApiError {
|
||||
|
||||
private Integer status = 400;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timestamp;
|
||||
private Long timestamp;
|
||||
private String message;
|
||||
|
||||
private ApiError() {
|
||||
timestamp = LocalDateTime.now();
|
||||
timestamp = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public static ApiError error(String message){
|
||||
|
|
|
@ -53,6 +53,7 @@ public class QueryHelp {
|
|||
}
|
||||
}
|
||||
try {
|
||||
Map<String, Join> joinKey = new HashMap<>();
|
||||
List<Field> fields = getAllFields(query.getClass(), new ArrayList<>());
|
||||
for (Field field : fields) {
|
||||
boolean accessible = field.isAccessible();
|
||||
|
@ -75,40 +76,43 @@ public class QueryHelp {
|
|||
String[] blurrys = blurry.split(",");
|
||||
List<Predicate> orPredicate = new ArrayList<>();
|
||||
for (String s : blurrys) {
|
||||
orPredicate.add(cb.like(root.get(s)
|
||||
.as(String.class), "%" + val.toString() + "%"));
|
||||
orPredicate.add(cb.like(root.get(s).as(String.class), "%" + val.toString() + "%"));
|
||||
}
|
||||
Predicate[] p = new Predicate[orPredicate.size()];
|
||||
list.add(cb.or(orPredicate.toArray(p)));
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(joinName)) {
|
||||
String[] joinNames = joinName.split(">");
|
||||
for (String name : joinNames) {
|
||||
switch (q.join()) {
|
||||
case LEFT:
|
||||
if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
|
||||
join = join.join(name, JoinType.LEFT);
|
||||
} else {
|
||||
join = root.join(name, JoinType.LEFT);
|
||||
}
|
||||
break;
|
||||
case RIGHT:
|
||||
if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
|
||||
join = join.join(name, JoinType.RIGHT);
|
||||
} else {
|
||||
join = root.join(name, JoinType.RIGHT);
|
||||
}
|
||||
break;
|
||||
case INNER:
|
||||
if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
|
||||
join = join.join(name, JoinType.INNER);
|
||||
} else {
|
||||
join = root.join(name, JoinType.INNER);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
join = joinKey.get(joinName);
|
||||
if(join == null){
|
||||
String[] joinNames = joinName.split(">");
|
||||
for (String name : joinNames) {
|
||||
switch (q.join()) {
|
||||
case LEFT:
|
||||
if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
|
||||
join = join.join(name, JoinType.LEFT);
|
||||
} else {
|
||||
join = root.join(name, JoinType.LEFT);
|
||||
}
|
||||
break;
|
||||
case RIGHT:
|
||||
if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
|
||||
join = join.join(name, JoinType.RIGHT);
|
||||
} else {
|
||||
join = root.join(name, JoinType.RIGHT);
|
||||
}
|
||||
break;
|
||||
case INNER:
|
||||
if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
|
||||
join = join.join(name, JoinType.INNER);
|
||||
} else {
|
||||
join = root.join(name, JoinType.INNER);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
joinKey.put(joinName, join);
|
||||
}
|
||||
}
|
||||
switch (q.type()) {
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
*/
|
||||
package me.zhengjie.utils;
|
||||
|
||||
import cn.hutool.http.useragent.UserAgent;
|
||||
import cn.hutool.http.useragent.UserAgentUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dreamlu.mica.ip2region.core.Ip2regionSearcher;
|
||||
import net.dreamlu.mica.ip2region.core.IpInfo;
|
||||
import nl.basjes.parse.useragent.UserAgent;
|
||||
import nl.basjes.parse.useragent.UserAgentAnalyzer;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
|
@ -43,14 +43,6 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||
*/
|
||||
private final static Ip2regionSearcher IP_SEARCHER = SpringContextHolder.getBean(Ip2regionSearcher.class);
|
||||
|
||||
|
||||
private static final UserAgentAnalyzer USER_AGENT_ANALYZER = UserAgentAnalyzer
|
||||
.newBuilder()
|
||||
.hideMatcherLoadStats()
|
||||
.withCache(10000)
|
||||
.withField(UserAgent.AGENT_NAME_VERSION)
|
||||
.build();
|
||||
|
||||
/**
|
||||
* 驼峰命名法工具
|
||||
*
|
||||
|
@ -178,8 +170,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||
}
|
||||
|
||||
public static String getBrowser(HttpServletRequest request) {
|
||||
UserAgent.ImmutableUserAgent userAgent = USER_AGENT_ANALYZER.parse(request.getHeader("User-Agent"));
|
||||
return userAgent.get(UserAgent.AGENT_NAME_VERSION).getValue();
|
||||
UserAgent ua = UserAgentUtil.parse(request.getHeader("User-Agent"));
|
||||
return ua.getBrowser().toString() + " " + ua.getVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>eladmin</artifactId>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
<dependency>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<artifactId>eladmin-common</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</dependency>
|
||||
|
||||
<!--模板引擎-->
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>eladmin</artifactId>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
|||
<dependency>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<artifactId>eladmin-common</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>eladmin</artifactId>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
|||
<dependency>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<artifactId>eladmin-generator</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<dependency>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<artifactId>eladmin-tools</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring boot websocket -->
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
*/
|
||||
package me.zhengjie.modules.system.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
@ -26,7 +25,6 @@ import java.util.List;
|
|||
* @date 2018-12-20
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
public class MenuVo implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
*/
|
||||
package me.zhengjie.modules.system.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.zhengjie.base.BaseDTO;
|
||||
|
@ -39,7 +38,6 @@ public class DeptDto extends BaseDTO implements Serializable {
|
|||
|
||||
private Integer deptSort;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<DeptDto> children;
|
||||
|
||||
private Long pid;
|
||||
|
|
|
@ -2,14 +2,13 @@ server:
|
|||
port: 8000
|
||||
compression:
|
||||
enabled: true
|
||||
mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json
|
||||
|
||||
spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
redis:
|
||||
repositories:
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>eladmin</artifactId>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
|||
<dependency>
|
||||
<groupId>me.zhengjie</groupId>
|
||||
<artifactId>eladmin-logging</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
</dependency>
|
||||
|
||||
<!--邮件依赖-->
|
||||
|
|
9
pom.xml
9
pom.xml
|
@ -7,7 +7,7 @@
|
|||
<groupId>me.zhengjie</groupId>
|
||||
<artifactId>eladmin</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.6</version>
|
||||
<version>2.7</version>
|
||||
|
||||
<modules>
|
||||
<module>eladmin-common</module>
|
||||
|
@ -188,13 +188,6 @@
|
|||
<artifactId>commons-text</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 解析客户端操作系统、浏览器信息 -->
|
||||
<dependency>
|
||||
<groupId>nl.basjes.parse.useragent</groupId>
|
||||
<artifactId>yauaa</artifactId>
|
||||
<version>6.11</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
Loading…
Reference in New Issue