Skip to content

Commit

Permalink
Merge pull request #122 from erupts/develop
Browse files Browse the repository at this point in the history
1.10.14
  • Loading branch information
erupts authored Sep 20, 2022
2 parents ecc0665 + b926d6f commit 42bd1a7
Show file tree
Hide file tree
Showing 70 changed files with 207 additions and 255 deletions.
9 changes: 2 additions & 7 deletions .gitee/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#### 说明

1. 请确认你提交的PR是到 'develop' 分支,否则我会手动修改代码并关闭PR。
2. 请确认没有更改代码风格(如tab缩进)
3. 新特性添加请确认注释完备,如有必要,请在src/test/java下添加Junit测试用例
前往 github 提交PR,否则可能出现提交后不在贡献者列表出现的BUG

### 修改描述(包括说明bug修复或者添加新特性)

1. [bug修复] balabala……
2. [新特性] balabala……
https://github.com/erupts/erupt
2 changes: 1 addition & 1 deletion erupt-annotation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../pom.xml</relativePath>
</parent>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ default void searchCondition(Map<String, Object> condition) {

}

@Comment("excel导出")
@Comment("excel导出,参数需要强转为WorkBook对象")
default void excelExport(@Comment("POI文档对象") Object workbook) {
}

@Deprecated
@Comment("excel导入,请使用beforeAdd代替该方法")
default void excelImport(MODEL model) {
@Comment("excel导入,参数需要强转为WorkBook对象")
default void excelImport(@Comment("POI文档对象") Object workbook) {
}

@Comment("自定义行,可实现行计算等能力")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public enum ViewType {
LINK_DIALOG,
@Comment("下载")
DOWNLOAD,
@Comment("在新标签页中查看,不同于下载,特殊mine类型可以在网页中直接预览,如:pdf,mp4,svg,png等")
@Comment("在新标签页中查看,不同于下载,特殊mime类型可以在网页中直接预览,如:pdf,mp4,svg,png等")
ATTACHMENT,
@Comment("对话框方式展示附件")
ATTACHMENT_DIALOG,
Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-node-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-node/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
12 changes: 6 additions & 6 deletions erupt-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -24,11 +24,6 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
Expand All @@ -47,6 +42,11 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
@Getter
public enum MenuTypeEnum {

TABLE("table", "表格", "填erupt类名"),
TREE("tree", "树", "填erupt类名"),
BUTTON("button", "按钮", null),
LINK("link", "链接", "互联网地址"),
NEW_WINDOW("newWindow", "新页签", "互联网地址"),
TABLE("table", "表格视图", "填erupt类名"),
TREE("tree", "树状视图", "填erupt类名"),
BUTTON("button", "功能按钮", null),
API("api", "接口名称", null),
LINK("link", "框架内打开链接", "互联网地址"),
NEW_WINDOW("newWindow", "新窗口打开链接", "互联网地址"),
THIS_WINDOW("selfWindow", "本窗口打开链接", "互联网地址"),
FILL("fill", "充满屏幕", "需要充满屏幕的路由地址"),
ROUTER("router", "页面路由", null);
ROUTER("router", "页面路由", "前端开发时的路由地址");

private final String code;
private final String name;
Expand Down
10 changes: 0 additions & 10 deletions erupt-core/src/main/java/xyz/erupt/core/controller/EruptApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import oshi.SystemInfo;
import oshi.hardware.HardwareAbstractionLayer;
import xyz.erupt.core.constant.EruptRestPath;
import xyz.erupt.core.prop.EruptAppProp;
import xyz.erupt.core.util.EruptInformation;
import xyz.erupt.core.util.MD5Util;

Expand All @@ -20,20 +19,11 @@
@RequiredArgsConstructor
public class EruptApi {

private final EruptAppProp eruptAppProp;

@GetMapping("/version")
public String version() {
return EruptInformation.getEruptVersion();
}

@GetMapping("/erupt-app")
public EruptAppProp eruptApp() {
eruptAppProp.setHash(this.hashCode());
eruptAppProp.setVersion(EruptInformation.getEruptVersion());
return eruptAppProp;
}

@GetMapping(value = "/erupt-machine-code")
public String eruptMachineCode() {
//CPU序列号 + 操作系统序列号 + 硬件UUID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public List<Object> findAutoCompleteValue(@PathVariable("erupt") String eruptNam
}

//Gets the CHOICE component drop-down list
@RequestMapping("/choice-item/{erupt}/{field}")
@GetMapping("/choice-item/{erupt}/{field}")
@EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
public List<VLModel> findChoiceItem(@PathVariable("erupt") String eruptName,
@PathVariable("field") String field) {
Expand All @@ -61,7 +61,7 @@ public List<VLModel> findChoiceItem(@PathVariable("erupt") String eruptName,
}

//Gets the TAGS component list data
@RequestMapping("/tags-item/{erupt}/{field}")
@GetMapping("/tags-item/{erupt}/{field}")
@EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
public List<String> findTagsItem(@PathVariable("erupt") String eruptName,
@PathVariable("field") String field) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public Map<String, Object> uploadHtmlEditorImage(@PathVariable("erupt") String e
}


@RequestMapping("/upload-ueditor/{erupt}/{field}")
@GetMapping("/upload-ueditor/{erupt}/{field}")
@EruptRouter(authIndex = 2, verifyMethod = EruptRouter.VerifyMethod.PARAM, verifyType = EruptRouter.VerifyType.ERUPT)
public void uploadUEditorImage(@PathVariable("erupt") String eruptName,
@PathVariable("field") String fieldName,
Expand All @@ -202,7 +202,7 @@ public void uploadUEditorImage(@PathVariable("erupt") String eruptName,

private static final String DOWNLOAD_PATH = "/download-attachment";

@RequestMapping(value = DOWNLOAD_PATH + "/**", produces = {MediaType.APPLICATION_OCTET_STREAM_VALUE})
@GetMapping(value = DOWNLOAD_PATH + "/**", produces = {MediaType.APPLICATION_OCTET_STREAM_VALUE})
public void downloadAttachment(HttpServletRequest request, HttpServletResponse response) throws IOException {
String path = request.getServletPath().replace(EruptRestPath.ERUPT_FILE + DOWNLOAD_PATH, "");
if (!path.startsWith(FS_SEP)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,4 @@ public static void invoke(Consumer<EruptModule> consumer) {
ERUPT_MODULES.forEach(it -> consumer.accept(EruptSpringUtil.getBean(it)));
}

public static int moduleNum() {
return ERUPT_MODULES.size();
}

}
16 changes: 6 additions & 10 deletions erupt-core/src/main/java/xyz/erupt/core/prop/EruptProp.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public class EruptProp {
//附件存储根路径
private String uploadPath = "/opt/erupt-attachment";

//是否使用redis管理session
private boolean redisSession = false;

//是否刷新token有效期(redisSession为true时有效)
private boolean redisSessionRefresh = false;

//是否开启csrf校验
private boolean csrfInspect = true;

Expand All @@ -40,12 +34,14 @@ public class EruptProp {
//指定哪些包内的类通过gson实现序列化
private String[] gsonHttpMessageConvertersPackages;

//多数据源
private EruptPropDb[] dbs;
//是否使用redis管理session
private boolean redisSession = false;

//是否刷新token有效期(redisSession为true时有效)
private boolean redisSessionRefresh = false;

// //true 单机缓存,false基于redis分布式缓存
// private boolean standaloneCache = true;
//多数据源
private EruptPropDb[] dbs;
//
// //应用空间前缀
// private String appSpacePrefix = "erupt-app:";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ private static EruptModel initEruptModel(Class<?> clazz) {
.ifPresent(ignore -> {
EruptFieldModel eruptFieldModel = new EruptFieldModel(field);
eruptModel.getEruptFieldModels().add(eruptFieldModel);
eruptModel.getEruptFieldMap().put(field.getName(), eruptFieldModel);
if(!eruptModel.getEruptFieldMap().containsKey(field.getName())){
eruptModel.getEruptFieldMap().put(field.getName(), eruptFieldModel);
}
}));
eruptModel.getEruptFieldModels().sort(Comparator.comparingInt((a) -> a.getEruptField().sort()));
// erupt annotation validate
Expand Down Expand Up @@ -140,4 +142,5 @@ private String repeat(String space, int num) {
for (int i = 0; i < num; i++) sb.append(space);
return sb.toString();
}

}
4 changes: 4 additions & 0 deletions erupt-core/src/main/java/xyz/erupt/core/util/TypeUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.erupt.core.util;

import lombok.SneakyThrows;
import org.apache.commons.lang3.math.NumberUtils;

import java.util.Arrays;
Expand All @@ -20,6 +21,7 @@ public class TypeUtil {
/**
* 将未知类型转换为目标类型
*/
@SneakyThrows
public static Object typeStrConvertObject(Object obj, Class<?> targetType) {
String str = obj.toString();
if (NumberUtils.isCreatable(str)) {
Expand All @@ -39,6 +41,8 @@ public static Object typeStrConvertObject(Object obj, Class<?> targetType) {
return Double.valueOf(str);
} else if (boolean.class == targetType || Boolean.class == targetType) {
return Boolean.valueOf(str);
} else if (targetType.isEnum()) {
return targetType.getMethod("valueOf", String.class).invoke(targetType, str);
} else {
return str;
}
Expand Down
2 changes: 1 addition & 1 deletion erupt-data/erupt-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-data/erupt-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.PreDataProxy;
import xyz.erupt.annotation.config.Comment;
import xyz.erupt.annotation.config.EruptSmartSkipSerialize;

import javax.persistence.MappedSuperclass;
Expand All @@ -18,15 +19,19 @@
@PreDataProxy(MetaDataProxy.class)
public class MetaModel extends BaseModel {

@Comment("创建人")
@EruptSmartSkipSerialize
private String createBy;

@Comment("创建时间")
@EruptSmartSkipSerialize
private LocalDateTime createTime;

@Comment("更新人")
@EruptSmartSkipSerialize
private String updateBy;

@Comment("更新时间")
@EruptSmartSkipSerialize
private LocalDateTime updateTime;

Expand Down
2 changes: 1 addition & 1 deletion erupt-data/erupt-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<version>1.10.14</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 42bd1a7

Please sign in to comment.