mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-09 04:49:02 +08:00
🎨 Improving structure / format of the code.
This commit is contained in:
1 parent
db0a3e0de6
commit
e477418bc4
5 files changed
+11
-9
No files matched your search
+2
-2
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user