Explorar o código

:art: Improving structure / format of the code.

萌萌哒Sakura酱 %!s(int64=6) %!d(string=hai) anos
pai
achega
e477418bc4

+ 2 - 2
pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/util/WebUtils.java

@@ -20,7 +20,6 @@
 package com.pig4cloud.pigx.common.core.util;
 
 import cn.hutool.core.codec.Base64;
-import cn.hutool.core.util.CharsetUtil;
 import cn.hutool.json.JSONUtil;
 import com.pig4cloud.pigx.common.core.exception.CheckedException;
 import lombok.SneakyThrows;
@@ -41,6 +40,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
 
 
 /**
@@ -221,7 +221,7 @@ public class WebUtils extends org.springframework.web.util.WebUtils {
 					"Failed to decode basic authentication token");
 		}
 
-		String token = new String(decoded, CharsetUtil.UTF_8);
+		String token = new String(decoded, StandardCharsets.UTF_8);
 
 		int delim = token.indexOf(":");
 

+ 2 - 2
pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/util/AuthUtils.java

@@ -18,13 +18,13 @@
 package com.pig4cloud.pigx.common.security.util;
 
 import cn.hutool.core.codec.Base64;
-import cn.hutool.core.util.CharsetUtil;
 import lombok.SneakyThrows;
 import lombok.experimental.UtilityClass;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.HttpHeaders;
 
 import javax.servlet.http.HttpServletRequest;
+import java.nio.charset.StandardCharsets;
 
 /**
  * @author lengleng
@@ -55,7 +55,7 @@ public class AuthUtils {
 					"Failed to decode basic authentication token");
 		}
 
-		String token = new String(decoded, CharsetUtil.UTF_8);
+		String token = new String(decoded, StandardCharsets.UTF_8);
 
 		int delim = token.indexOf(":");
 

+ 1 - 0
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/filter/PasswordDecoderFilter.java

@@ -35,6 +35,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.util.UriComponentsBuilder;
 import reactor.core.publisher.Mono;
 
+import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
 import java.net.URI;

+ 4 - 4
pigx-visual/pigx-activiti/src/main/java/com/pig4cloud/pigx/act/service/impl/EditorServiceImpl.java

@@ -17,7 +17,6 @@
 
 package com.pig4cloud.pigx.act.service.impl;
 
-import cn.hutool.core.util.CharsetUtil;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.pig4cloud.pigx.act.service.EditorService;
@@ -33,6 +32,7 @@ import org.springframework.stereotype.Service;
 
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 
 import static org.activiti.editor.constants.ModelDataJsonConstants.*;
 
@@ -56,7 +56,7 @@ public class EditorServiceImpl implements EditorService {
 	public Object getStencilset() {
 		InputStream stencilsetStream = this.getClass().getClassLoader().getResourceAsStream("stencilset.json");
 		try {
-			return IOUtils.toString(stencilsetStream, CharsetUtil.UTF_8);
+			return IOUtils.toString(stencilsetStream, StandardCharsets.UTF_8);
 		} catch (Exception e) {
 			log.error("Error while loading stencil set", e);
 			throw new ActivitiException("Error while loading stencil set", e);
@@ -83,7 +83,7 @@ public class EditorServiceImpl implements EditorService {
 				}
 				byte[] source = repositoryService.getModelEditorSource(model.getId());
 				modelNode.put(MODEL_ID, model.getId());
-				ObjectNode editorJsonNode = (ObjectNode) objectMapper.readTree(new String(source, CharsetUtil.UTF_8));
+				ObjectNode editorJsonNode = (ObjectNode) objectMapper.readTree(new String(source, StandardCharsets.UTF_8));
 				modelNode.set("model", editorJsonNode);
 				return modelNode;
 			} catch (Exception e) {
@@ -115,7 +115,7 @@ public class EditorServiceImpl implements EditorService {
 			model.setTenantId(String.valueOf(TenantContextHolder.getTenantId()));
 
 			repositoryService.saveModel(model);
-			repositoryService.addModelEditorSource(model.getId(), jsonXml.getBytes(CharsetUtil.UTF_8));
+			repositoryService.addModelEditorSource(model.getId(), jsonXml.getBytes(StandardCharsets.UTF_8));
 			ByteArrayOutputStream outStream = new ByteArrayOutputStream();
 			final byte[] result = outStream.toByteArray();
 			repositoryService.addModelEditorSourceExtra(model.getId(), result);

+ 2 - 1
pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/util/GenUtils.java

@@ -40,6 +40,7 @@ import org.apache.velocity.app.Velocity;
 import java.io.File;
 import java.io.IOException;
 import java.io.StringWriter;
+import java.nio.charset.StandardCharsets;
 import java.util.*;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
@@ -200,7 +201,7 @@ public class GenUtils {
 				zip.putNextEntry(new ZipEntry(Objects
 						.requireNonNull(getFileName(template, tableEntity.getCaseClassName()
 								, map.get("package").toString(), map.get("moduleName").toString()))));
-				IoUtil.write(zip, CharsetUtil.UTF_8, false, sw.toString());
+				IoUtil.write(zip, StandardCharsets.UTF_8, false, sw.toString());
 				IoUtil.close(sw);
 				zip.closeEntry();
 			} catch (IOException e) {