Fix: contributon branch 반영
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
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'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'org.egovframe.cloud'
|
||||
version = '0.1'
|
||||
version = '1.0.0'
|
||||
sourceCompatibility = '1.8'
|
||||
|
||||
repositories {
|
||||
@@ -14,8 +14,8 @@ 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 {
|
||||
@@ -28,11 +28,11 @@ dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' // config
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-bus-amqp' // bus
|
||||
implementation 'org.apache.tomcat.embed:tomcat-embed-el:9.0.73'
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.2' // logstash logback
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' // logstash logback
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
implementation 'javax.xml.bind:jaxb-api:2.3.1'
|
||||
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.6.9'
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.7.0'
|
||||
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
|
||||
@@ -69,7 +69,7 @@ management:
|
||||
info:
|
||||
app:
|
||||
name: Spring Cloud Gateway
|
||||
description: API <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> ȿ<><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
description: API 라우팅 및 보안, 모니터링/메트릭 등의 기능을 간단하고 효과적인 방법으로 제공
|
||||
swagger-ui: http://localhost:8000/webjars/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config
|
||||
|
||||
messages:
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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'
|
||||
@@ -48,8 +48,8 @@ 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 'mysql:mysql-connector-java'
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' // logstash logback
|
||||
implementation 'mysql:mysql-connector-java:8.0.33'
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
// querydsl
|
||||
implementation 'com.querydsl:querydsl-jpa:5.0.0'
|
||||
@@ -62,8 +62,8 @@ dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream-binder-rabbit'
|
||||
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.6.9'
|
||||
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
|
||||
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.7.0'
|
||||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
|
||||
|
||||
// lombok
|
||||
implementation 'org.projectlombok:lombok'
|
||||
@@ -72,10 +72,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 {
|
||||
|
||||
@@ -30,4 +30,4 @@ management:
|
||||
info:
|
||||
app:
|
||||
name: Board Service
|
||||
description: <EFBFBD>Խ<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>, <20>Խù<D4BD><C3B9><EFBFBD><EFBFBD><EFBFBD>, ÷<><C3B7><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD><CFB0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
description: 게시판관리, 게시물관리, 첨부파일관리 기능을 제공
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '2.7.0'
|
||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||
id 'org.springframework.boot' version '2.7.12'
|
||||
id 'io.spring.dependency-management' version '1.1.0'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'org.egovframe.cloud'
|
||||
version = '0.1'
|
||||
version = '1.0.0'
|
||||
sourceCompatibility = '1.8'
|
||||
|
||||
repositories {
|
||||
@@ -13,8 +13,8 @@ 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 {
|
||||
@@ -27,7 +27,7 @@ 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 'net.logstash.logback:logstash-logback-encoder:7.4' // logstash logback
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '2.7.0'
|
||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||
id 'org.springframework.boot' version '2.7.12'
|
||||
id 'io.spring.dependency-management' version '1.1.0'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'org.egovframe.cloud'
|
||||
version = '0.1'
|
||||
version = '1.0.0'
|
||||
sourceCompatibility = '1.8'
|
||||
|
||||
repositories {
|
||||
@@ -13,8 +13,8 @@ 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 {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '2.7.0'
|
||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||
id 'org.springframework.boot' version '2.7.12'
|
||||
id 'io.spring.dependency-management' version '1.1.0'
|
||||
// querydsl
|
||||
id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10'
|
||||
id 'java'
|
||||
id "org.sonarqube" version "2.7"
|
||||
id 'org.sonarqube' version '3.5.0.2730'
|
||||
}
|
||||
|
||||
group 'org.egovframe.cloud'
|
||||
version '4.1.0'
|
||||
version '4.2.0'
|
||||
sourceCompatibility = '1.8'
|
||||
|
||||
repositories {
|
||||
@@ -30,13 +30,13 @@ configurations {
|
||||
}
|
||||
|
||||
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 {
|
||||
// EgovAbstractServiceImpl
|
||||
implementation('org.egovframe.rte:org.egovframe.rte.fdl.cmmn:4.1.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'
|
||||
@@ -44,7 +44,7 @@ dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation' // LocalValidatorFactoryBean
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
implementation 'javassist:javassist:3.12.1.GA'
|
||||
implementation 'org.javassist:javassist:3.29.2-GA'
|
||||
|
||||
// querydsl
|
||||
implementation 'com.querydsl:querydsl-jpa:5.0.0'
|
||||
@@ -55,8 +55,8 @@ dependencies {
|
||||
//openapi docs
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
|
||||
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
|
||||
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.6.9'
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.6.9'
|
||||
implementation 'org.springdoc:springdoc-openapi-webmvc-core:1.7.0'
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.7.0'
|
||||
|
||||
//reactive
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc'
|
||||
|
||||
BIN
backend/module-common/build/libs/module-common-4.1.0-plain.jar
Normal file
BIN
backend/module-common/build/libs/module-common-4.1.0-plain.jar
Normal file
Binary file not shown.
BIN
backend/module-common/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
backend/module-common/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
backend/module-common/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
backend/module-common/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -8,6 +8,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
@@ -41,6 +42,7 @@ public class MessageSourceConfig {
|
||||
@Value("${spring.profiles.active:default}")
|
||||
private String profile;
|
||||
|
||||
private static final String FILE_SEPARATOR = File.separator;
|
||||
@Bean
|
||||
public MessageSource messageSource() {
|
||||
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
|
||||
@@ -48,6 +50,9 @@ public class MessageSourceConfig {
|
||||
if ("default".equals(profile)) {
|
||||
Path fileStorageLocation = Paths.get(messagesDirectory).toAbsolutePath().normalize();
|
||||
String dbMessages = StringUtils.cleanPath("file://" + fileStorageLocation + MESSAGES);
|
||||
if(FILE_SEPARATOR.equals("\\")) {//윈도우기반 자바시스템일 때 Could not parse properties file 에러방지
|
||||
dbMessages = StringUtils.cleanPath("file:///" + fileStorageLocation + MESSAGES);
|
||||
}
|
||||
messageSource.setBasenames(dbMessages);
|
||||
} else {
|
||||
messageSource.setBasenames(messagesDirectory + MESSAGES);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '2.7.0'
|
||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||
id 'org.springframework.boot' version '2.7.12'
|
||||
id 'io.spring.dependency-management' version '1.1.0'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'org.egovframe.cloud'
|
||||
version = '0.1'
|
||||
version = '1.0.0'
|
||||
sourceCompatibility = '1.8'
|
||||
|
||||
configurations {
|
||||
@@ -20,14 +20,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-r2dbc'
|
||||
@@ -41,11 +41,11 @@ dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-bus-amqp' // bus
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'
|
||||
implementation 'org.apache.tomcat.embed:tomcat-embed-el:9.0.73'
|
||||
implementation 'com.playtika.reactivefeign:feign-reactor-spring-cloud-starter:3.2.1'
|
||||
implementation 'com.playtika.reactivefeign:feign-reactor-spring-cloud-starter:3.2.11'
|
||||
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
|
||||
implementation 'org.springframework.cloud:spring-cloud-sleuth-zipkin'
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.2' // logstash logback
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' // logstash logback
|
||||
|
||||
//messaging
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream'
|
||||
@@ -54,10 +54,10 @@ dependencies {
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
|
||||
implementation 'dev.miku:r2dbc-mysql:0.8.2.RELEASE'
|
||||
implementation 'mysql:mysql-connector-java'
|
||||
implementation 'mysql:mysql-connector-java:8.0.33'
|
||||
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.6.9'
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.7.0'
|
||||
|
||||
//lombok
|
||||
implementation 'org.projectlombok:lombok'
|
||||
@@ -71,6 +71,8 @@ dependencies {
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
|
||||
implementation 'org.webjars:webjars-locator-core:0.53'
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -6,8 +6,6 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
import reactivefeign.spring.config.EnableReactiveFeignClients;
|
||||
//import reactor.blockhound.BlockHound;
|
||||
|
||||
import java.security.Security;
|
||||
|
||||
@ComponentScan({"org.egovframe.cloud.common", "org.egovframe.cloud.reactive", "org.egovframe.cloud.reservechecksevice"}) // org.egovframe.cloud.common package 포함하기 위해
|
||||
|
||||
@@ -15,4 +15,4 @@ management:
|
||||
info:
|
||||
app:
|
||||
name: Reserve Check Service
|
||||
description: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>Ȯ<EFBFBD><C8AE>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
description: 예약시스템 기능 중 예약확인, 예약승인/취소 기능을 제공
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '2.7.0'
|
||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||
id 'org.springframework.boot' version '2.7.12'
|
||||
id 'io.spring.dependency-management' version '1.1.0'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'org.egovframe.cloud'
|
||||
version = '0.1'
|
||||
version = '1.0.0'
|
||||
sourceCompatibility = '1.8'
|
||||
|
||||
configurations {
|
||||
@@ -20,14 +20,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-r2dbc'
|
||||
@@ -41,19 +41,19 @@ dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-bus-amqp' // bus
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'
|
||||
implementation 'org.apache.tomcat.embed:tomcat-embed-el:9.0.73'
|
||||
implementation 'com.playtika.reactivefeign:feign-reactor-spring-cloud-starter:3.2.1'
|
||||
implementation 'com.playtika.reactivefeign:feign-reactor-spring-cloud-starter:3.2.11'
|
||||
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
|
||||
implementation 'org.springframework.cloud:spring-cloud-sleuth-zipkin'
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.2' // logstash logback
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' // logstash logback
|
||||
|
||||
implementation 'dev.miku:r2dbc-mysql:0.8.2.RELEASE'
|
||||
implementation 'mysql:mysql-connector-java'
|
||||
implementation 'mysql:mysql-connector-java:8.0.33'
|
||||
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.6.9'
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.7.0'
|
||||
|
||||
//messaging
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream'
|
||||
@@ -71,6 +71,8 @@ dependencies {
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
|
||||
implementation 'org.webjars:webjars-locator-core:0.53'
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -15,4 +15,4 @@ management:
|
||||
info:
|
||||
app:
|
||||
name: Reserve Item Service
|
||||
description: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ǰ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
description: 예약시스템 기능 중 예약지역, 예약물품 관리 기능을 제공
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '2.7.0'
|
||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||
id 'org.springframework.boot' version '2.7.12'
|
||||
id 'io.spring.dependency-management' version '1.1.0'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'org.egovframe.cloud'
|
||||
version = '0.1'
|
||||
version = '1.0.0'
|
||||
sourceCompatibility = '1.8'
|
||||
|
||||
configurations {
|
||||
@@ -20,15 +20,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-r2dbc'
|
||||
@@ -42,11 +41,11 @@ dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-bus-amqp' // bus
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'
|
||||
implementation 'org.apache.tomcat.embed:tomcat-embed-el:9.0.73'
|
||||
implementation 'com.playtika.reactivefeign:feign-reactor-spring-cloud-starter:3.2.1'
|
||||
implementation 'com.playtika.reactivefeign:feign-reactor-spring-cloud-starter:3.2.11'
|
||||
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
|
||||
implementation 'org.springframework.cloud:spring-cloud-sleuth-zipkin'
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.2' // logstash logback
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' // logstash logback
|
||||
|
||||
//messaging
|
||||
implementation 'org.springframework.cloud:spring-cloud-stream'
|
||||
@@ -57,10 +56,10 @@ dependencies {
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
|
||||
implementation 'dev.miku:r2dbc-mysql:0.8.2.RELEASE'
|
||||
implementation 'mysql:mysql-connector-java'
|
||||
implementation 'mysql:mysql-connector-java:8.0.33'
|
||||
|
||||
// openapi docs
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.6.9'
|
||||
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.7.0'
|
||||
|
||||
//lombok
|
||||
implementation 'org.projectlombok:lombok'
|
||||
@@ -75,6 +74,8 @@ dependencies {
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
testImplementation 'org.springframework.amqp:spring-rabbit-test'
|
||||
|
||||
implementation 'org.webjars:webjars-locator-core:0.53'
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -15,4 +15,4 @@ management:
|
||||
info:
|
||||
app:
|
||||
name: Reserve Request Service
|
||||
description: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
description: 예약시스템 기능 중 예약신청 기능을 제공
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '2.7.0'
|
||||
id "org.sonarqube" version "2.7"
|
||||
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,9 +50,9 @@ 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 'mysql:mysql-connector-java'
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
implementation 'net.logstash.logback:logstash-logback-encoder:7.4' // logstash logback
|
||||
implementation 'mysql:mysql-connector-java:8.0.33'
|
||||
implementation 'io.jsonwebtoken:jjwt:0.9.1'
|
||||
// querydsl
|
||||
implementation 'com.querydsl:querydsl-jpa:5.0.0'
|
||||
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0'
|
||||
@@ -61,10 +61,10 @@ dependencies {
|
||||
implementation 'org.ehcache:ehcache'
|
||||
implementation 'javax.cache:cache-api' // expiry를 위해 필요
|
||||
|
||||
implementation 'com.google.api-client:google-api-client:1.35.1'
|
||||
implementation 'com.google.api-client:google-api-client:2.2.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
|
||||
@@ -73,11 +73,12 @@ dependencies {
|
||||
testImplementation 'org.projectlombok:lombok'
|
||||
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'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
|
||||
implementation 'org.javassist:javassist:3.29.0-GA'
|
||||
implementation 'org.webjars:webjars-locator-core:0.53'
|
||||
}
|
||||
|
||||
dependencyManagement {
|
||||
|
||||
@@ -2,12 +2,13 @@ package org.egovframe.cloud.userservice.config;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.egovframe.cloud.userservice.service.user.UserService;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
|
||||
import static org.egovframe.cloud.common.config.GlobalConstant.SECURITY_PERMITALL_ANTPATTERNS;
|
||||
|
||||
@@ -31,57 +32,50 @@ import static org.egovframe.cloud.common.config.GlobalConstant.SECURITY_PERMITAL
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@EnableWebSecurity // Spring Security 설정들을 활성화시켜 준다
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
public class SecurityConfig {
|
||||
|
||||
private final TokenProvider tokenProvider;
|
||||
private final UserService userService;
|
||||
private final BCryptPasswordEncoder bCryptPasswordEncoder;
|
||||
|
||||
|
||||
@Bean
|
||||
AuthenticationManager authenticationManager(AuthenticationConfiguration authConfiguration) throws Exception {
|
||||
return authConfiguration.getAuthenticationManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* 스프링 시큐리티 설정
|
||||
*
|
||||
* @param http
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.csrf().disable()
|
||||
.headers().frameOptions().disable()
|
||||
.and()
|
||||
.sessionManagement()
|
||||
.sessionCreationPolicy(SessionCreationPolicy.STATELESS) // 토큰 사용하기 때문에 세션은 비활성화
|
||||
.and()
|
||||
.authorizeRequests()
|
||||
.antMatchers(SECURITY_PERMITALL_ANTPATTERNS).permitAll()
|
||||
.anyRequest().access("@authorizationService.isAuthorization(request, authentication)") // 호출 시 권한 인가 데이터 확인
|
||||
.and()
|
||||
.addFilter(getAuthenticationFilter())
|
||||
.logout()
|
||||
.logoutSuccessUrl("/");
|
||||
}
|
||||
|
||||
/**
|
||||
* 로그인 인증정보를 받아 토큰을 발급할 수 있도록 필터를 등록해준다.
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private AuthenticationFilter getAuthenticationFilter() throws Exception {
|
||||
return new AuthenticationFilter(authenticationManager(), tokenProvider, userService);
|
||||
}
|
||||
|
||||
/**
|
||||
* 인증 관련 - 로그인 처리
|
||||
* DB 에서 조회하여 일치하는지 체크한다.
|
||||
*
|
||||
* @param auth
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// userService.loadUserByUsername 메소드
|
||||
auth.userDetailsService(userService).passwordEncoder(bCryptPasswordEncoder);
|
||||
}
|
||||
@Bean
|
||||
public SecurityFilterChain configure(HttpSecurity http) throws Exception {
|
||||
|
||||
AuthenticationManager authenticationManager = authenticationManager(http.getSharedObject(AuthenticationConfiguration.class));
|
||||
|
||||
/**
|
||||
* 로그인 인증정보를 받아 토큰을 발급할 수 있도록 필터를 등록해준다.
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
AuthenticationFilter authenticationFilter = new AuthenticationFilter(authenticationManager, tokenProvider, userService);
|
||||
|
||||
http
|
||||
.csrf().disable().headers().frameOptions().disable()
|
||||
.and()
|
||||
.sessionManagement()
|
||||
.sessionCreationPolicy(SessionCreationPolicy.STATELESS) // 토큰 사용하기 때문에 세션은 비활성화
|
||||
.and()
|
||||
.authorizeRequests()
|
||||
.antMatchers(SECURITY_PERMITALL_ANTPATTERNS).permitAll()
|
||||
.anyRequest().access("@authorizationService.isAuthorization(request, authentication)") // 호출 시 권한 인가 데이터 확인
|
||||
.and()
|
||||
.addFilter(authenticationFilter)
|
||||
.logout()
|
||||
.logoutSuccessUrl("/");
|
||||
|
||||
return http.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user