diff --git a/.gitignore b/.gitignore index 7d20223..f878417 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,7 @@ build/ !**/src/main/**/build/ !**/**/build/ !**/src/test/**/build/ -*/Api/build -*/Common/build -*/Search/build +**/build/ ### STS ### .apt_generated diff --git a/Api/build.gradle b/Api/build.gradle index ac2b9ac..3122563 100644 --- a/Api/build.gradle +++ b/Api/build.gradle @@ -16,6 +16,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation project(':Common') implementation project(':Domain') + implementation 'org.springframework.boot:spring-boot-starter-security' + testImplementation 'org.springframework.security:spring-security-test' runtimeOnly 'com.mysql:mysql-connector-j' testImplementation platform('org.junit:junit-bom:5.9.1') testImplementation 'org.junit.jupiter:junit-jupiter' diff --git a/Api/build/classes/java/main/org/momo/MomoApiApplication.class b/Api/build/classes/java/main/org/momo/MomoApiApplication.class deleted file mode 100644 index 52ef0e8..0000000 Binary files a/Api/build/classes/java/main/org/momo/MomoApiApplication.class and /dev/null differ diff --git a/Api/build/tmp/compileJava/previous-compilation-data.bin b/Api/build/tmp/compileJava/previous-compilation-data.bin deleted file mode 100644 index 8cc0d98..0000000 Binary files a/Api/build/tmp/compileJava/previous-compilation-data.bin and /dev/null differ diff --git a/Api/src/main/resources/application.yml b/Api/src/main/resources/application.yml index 7d91f09..570905d 100644 --- a/Api/src/main/resources/application.yml +++ b/Api/src/main/resources/application.yml @@ -11,4 +11,4 @@ spring: hibernate: format_sql: true use_sql_comments: true -# show_sql: true \ No newline at end of file +# show_sql: true diff --git a/Auth/build.gradle b/Auth/build.gradle index 0a72543..8bd42aa 100644 --- a/Auth/build.gradle +++ b/Auth/build.gradle @@ -1,5 +1,6 @@ plugins { id 'java' + id 'java-library' } group = 'org.momo' @@ -13,13 +14,15 @@ bootJar { enabled = false } jar { enabled = true } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-security' + api project(':Common') + implementation project(':Domain') + //implementation 'org.springframework.boot:spring-boot-starter-security' testImplementation platform('org.junit:junit-bom:5.9.1') testImplementation 'org.junit.jupiter:junit-jupiter' - testImplementation 'org.springframework.security:spring-security-test' + //testImplementation 'org.springframework.security:spring-security-test' } test { useJUnitPlatform() -} \ No newline at end of file +} diff --git a/Auth/build/classes/java/main/org/momo/MomoAuthApplication.class b/Auth/build/classes/java/main/org/momo/MomoAuthApplication.class deleted file mode 100644 index 4799128..0000000 Binary files a/Auth/build/classes/java/main/org/momo/MomoAuthApplication.class and /dev/null differ diff --git a/Auth/build/tmp/compileJava/previous-compilation-data.bin b/Auth/build/tmp/compileJava/previous-compilation-data.bin deleted file mode 100644 index 846ad74..0000000 Binary files a/Auth/build/tmp/compileJava/previous-compilation-data.bin and /dev/null differ diff --git a/Auth/src/main/java/org/momo/security/filter/JwtFilter.java b/Auth/src/main/java/org/momo/security/filter/JwtFilter.java index 7c4509f..30296d7 100644 --- a/Auth/src/main/java/org/momo/security/filter/JwtFilter.java +++ b/Auth/src/main/java/org/momo/security/filter/JwtFilter.java @@ -44,6 +44,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse Authentication authentication = new UsernamePasswordAuthenticationToken(principalDetails, null, principalDetails.getAuthorities()); SecurityContextHolder.getContext().setAuthentication(authentication); }catch (JwtExpiredHandler e){ + response.setContentType("application/json"); BaseResponseDto baseResponseDto = BaseResponseDto.onFailure( ErrorStatus.JWT_ACCESS_TOKEN_EXPIRED.getCode(), ErrorStatus.JWT_ACCESS_TOKEN_EXPIRED.getMessage(), @@ -53,6 +54,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse objectMapper.writeValue(response.getOutputStream(),baseResponseDto); return; }catch (JwtInvalidHandler e){ + response.setContentType("application/json"); BaseResponseDto baseResponseDto = BaseResponseDto.onFailure( ErrorStatus.JWT_TOKEN_INVALID.getCode(), ErrorStatus.JWT_TOKEN_INVALID.getMessage(), diff --git a/Common/build.gradle b/Common/build.gradle index 7ff849d..bcd2130 100644 --- a/Common/build.gradle +++ b/Common/build.gradle @@ -1,21 +1,26 @@ plugins { id 'java' + id 'java-library' } -group = 'org.momo' -version = '0.0.1-SNAPSHOT' +bootJar { enabled = false } +jar { enabled = true } repositories { mavenCentral() } dependencies { - // Swagger + api group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.12.3' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + api 'org.springframework.boot:spring-boot-starter-security' + testImplementation 'org.springframework.security:spring-security-test' + runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.12.3' + runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.12.3' testImplementation platform('org.junit:junit-bom:5.9.1') testImplementation 'org.junit.jupiter:junit-jupiter' } test { useJUnitPlatform() -} \ No newline at end of file +} diff --git a/Common/build/classes/java/main/org/momo/MomoCommonApplication.class b/Common/build/classes/java/main/org/momo/MomoCommonApplication.class deleted file mode 100644 index ba08959..0000000 Binary files a/Common/build/classes/java/main/org/momo/MomoCommonApplication.class and /dev/null differ diff --git a/Common/build/tmp/compileJava/previous-compilation-data.bin b/Common/build/tmp/compileJava/previous-compilation-data.bin deleted file mode 100644 index cd306d7..0000000 Binary files a/Common/build/tmp/compileJava/previous-compilation-data.bin and /dev/null differ diff --git a/Common/build/tmp/jar/MANIFEST.MF b/Common/build/tmp/jar/MANIFEST.MF deleted file mode 100644 index 58630c0..0000000 --- a/Common/build/tmp/jar/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/Common/src/main/java/org/momo/MomoCommonApplication.java b/Common/src/main/java/org/momo/MomoCommonApplication.java new file mode 100644 index 0000000..416a500 --- /dev/null +++ b/Common/src/main/java/org/momo/MomoCommonApplication.java @@ -0,0 +1,11 @@ +package org.momo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MomoCommonApplication { + public static void main(String[] args) { + SpringApplication.run(MomoCommonApplication.class,args); + } +} diff --git a/Common/src/main/java/org/momo/common/status/ErrorStatus.java b/Common/src/main/java/org/momo/common/status/ErrorStatus.java index e51b565..ed76f48 100644 --- a/Common/src/main/java/org/momo/common/status/ErrorStatus.java +++ b/Common/src/main/java/org/momo/common/status/ErrorStatus.java @@ -18,6 +18,7 @@ public enum ErrorStatus implements BaseErrorCode { // 멤버 관련 에러 MEMBER_NOT_FOUND(HttpStatus.NOT_FOUND, 401, "사용자가 없습니다."), + PASSWORD_NOT_MATCH(HttpStatus.UNAUTHORIZED, 401, "비밀번호가 일치하지 않습니다."), USER_NOT_EXISTS(HttpStatus.NOT_FOUND, 404, "존재하지 않는 사용자입니다."), NICKNAME_EXISTS(HttpStatus.CONFLICT, 409, "이미 존재하는 닉네임입니다."), diff --git a/Domain/build.gradle b/Domain/build.gradle index abd9c58..3759baf 100644 --- a/Domain/build.gradle +++ b/Domain/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'java' + id 'java-library' } group = 'org.momo' @@ -11,11 +11,12 @@ repositories { dependencies { implementation project(':Common') - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + api 'org.springframework.boot:spring-boot-starter-data-jpa' testImplementation platform('org.junit:junit-bom:5.9.1') testImplementation 'org.junit.jupiter:junit-jupiter' + runtimeOnly 'com.mysql:mysql-connector-j' } test { useJUnitPlatform() -} \ No newline at end of file +} diff --git a/Domain/build/classes/java/main/org/momo/Member/Member.class b/Domain/build/classes/java/main/org/momo/Member/Member.class deleted file mode 100644 index 146b9be..0000000 Binary files a/Domain/build/classes/java/main/org/momo/Member/Member.class and /dev/null differ diff --git a/Domain/build/classes/java/main/org/momo/MomoDomainApplication.class b/Domain/build/classes/java/main/org/momo/MomoDomainApplication.class deleted file mode 100644 index e7eec2d..0000000 Binary files a/Domain/build/classes/java/main/org/momo/MomoDomainApplication.class and /dev/null differ diff --git a/Domain/build/tmp/compileJava/previous-compilation-data.bin b/Domain/build/tmp/compileJava/previous-compilation-data.bin deleted file mode 100644 index 7921eda..0000000 Binary files a/Domain/build/tmp/compileJava/previous-compilation-data.bin and /dev/null differ diff --git a/Domain/build/tmp/jar/MANIFEST.MF b/Domain/build/tmp/jar/MANIFEST.MF deleted file mode 100644 index 58630c0..0000000 --- a/Domain/build/tmp/jar/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/Domain/src/main/java/org/momo/MomoDomainApplication.java b/Domain/src/main/java/org/momo/MomoDomainApplication.java index 072b697..73771e2 100644 --- a/Domain/src/main/java/org/momo/MomoDomainApplication.java +++ b/Domain/src/main/java/org/momo/MomoDomainApplication.java @@ -1,7 +1,15 @@ package org.momo; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; + +@SpringBootApplication +@EnableJpaAuditing public class MomoDomainApplication { public static void main(String[] args) { - System.out.println("Hello world!"); + SpringApplication.run(MomoDomainApplication.class, args); } -} \ No newline at end of file +} + + diff --git a/Domain/src/main/resources/application.yml b/Domain/src/main/resources/application.yml index e5d8a68..570905d 100644 --- a/Domain/src/main/resources/application.yml +++ b/Domain/src/main/resources/application.yml @@ -2,8 +2,8 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/momo_dev?serverTimezone=UTC&characterEncoding=UTF-8 - username: root - password: 12345678 + username: ${DB_USERNAME} + password: ${DB_PASS} jpa: hibernate: ddl-auto: update diff --git a/build.gradle b/build.gradle index 19657fd..133f647 100644 --- a/build.gradle +++ b/build.gradle @@ -26,14 +26,11 @@ subprojects { apply plugin: 'java' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' - //implementation 'org.springframework.boot:spring-boot-starter-batch' - //implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' - //runtimeOnly 'com.mysql:mysql-connector-j' annotationProcessor 'org.projectlombok:lombok' - //testImplementation 'org.springframework.boot:spring-boot-starter-test' - //testImplementation 'org.springframework.batch:spring-batch-test' + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.springframework.batch:spring-batch-test' } tasks.named('test') {