Skip to content

Commit

Permalink
Merge pull request #221 from erupts/develop
Browse files Browse the repository at this point in the history
1.12.8
  • Loading branch information
erupts authored Nov 26, 2023
2 parents fd074e5 + 0ce32fc commit 53dab2d
Show file tree
Hide file tree
Showing 61 changed files with 176 additions and 161 deletions.
2 changes: 1 addition & 1 deletion erupt-admin/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.12.7</version>
<version>1.12.8</version>
<relativePath>../pom.xml</relativePath>
</parent>

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.12.7</version>
<version>1.12.8</version>
<relativePath>../pom.xml</relativePath>
</parent>
</project>
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.12.7</version>
<version>1.12.8</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.12.7</version>
<version>1.12.8</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.12.7</version>
<version>1.12.8</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.12.7</version>
<version>1.12.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.Type;
import org.springframework.stereotype.Component;
import xyz.erupt.annotation.Erupt;
Expand Down Expand Up @@ -43,10 +44,11 @@
* @author YuePeng
* date 2021/12/16 00:28
*/
@Slf4j
@Getter
@Setter
@Entity
@Table(name = "e_cloud_node", uniqueConstraints = @UniqueConstraint(columnNames = CloudNode.NODE_NAME))
@Table(name = "e_cloud_node")
@Erupt(
name = "节点配置", dataProxy = CloudNode.class,
rowOperation = @RowOperation(
Expand All @@ -67,6 +69,7 @@ public class CloudNode extends MetaModelUpdateVo implements DataProxy<CloudNode>

public static final String ACCESS_TOKEN = "accessToken";

@Column(unique = true)
@EruptField(
views = @View(title = "节点名", sortable = true),
edit = @Edit(title = "节点名", desc = "NodeName", notNull = true, search = @Search(vague = true))
Expand Down Expand Up @@ -198,7 +201,7 @@ public void afterFetch(Collection<Map<String, Object>> list) {
});
} catch (Exception e) {
map.put(version, String.format("<span style='color:#f00'>%s</span>", e.getMessage()));
e.printStackTrace();
log.warn("node warn → " + map.get(NODE_NAME), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.jpa.model.MetaModel;

import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
* @author YuePeng
Expand All @@ -23,11 +26,12 @@
@Getter
@Setter
@Entity
@Table(name = "e_cloud_node_group", uniqueConstraints = @UniqueConstraint(columnNames = "code"))
@Table(name = "e_cloud_node_group")
@Erupt(name = "分组配置")
@EruptI18n
public class CloudNodeGroup extends MetaModel {

@Column(unique = true)
@EruptField(
views = @View(title = "编码", sortable = true),
edit = @Edit(title = "编码", notNull = true, search = @Search(vague = true))
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.12.7</version>
<version>1.12.8</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 com.google.gson.*;
import xyz.erupt.core.util.DateUtil;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
Expand All @@ -22,7 +23,9 @@ public class GsonFactory {
-> LocalDateTime.parse(json.getAsJsonPrimitive().getAsString(), DateTimeFormatter.ofPattern(DateUtil.DATE_TIME)))
.registerTypeAdapter(LocalDate.class, (JsonDeserializer<LocalDate>) (json, type, jsonDeserializationContext)
-> LocalDate.parse(json.getAsJsonPrimitive().getAsString(), DateTimeFormatter.ofPattern(DateUtil.DATE)))
.setLongSerializationPolicy(LongSerializationPolicy.STRING)
.registerTypeAdapter(Long.class, (JsonSerializer<Long>) (src, type, jsonSerializationContext) -> new JsonPrimitive(src.toString()))
.registerTypeAdapter(Double.class, (JsonSerializer<Double>) (src, type, jsonSerializationContext) -> new JsonPrimitive(src.toString()))
.registerTypeAdapter(BigDecimal.class, (JsonSerializer<BigDecimal>) (src, type, jsonSerializationContext) -> new JsonPrimitive(src.toString()))
.serializeNulls().setExclusionStrategies(new EruptGsonExclusionStrategies());

private static final Gson gson = gsonBuilder.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public List<Object> findAutoCompleteValue(@PathVariable("erupt") String eruptNam
try {
return EruptSpringUtil.getBean(autoCompleteType.handler()).completeHandler(formData, val, autoCompleteType.param());
} catch (Exception e) {
e.printStackTrace();
throw new EruptApiErrorTip(e.getMessage(), EruptApiModel.PromptWay.MESSAGE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Cleanup;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand Down Expand Up @@ -44,6 +45,7 @@
* @author YuePeng
* date 10/15/18.
*/
@Slf4j
@RestController
@RequestMapping(EruptRestPath.ERUPT_FILE)
@RequiredArgsConstructor
Expand Down Expand Up @@ -134,7 +136,7 @@ public EruptApiModel upload(@PathVariable("erupt") String eruptName, @PathVariab
}
return EruptApiModel.successApi(path.replace("\\", "/"));
} catch (Exception e) {
e.printStackTrace();
log.error("erupt upload error", e);
return EruptApiModel.errorApi(I18nTranslate.$translate("erupt.upload_error") + " " + e.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package xyz.erupt.core.util;

import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
Expand All @@ -8,6 +10,7 @@
* @author YuePeng
* date 2021/3/28 17:45
*/
@Slf4j
public class EruptInformation {

private static Properties props;
Expand All @@ -19,7 +22,7 @@ public class EruptInformation {
props.load(stream);
EruptInformation.props = props;
} catch (IOException e) {
e.printStackTrace();
log.warn("erupt-core.properties load error", e);
}
}

Expand Down
15 changes: 12 additions & 3 deletions erupt-core/src/main/java/xyz/erupt/core/util/EruptUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import xyz.erupt.annotation.EruptField;
Expand Down Expand Up @@ -34,6 +35,7 @@
import xyz.erupt.core.view.EruptModel;

import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
Expand All @@ -45,6 +47,7 @@
* @author YuePeng
* date 11/1/18.
*/
@Slf4j
public class EruptUtil {

//将object中erupt标识的字段抽取出来放到map中
Expand Down Expand Up @@ -117,7 +120,13 @@ public static Map<String, Object> generateEruptDataMap(EruptModel eruptModel, Ob
map.put(field.getName(), list);
break;
default:
map.put(field.getName(), value);
if (fieldModel.getField().getType() == Long.class ||
fieldModel.getField().getType() == Double.class ||
fieldModel.getField().getType() == BigDecimal.class) {
map.put(field.getName(), value.toString());
} else {
map.put(field.getName(), value);
}
break;
}
}
Expand Down Expand Up @@ -344,7 +353,7 @@ public static Object dataTarget(EruptModel eruptModel, Object data, Object targe
f.set(target, f.get(data));
}
} catch (IllegalAccessException e) {
e.printStackTrace();
log.error("erupt data copy error", e);
}
}
}
Expand All @@ -362,7 +371,7 @@ public static void clearObjectDefaultValueByJson(Object obj, JsonObject data) {
}
}
} catch (IllegalAccessException e) {
e.printStackTrace();
log.error("erupt clear error", e);
}
});
}
Expand Down
4 changes: 3 additions & 1 deletion erupt-core/src/main/java/xyz/erupt/core/util/MimeUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.erupt.core.util;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.MediaType;

Expand All @@ -11,6 +12,7 @@
* @author YuePeng
* date 2019-07-11.
*/
@Slf4j
public class MimeUtil {

private static final Properties mimes = new Properties();
Expand All @@ -19,7 +21,7 @@ public class MimeUtil {
try (InputStream in = MimeUtil.class.getClassLoader().getResourceAsStream("mime.properties")) {
mimes.load(in);
} catch (IOException e) {
e.printStackTrace();
log.warn("mime file load error", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.erupt.core.util;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import xyz.erupt.core.exception.EruptWebApiRuntimeException;

Expand All @@ -14,6 +15,7 @@
* @author YuePeng
* date 2019-10-30.
*/
@Slf4j
public class SecurityUtil {

// xss跨站脚本检测
Expand Down Expand Up @@ -99,7 +101,7 @@ public static boolean csrfInspect(HttpServletRequest request, HttpServletRespons
out.append(text);
throw new EruptWebApiRuntimeException(text);
} catch (IOException e) {
e.printStackTrace();
log.error("csrf inspect error", e);
}
return true;
}
Expand Down
3 changes: 3 additions & 0 deletions erupt-core/src/main/java/xyz/erupt/core/util/TypeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.SneakyThrows;
import org.apache.commons.lang3.math.NumberUtils;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.function.Consumer;

Expand Down Expand Up @@ -39,6 +40,8 @@ public static Object typeStrConvertObject(Object obj, Class<?> targetType) {
return Float.valueOf(str);
} else if (double.class == targetType || Double.class == targetType) {
return Double.valueOf(str);
} else if (BigDecimal.class == targetType) {
return new BigDecimal(str);
} else if (boolean.class == targetType || Boolean.class == targetType) {
return Boolean.valueOf(str);
} else if (targetType.isEnum()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public static EruptApiModel errorNoInterceptMessage(String message) {
}

public static EruptApiModel errorApi(Exception e) {
e.printStackTrace();
return new EruptApiModel(Status.ERROR, e.getMessage(), null, PromptWay.DIALOG);
}

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.12.7</version>
<version>1.12.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>

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

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.exception.ConstraintViolationException;
import org.springframework.dao.DataIntegrityViolationException;
Expand Down Expand Up @@ -36,6 +37,7 @@
* @author YuePeng
* date 2019-03-06.
*/
@Slf4j
@Service
public class EruptDataServiceDbImpl implements IEruptDataService {

Expand Down Expand Up @@ -112,7 +114,6 @@ private void loadSupport(Object jpaEntity) {

//优化异常提示类
private void handlerException(Exception e, EruptModel eruptModel) {
e.printStackTrace();
if (e instanceof DataIntegrityViolationException) {
if (e.getMessage().contains("ConstraintViolationException")) {
throw new EruptWebApiRuntimeException(gcRepeatHint(eruptModel));
Expand All @@ -132,7 +133,6 @@ public void deleteData(EruptModel eruptModel, Object object) {
try {
eruptJpaDao.removeEntity(eruptModel.getClazz(), object);
} catch (DataIntegrityViolationException | ConstraintViolationException e) {
e.printStackTrace();
throw new EruptWebApiRuntimeException(I18nTranslate.$translate("erupt.data.delete_fail_may_be_associated_data"));
} catch (Exception e) {
throw new EruptWebApiRuntimeException(e.getMessage());
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.12.7</version>
<version>1.12.8</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.12.7</version>
<version>1.12.8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 53dab2d

Please sign in to comment.