Skip to content

Commit

Permalink
Merge pull request #148 from erupts/develop
Browse files Browse the repository at this point in the history
1.11.4
  • Loading branch information
erupts authored Apr 6, 2023
2 parents 2b19350 + d50ca05 commit c7858db
Show file tree
Hide file tree
Showing 545 changed files with 129,127 additions and 77 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
中文   |   [English](./README-EN.md)

<p align="center"><img src="./erupt-web/src/main/resources/public/erupt.svg" height="150" alt="logo"/></p>
<h1 align="center"> Erupt Framework &nbsp; 🚀 &nbsp; 通用后台管理框架 </h1>
<h1 align="center"> Erupt Framework &nbsp; 🚀 &nbsp; 通用配置管理框架 </h1>
<h3 align="center">零前端代码,几行 Java 注解,搞定后台管理系统</h3>
<h3 align="center"><a href="https://erupt.xyz" target="_blank">https://www.erupt.xyz</a></h3>

Expand Down
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.11.3</version>
<version>1.11.4</version>
<relativePath>../pom.xml</relativePath>
</parent>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package xyz.erupt.annotation.constant;

/**
* @author YuePeng
* date 2023/4/6 21:26
*/
public class AnnotationValue {

public static final String Y = "Y";

public static final String N = "N";

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
@Comment("是否显示")
boolean show() default true;

@Transient
@Comment("动态渲染配置")
ExprBool ifRender() default @ExprBool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@EruptProperty(alias = "viewType")
ViewType type() default ViewType.AUTO;

@Transient
@Comment("动态渲染配置")
ExprBool ifRender() default @ExprBool;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package xyz.erupt.annotation.sub_field.sub_edit;

import xyz.erupt.annotation.constant.AnnotationValue;

/**
* @author YuePeng
* date 2018-09-18.
*/
public @interface BoolType {
String trueText() default "Y";

String falseText() default "N";
String trueText() default AnnotationValue.Y;

String falseText() default AnnotationValue.N;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package xyz.erupt.annotation.sub_field.sub_edit;

/**
* @author YuePeng
* date 2023-03-23
*/
public @interface RateType {

//自定义字符
String character() default "";

//是否允许半选
boolean allowHalf() default false;

int count() default 5;

}
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.11.3</version>
<version>1.11.4</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.11.3</version>
<version>1.11.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions 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.11.3</version>
<version>1.11.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand All @@ -36,7 +36,7 @@
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
<version>5.8.3</version>
<version>5.8.16</version>
</dependency>
</dependencies>
</project>
Expand Down
4 changes: 2 additions & 2 deletions 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.11.3</version>
<version>1.11.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
<version>5.8.3</version>
<version>5.8.16</version>
</dependency>
</dependencies>
</project>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
@ConfigurationProperties("erupt.cloud-server")
public class EruptCloudServerProp {

// node节点持久化时长
// node 节点持久化时长
private Integer nodeExpireTime = 1000 * 60 * 10;

// node节点存活检查周期
// node 节点存活检查周期
private Integer nodeSurviveCheckTime = 1000 * 120;

// cloud key 命名空间
private String cloudNameSpace = "erupt-cloud:";

// node 节点注册时是否校验 Access Token
private boolean validateAccessToken = true;

}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class CloudNode extends MetaModelUpdateVo implements DataProxy<CloudNode>

@Transient
@EruptField(
views = @View(title = "实例数量", className = "text-center", width = "60px")
views = @View(title = "实例数", className = "text-center", width = "60px")
)
private Integer instanceNum;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package xyz.erupt.cloud.server.service;

import org.springframework.stereotype.Service;
import xyz.erupt.cloud.server.config.EruptCloudServerProp;
import xyz.erupt.cloud.server.model.CloudNode;
import xyz.erupt.cloud.server.node.MetaNode;
import xyz.erupt.cloud.server.node.NodeManager;
Expand Down Expand Up @@ -29,15 +30,20 @@ public class EruptNodeMicroservice {
@Resource
private NodeWorker nodeWorker;

@Resource
private EruptCloudServerProp eruptCloudServerProp;

public CloudNode findNodeByAppName(String nodeName, String accessToken) {
CloudNode cloudNode = eruptDao.queryEntity(CloudNode.class, CloudNode.NODE_NAME + " = :" + CloudNode.NODE_NAME, new HashMap<String, Object>() {{
this.put(CloudNode.NODE_NAME, nodeName);
}});
if (null == cloudNode) {
throw new RuntimeException("NodeName: '" + nodeName + "' not found");
}
if (!cloudNode.getAccessToken().equals(accessToken)) {
throw new RuntimeException(cloudNode.getNodeName() + " Access token invalid");
if (eruptCloudServerProp.isValidateAccessToken()) {
if (!cloudNode.getAccessToken().equals(accessToken)) {
throw new RuntimeException(cloudNode.getNodeName() + " Access token invalid");
}
}
return cloudNode;
}
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion 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.11.3</version>
<version>1.11.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ public boolean shouldSkipField(FieldAttributes f) {
MetaErupt metaErupt = MetaContext.getErupt();
if (null == metaErupt || null == metaErupt.getName()) return false;
if (null == f.getAnnotation(EruptSmartSkipSerialize.class)) return false;
Field ff = ReflectUtil.findClassField(EruptCoreService.getErupt(metaErupt.getName()).getClazz(), f.getName());
if (null == ff) return false;
return !f.getDeclaringClass().getName().equals(ff.getDeclaringClass().getName());
Class<?> currEruptClass = EruptCoreService.getErupt(metaErupt.getName()).getClazz();
if (f.getDeclaringClass().isAssignableFrom(currEruptClass)) {
Field ff = ReflectUtil.findClassField(currEruptClass, f.getName());
if (null == ff) return false;
return !f.getDeclaringClass().getName().equals(ff.getDeclaringClass().getName());
} else {
return true;
}
}

@Override
Expand Down

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions erupt-core/src/main/java/xyz/erupt/core/view/EruptBuildModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,15 @@ public class EruptBuildModel {
private Map<String, EruptModel> operationErupts;

private PowerObject power;

@Getter
@Setter
public static class Ext {

private String field;

private EruptModel eruptModel;

}

}
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.11.3</version>
<version>1.11.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ public static String geneEruptHqlCondition(EruptModel eruptModel, List<Condition
}
}
for (Filter filter : eruptModel.getErupt().filter()) {
hql.append(AND).append(filter.value());
if (null != filter.value()) {
hql.append(AND).append(filter.value());
}
}
Optional.ofNullable(customCondition).ifPresent(it -> it.forEach(str -> {
if (StringUtils.isNotBlank(str)) hql.append(EruptJpaUtils.AND).append(str);
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.11.3</version>
<version>1.11.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-excel/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.11.3</version>
<version>1.11.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ public void getExcelTemplate(@PathVariable("erupt") String eruptName, HttpServle
public void exportData(@PathVariable("erupt") String eruptName,
@RequestBody(required = false) List<Condition> conditions,
HttpServletRequest request, HttpServletResponse response) throws IOException {
if (eruptProp.isCsrfInspect() && SecurityUtil.csrfInspect(request, response)) {
return;
}
if (eruptProp.isCsrfInspect() && SecurityUtil.csrfInspect(request, response)) return;
EruptModel eruptModel = EruptCoreService.getErupt(eruptName);
Erupts.powerLegal(eruptModel, PowerObject::isExport);
TableQueryVo tableQueryVo = new TableQueryVo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.stereotype.Service;
import xyz.erupt.annotation.constant.AnnotationValue;
import xyz.erupt.annotation.constant.JavaType;
import xyz.erupt.annotation.fun.VLModel;
import xyz.erupt.annotation.sub_field.Edit;
Expand Down Expand Up @@ -100,9 +101,17 @@ public Workbook exportExcel(EruptModel eruptModel, Page page) {
String str = it.toString();
if (edit.type() == EditType.BOOLEAN || view.type() == ViewType.BOOLEAN) {
if (edit.boolType().trueText().equals(str)) {
cell.setCellValue(edit.boolType().trueText());
if (AnnotationValue.Y.equals(edit.boolType().trueText())) {
cell.setCellValue("是");
} else {
cell.setCellValue(edit.boolType().trueText());
}
} else if (edit.boolType().falseText().equals(str)) {
cell.setCellValue(edit.boolType().falseText());
if (AnnotationValue.N.equals(edit.boolType().falseText())) {
cell.setCellValue("否");
} else {
cell.setCellValue(edit.boolType().falseText());
}
}
} else {
cell.setCellValue(str);
Expand Down
Loading

0 comments on commit c7858db

Please sign in to comment.