Merge remote-tracking branch 'origin/leng_dev' into leng_dev

This commit is contained in:
冷冷 committed 2019-02-11 10:09:42 +08:00
commit aab12ed70b
8 files changed
+18 -9

No files matched your search

@@ -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(":");
@@ -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(":");
@@ -21,6 +21,7 @@ import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
@@ -44,6 +45,7 @@ import java.util.List;
@Configuration
@EnableSwagger2
@EnableAutoConfiguration
@ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true)
public class SwaggerAutoConfiguration {
/**
@@ -32,6 +32,10 @@ import java.util.List;
@Data
@ConfigurationProperties("swagger")
public class SwaggerProperties {
/**
* 是否开启swagger
*/
private Boolean ebabled;
/**
* swagger会解析的包路径
**/
@@ -25,6 +25,7 @@ spring:
# swagger相关配置,覆盖全局配置
swagger:
enabled: false
authorization:
authorization-scope-list:
- scope: 'server'
@@ -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;
@@ -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);
@@ -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) {