Skip to content

Commit

Permalink
Merge pull request #157 from erupts/develop
Browse files Browse the repository at this point in the history
1.11.6
  • Loading branch information
erupts committed May 13, 2023
2 parents 5903e75 + c6e9fe0 commit 0da4f24
Show file tree
Hide file tree
Showing 455 changed files with 97,554 additions and 588 deletions.
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.5</version>
<version>1.11.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
@Comment("左树右表配置项")
LinkTree linkTree() default @LinkTree(field = "");

@Comment("自定义页头")
@Match("#value.path() != ''")
Tpl header() default @Tpl(path = "");

// @Comment("自定义页头")
// @Match("#value.path() != ''")
// Tpl header() default @Tpl(path = "");
//
// @Comment("画册视图定义")
// @Match("#value.enable() == true")
// Card cardView() default @Card(enable = false, galleryField = "", viewFields = {});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Edit edit() default @Edit(title = "");

@Transient
@Comment("显示顺序,默认按照字段排列顺序排序")
@Comment("显示顺序")
int sort() default 1000;

@ToMap(key = "key")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
@Transient
boolean enable() default true;

boolean showTitle() default false;

@Comment("封面字段")
String galleryField();

@Comment("封面效果")
GalleryCover galleryCover() default GalleryCover.CLIP;

@Comment("字段")
@Comment("显示字段")
String[] viewFields();

enum GalleryCover {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package xyz.erupt.annotation.sub_erupt;

public @interface Layout {

//表单大小
FormSize formSize() default FormSize.DEFAULT;

//表格宽度,为0则自动计算
int tableWidth() default 0;

int tableLeftFixed() default 0;

int tableRightFixed() default 0;


enum FormSize {
DEFAULT,
FULL_LINE //整行
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
@Comment("模板引擎")
Engine engine() default Engine.FreeMarker;

// @Comment("模板宽度")
// int width() default 0;

@Getter
enum Engine {
@Comment("原生H5, Native模式下不支持tplHandler")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
@Match("#item.type().toString()=='SLIDER'")
SliderType sliderType() default @SliderType(max = 999);

@Match("#item.type().toString()=='RATE'")
RateType rateType() default @RateType;

@Match("#item.type().toString()=='DATE'")
DateType dateType() default @DateType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public enum EditType {
@EditTypeMapping(mapping = SliderType.class, desc = "数字滑块", allowType = {JavaTypeEnum.number})
SLIDER,
@EditTypeSearch(vagueMethod = QueryExpression.RANGE)
@EditTypeMapping(mapping = RateType.class, desc = "评分", allowType = {JavaTypeEnum.number})
RATE,
@EditTypeSearch(vagueMethod = QueryExpression.RANGE)
@EditTypeMapping(mapping = DateType.class, desc = "日期", allowType = {JavaTypeEnum.String, JavaTypeEnum.date})
DATE,
@EditTypeSearch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import xyz.erupt.annotation.config.Comment;
import xyz.erupt.annotation.config.EruptProperty;
import xyz.erupt.annotation.expr.ExprBool;
import xyz.erupt.annotation.sub_erupt.Tpl;

import java.beans.Transient;

Expand All @@ -16,6 +17,9 @@

String desc() default "";

@Comment("可在模板中使用row变量,获取当前行的数据")
Tpl tpl() default @Tpl(path = "");

@Comment("列宽度(请指定单位如:%,px)")
String width() default "";

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package xyz.erupt.annotation.sub_field.sub_edit;

import xyz.erupt.annotation.SceneEnum;
import xyz.erupt.annotation.config.Comment;

/**
* @author YuePeng
* date 2020-05-21
*/
public @interface DynamicBy {

boolean enable() default true;

// @Comment("依赖其他表单的值")
// String[] dependFields();

@Comment("显示条件表达式,支持变量:item 该值表示其他字段的值")
String expr();

@Comment("展示类型")
Type viewType() default Type.SHOW;

@Comment("生效场景范围")
SceneEnum[] sceneRange() default {SceneEnum.ADD, SceneEnum.EDIT, SceneEnum.VIEW_DETAIL};


enum Type {
SHOW, //显示
HIDE, //隐藏
SHOW_NOTNULL, //显示且必填
SHOW_READONLY, //显示且制度
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package xyz.erupt.annotation.sub_field.sub_edit;

/**
* @author YuePeng
* date 2023/5/9 22:31
*/
public @interface PasswordType {

//加密次数
int encryptCount();


}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//是否允许半选
boolean allowHalf() default false;

//star 总数
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.5</version>
<version>1.11.6</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.5</version>
<version>1.11.6</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.11.5</version>
<version>1.11.6</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.11.5</version>
<version>1.11.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
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 = "70px")
)
private Integer instanceNum;

Expand Down
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.5</version>
<version>1.11.6</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public abstract class AnnotationProxy<A, PA> {

protected abstract Object invocation(MethodInvocation invocation);

public A newProxy(A annotation) {
return this.newProxy(annotation, null);
}

//创建注解注解代理类
public A newProxy(A annotation, AnnotationProxy<PA, ?> parent) {
this.parent = parent;
Expand Down
21 changes: 17 additions & 4 deletions erupt-core/src/main/java/xyz/erupt/core/util/DateUtil.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package xyz.erupt.core.util;

import lombok.SneakyThrows;
import xyz.erupt.core.exception.EruptWebApiRuntimeException;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
Expand All @@ -29,11 +33,20 @@ public static String getFormatDate(Date date, String formatStr) {
}

@SneakyThrows
public static Date getDate(String str) {
if (str.length() == 10) {
return new SimpleDateFormat(DATE).parse(str);
public static Object getDate(Class<?> targetDateType, String str) {
if (targetDateType == Date.class) {
if (str.length() == 10) {
return new SimpleDateFormat(DATE).parse(str);
} else {
return new SimpleDateFormat(DATE_TIME).parse(str);
}
} else if (targetDateType == LocalDate.class) {
return LocalDate.parse(str, DateTimeFormatter.ofPattern(DATE));
} else if (targetDateType == LocalDateTime.class) {
return LocalDateTime.parse(str, DateTimeFormatter.ofPattern(DATE_TIME));
} else {
return new SimpleDateFormat(DATE_TIME).parse(str);
throw new EruptWebApiRuntimeException("Unsupported date type");
}
}

}
10 changes: 3 additions & 7 deletions erupt-core/src/main/java/xyz/erupt/core/util/EruptUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,14 @@ public static List<String> getTagList(TagsType tagsType) {
}

public static Object convertObjectType(EruptFieldModel eruptFieldModel, Object obj) {
if (null == obj) {
return null;
}
if (null == eruptFieldModel) {
return obj.toString();
}
if (null == obj) return null;
if (null == eruptFieldModel) return obj.toString();
String str = obj.toString();
Edit edit = eruptFieldModel.getEruptField().edit();
switch (edit.type()) {
case DATE:
if (isDateField(eruptFieldModel.getFieldReturnName())) {
return DateUtil.getDate(str);
return DateUtil.getDate(eruptFieldModel.getField().getType(), str);
} else {
return str;
}
Expand Down
28 changes: 28 additions & 0 deletions erupt-core/src/main/java/xyz/erupt/core/util/SecretUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package xyz.erupt.core.util;

import lombok.SneakyThrows;

import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;

/**
* @author YuePeng
* date 2023/5/9 21:34
*/
public class SecretUtil {


public static String decodeSecret(String str) {
return new String(Base64.getDecoder().decode(str));
}

@SneakyThrows
public static String decodeSecret(String str, int encodeNum) {
for (int i = 0; i < encodeNum; i++) {
str = decodeSecret(str);
}
return URLDecoder.decode(str, StandardCharsets.UTF_8.name());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public EruptFieldModel(Field field) {
}
break;
}
this.eruptField = eruptFieldAnnotationProxy.newProxy(this.getEruptField(), null);
this.eruptField = eruptFieldAnnotationProxy.newProxy(this.getEruptField());
//校验注解的正确性
EruptFieldAnnotationException.validateEruptFieldInfo(this);
}
Expand Down
4 changes: 2 additions & 2 deletions erupt-core/src/main/java/xyz/erupt/core/view/EruptModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
@Getter
@Setter
public final class EruptModel implements Cloneable {
public class EruptModel implements Cloneable {

private transient Class<?> clazz;

Expand All @@ -45,7 +45,7 @@ public final class EruptModel implements Cloneable {
public EruptModel(Class<?> eruptClazz) {
this.clazz = eruptClazz;
this.erupt = eruptClazz.getAnnotation(Erupt.class);
this.erupt = eruptAnnotationProxy.newProxy(this.getErupt(), null);
this.erupt = eruptAnnotationProxy.newProxy(this.getErupt());
this.eruptName = eruptClazz.getSimpleName();
DataProxyInvoke.invoke(this, it -> {
try {
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.11.5</version>
<version>1.11.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 0da4f24

Please sign in to comment.