Fix: contributon branch 반영

This commit is contained in:
yongfire38
2024-05-27 17:23:53 +09:00
parent da5caa40fc
commit 6f4f8c9c4d
64 changed files with 1527 additions and 11848 deletions

View File

@@ -1,14 +1,14 @@
plugins {
id 'org.springframework.boot' version '2.7.0'
id "org.sonarqube" version "3.3"
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'org.springframework.boot' version '2.7.12'
id 'org.sonarqube' version '3.5.0.2730'
id 'io.spring.dependency-management' version '1.1.0'
// querydsl
id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10'
id 'java'
}
group = 'org.egovframe.cloud'
version = '0.1'
version = '1.0.0'
sourceCompatibility = '1.8'
configurations {
@@ -23,14 +23,14 @@ repositories {
}
ext {
set('springCloudVersion', "2021.0.3")
set('log4j2.version', "2.17.2") // log4j 보안 패치
set('springCloudVersion', '2021.0.7')
set('log4j2.version', '2.20.0') // log4j 보안 패치
}
dependencies {
// implementation files('../../module-common/build/libs/module-common-0.1.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
implementation 'org.egovframe.cloud:module-common:0.1'
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.1.0') {
// implementation files('../module-common/build/libs/module-common-4.2.0-plain.jar') // 공통 모듈, @ComponentScan(basePackages={"org.egovframe.cloud"}) 추가해야 적용된다
implementation 'org.egovframe.cloud:module-common:4.2.0'
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.2.0') {
exclude group: 'org.egovframe.rte', module: 'org.egovframe.rte.fdl.logging'
}
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
@@ -50,10 +50,11 @@ dependencies {
implementation 'org.apache.tomcat.embed:tomcat-embed-core:9.0.73'
implementation 'org.apache.tomcat.embed:tomcat-embed-el:9.0.73'
implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:9.0.73'
implementation 'net.logstash.logback:logstash-logback-encoder:7.2' // logstash logback
implementation 'commons-net:commons-net:3.8.0' // FTPClient
implementation 'mysql:mysql-connector-java'
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' // logstash logback
implementation 'commons-io:commons-io:2.13.0'
implementation 'commons-net:commons-net:3.9.0' // FTPClient
implementation 'mysql:mysql-connector-java:8.0.33'
implementation 'io.jsonwebtoken:jjwt:0.9.1'
//messaging
implementation 'org.springframework.cloud:spring-cloud-stream'
@@ -64,7 +65,7 @@ dependencies {
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0'
// openapi docs
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.6.9'
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.7.0'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
// lombok
@@ -74,10 +75,11 @@ dependencies {
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation 'com.h2database:h2'
testImplementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.0' // 테스트시에만 출력
testImplementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.1' // 테스트시에만 출력
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.javassist:javassist:3.29.0-GA'
implementation 'org.javassist:javassist:3.29.2-GA'
implementation 'org.webjars:webjars-locator-core:0.53'
}
dependencyManagement {

View File

@@ -150,7 +150,12 @@ public class AttachmentService extends AbstractService {
*/
@Transactional(readOnly = true)
public AttachmentImageResponseDto loadImage(String imagename) {
return storageUtils.loadImage(imagename.replaceAll(EDITOR_FILE_SEPARATOR, FILE_SEPARATOR));
if(FILE_SEPARATOR.equals("\\")) {//윈도우기반 자바시스템일 때 하이픈 character to be escaped is missing 에러방지
imagename = imagename.replaceAll(EDITOR_FILE_SEPARATOR, "\\\\"); //getFileSystem().getPath에서 디스크의 경로를 사용할 때
} else { //리눅스 또는 맥 기반 자바시스템 경로일 때(아래)
imagename = imagename.replaceAll(EDITOR_FILE_SEPARATOR, FILE_SEPARATOR);
}
return storageUtils.loadImage(imagename);
}
/**

View File

@@ -51,10 +51,16 @@ public class FileStorageUtils implements StorageUtils {
private final Path fileStorageLocation;
private final Environment environment;
private final MessageUtil messageUtil;
private static final String FILE_SEPARATOR = File.separator;
public FileStorageUtils(Environment environment, MessageUtil messageUtil) {
this.environment = environment;
this.fileStorageLocation = Paths.get(environment.getProperty("file.directory")).toAbsolutePath().normalize();
String envFileDir = "";
envFileDir = environment.getProperty("file.directory");
if(FILE_SEPARATOR.equals("\\")) {//윈도우기반 자바시스템일 때 경로 에러방지
envFileDir = envFileDir.replaceAll("/", "\\\\");
}
this.fileStorageLocation = Paths.get(envFileDir).toAbsolutePath().normalize();
this.messageUtil = messageUtil;
}
@@ -185,8 +191,9 @@ public class FileStorageUtils implements StorageUtils {
Path path = getStorePath(basePath);
Path target = path.resolve(filename);
Files.copy(file.getInputStream(), target, StandardCopyOption.REPLACE_EXISTING);
InputStream inputStream = file.getInputStream();
Files.copy(inputStream, target, StandardCopyOption.REPLACE_EXISTING);
inputStream.close(); //윈도우 시스템에서도 업로드 시 Temp폴더의 delete file 에러방지코드 추가
return filename;
} catch (IOException ex) {
log.error("Could not stored file", ex);

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!DOCTYPE xml>
<Configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
@@ -45,4 +46,4 @@
</root>
</springProfile>
</configuration>
</Configuration>