Skip to content

Commit

Permalink
[SAMBAD-237] 멀티 모듈 기반 프로젝트 구조 마이그레이션 (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkjsw17 authored Aug 28, 2024
1 parent a9467d2 commit 6f8671f
Show file tree
Hide file tree
Showing 370 changed files with 1,727 additions and 1,640 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
run: chmod +x gradlew

- name: "Gradle 빌드"
run: ./gradlew clean build -x test
run: ./gradlew -p moring-api clean build -x test

- name: "도커 빌드 및 푸시"
run: |
docker login ${{ secrets.DOCKER_REPO }} -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t ${{ secrets.DOCKER_REPO }}/moring-api:${{ github.ref_name }} .
docker build -t ${{ secrets.DOCKER_REPO }}/moring-api:${{ github.ref_name }} . -f moring-api/Dockerfile
docker push ${{ secrets.DOCKER_REPO }}/moring-api:${{ github.ref_name }}
deploy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
run: chmod +x gradlew

- name: "Gradle 빌드"
run: ./gradlew clean build -x test
run: ./gradlew -p moring-api clean build -x test

- name: "도커 빌드 및 푸시"
run: |
docker login ${{ secrets.DOCKER_REPO }} -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t ${{ secrets.DOCKER_REPO }}/moring-api:${{ github.ref_name }} .
docker build -t ${{ secrets.DOCKER_REPO }}/moring-api:${{ github.ref_name }} . -f moring-api/Dockerfile
docker push ${{ secrets.DOCKER_REPO }}/moring-api:${{ github.ref_name }}
deploy:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ temp
spy.log

### Qclass ###
src/main/generated/
*/src/main/generated/
105 changes: 59 additions & 46 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,80 @@ plugins {
id 'io.spring.dependency-management' version '1.1.5'
}

group = 'org.depromeet.sambad'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
bootJar {
enabled = false
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
subprojects {
group = 'org.depromeet.sambad'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'io.jsonwebtoken:jjwt:0.12.6'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'io.jsonwebtoken:jjwt:0.12.6'

implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'

implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

implementation 'io.sentry:sentry-spring-boot-starter-jakarta:7.14.0'
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'

implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:7.11.0'
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'

implementation 'com.amazonaws:aws-java-sdk-s3:1.11.238'
implementation 'javax.xml.bind:jaxb-api:2.3.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

implementation 'org.apache.poi:poi:4.1.2'
implementation 'org.apache.poi:poi-ooxml:4.1.2'
implementation 'com.amazonaws:aws-java-sdk-s3:1.11.238'
implementation 'javax.xml.bind:jaxb-api:2.3.0'

implementation 'net.javacrumbs.shedlock:shedlock-spring:5.14.0'
implementation 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template:5.14.0'
}
implementation 'org.apache.poi:poi:4.1.2'
implementation 'org.apache.poi:poi-ooxml:4.1.2'

implementation 'net.javacrumbs.shedlock:shedlock-spring:5.14.0'
implementation 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template:5.14.0'
}

test {
useJUnitPlatform()
}
test {
useJUnitPlatform()
}
}
2 changes: 1 addition & 1 deletion Dockerfile → moring-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM openjdk:17-slim

WORKDIR /data/www

COPY build/libs/*.jar app.jar
COPY moring-api/build/libs/*.jar app.jar

ENTRYPOINT ["java", "-jar", "app.jar"]
13 changes: 13 additions & 0 deletions moring-api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
bootJar {
enabled = true
}

jar {
enabled = false
}

dependencies {
implementation project(':moring-infra')
implementation project(':moring-domain')
implementation project(':moring-global-utils')
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.depromeet.sambad.moring.api;

import org.depromeet.sambad.moring.infra.EnableMoringConfig;
import org.depromeet.sambad.moring.infra.MoringConfigGroup;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@ComponentScan("org.depromeet.sambad.moring.domain")
@EnableMoringConfig({
MoringConfigGroup.JPA,
MoringConfigGroup.JPA_AUDITING,
MoringConfigGroup.ASYNC,
MoringConfigGroup.OBJECT_STORAGE,
MoringConfigGroup.P6SPY,
MoringConfigGroup.CONFIGURATION_PROPERTIES,
MoringConfigGroup.SWAGGER,
MoringConfigGroup.TIME,
MoringConfigGroup.USER_ID_ARGUMENT_RESOLVER,
MoringConfigGroup.SCHEDULING,
MoringConfigGroup.SPRING_CACHE,
})
public class InfraConfig {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.depromeet.sambad.moring.api;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class MoringApiApplication {

public static void main(String[] args) {
SpringApplication.run(MoringApiApplication.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.depromeet.sambad.moring.answer.presentation;
package org.depromeet.sambad.moring.api.answer;

import org.depromeet.sambad.moring.answer.application.AnswerService;
import org.depromeet.sambad.moring.answer.presentation.request.AnswerRequest;
import org.depromeet.sambad.moring.domain.answer.application.AnswerService;
import org.depromeet.sambad.moring.domain.answer.presentation.request.AnswerRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
Expand All @@ -18,8 +18,9 @@
@Tag(name = "릴레이 질문 답변", description = "모임의 질문이 아닌, 운영자가 관리하는 릴레이 질문 답변 관련 api / 담당자 : 이한음")
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1")
@RequestMapping("/v1/answers")
public class AnswerController {

private final AnswerService answerService;

@Operation(summary = "답변 추가", description = "새로운 답변을 등록하는 API 입니다.")
Expand All @@ -33,5 +34,4 @@ public ResponseEntity<Void> saveAnswer(
answerService.saveAnswer(answerRequest);
return ResponseEntity.ok().build();
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package org.depromeet.sambad.moring.event.presentation;
package org.depromeet.sambad.moring.api.event;

import org.depromeet.sambad.moring.event.application.EventService;
import org.depromeet.sambad.moring.event.presentation.response.EventListResponse;
import org.depromeet.sambad.moring.event.presentation.response.PollingEventListResponse;
import org.depromeet.sambad.moring.user.presentation.resolver.UserId;
import org.depromeet.sambad.moring.domain.event.application.EventService;
import org.depromeet.sambad.moring.domain.event.presentation.EventFacade;
import org.depromeet.sambad.moring.domain.event.presentation.response.EventListResponse;
import org.depromeet.sambad.moring.domain.event.presentation.response.PollingEventListResponse;
import org.depromeet.sambad.moring.infra.annotation.UserId;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.depromeet.sambad.moring.file.presentation;
package org.depromeet.sambad.moring.api.file;

import java.io.IOException;

import org.depromeet.sambad.moring.file.application.FileService;
import org.depromeet.sambad.moring.file.presentation.response.FileUrlResponse;
import org.depromeet.sambad.moring.domain.file.application.FileService;
import org.depromeet.sambad.moring.domain.file.presentation.response.FileUrlResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.depromeet.sambad.moring.meeting.answer.presentation;
package org.depromeet.sambad.moring.api.meeting.answer;

import java.util.List;

import org.depromeet.sambad.moring.meeting.answer.application.MeetingAnswerResultService;
import org.depromeet.sambad.moring.meeting.answer.application.MeetingAnswerService;
import org.depromeet.sambad.moring.meeting.answer.presentation.request.MeetingAnswerRequest;
import org.depromeet.sambad.moring.meeting.answer.presentation.response.MeetingAnswerListResponse;
import org.depromeet.sambad.moring.meeting.answer.presentation.response.MyMeetingAnswerListResponse;
import org.depromeet.sambad.moring.meeting.answer.presentation.response.SelectedAnswerResponse;
import org.depromeet.sambad.moring.meeting.member.presentation.response.MeetingMemberListResponse;
import org.depromeet.sambad.moring.user.presentation.resolver.UserId;
import org.depromeet.sambad.moring.domain.meeting.answer.application.MeetingAnswerResultService;
import org.depromeet.sambad.moring.domain.meeting.answer.application.MeetingAnswerService;
import org.depromeet.sambad.moring.domain.meeting.answer.presentation.request.MeetingAnswerRequest;
import org.depromeet.sambad.moring.domain.meeting.answer.presentation.response.MeetingAnswerListResponse;
import org.depromeet.sambad.moring.domain.meeting.answer.presentation.response.MyMeetingAnswerListResponse;
import org.depromeet.sambad.moring.domain.meeting.answer.presentation.response.SelectedAnswerResponse;
import org.depromeet.sambad.moring.domain.meeting.member.presentation.response.MeetingMemberListResponse;
import org.depromeet.sambad.moring.infra.annotation.UserId;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.depromeet.sambad.moring.meeting.comment.presentation.comment;
package org.depromeet.sambad.moring.api.meeting.comment;

import org.depromeet.sambad.moring.meeting.comment.application.comment.MeetingQuestionCommentService;
import org.depromeet.sambad.moring.meeting.comment.presentation.comment.request.MeetingQuestionCommentRequest;
import org.depromeet.sambad.moring.meeting.comment.presentation.comment.response.MeetingCommentListResponse;
import org.depromeet.sambad.moring.user.presentation.resolver.UserId;
import org.depromeet.sambad.moring.domain.meeting.comment.application.comment.MeetingQuestionCommentService;
import org.depromeet.sambad.moring.domain.meeting.comment.presentation.comment.request.MeetingQuestionCommentRequest;
import org.depromeet.sambad.moring.domain.meeting.comment.presentation.comment.response.MeetingCommentListResponse;
import org.depromeet.sambad.moring.infra.annotation.UserId;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.depromeet.sambad.moring.meeting.comment.presentation.reply;
package org.depromeet.sambad.moring.api.meeting.comment;

import org.depromeet.sambad.moring.meeting.comment.application.reply.MeetingQuestionCommentReplyService;
import org.depromeet.sambad.moring.meeting.comment.presentation.reply.request.MeetingQuestionCommentReplyRequest;
import org.depromeet.sambad.moring.user.presentation.resolver.UserId;
import org.depromeet.sambad.moring.domain.meeting.comment.application.reply.MeetingQuestionCommentReplyService;
import org.depromeet.sambad.moring.domain.meeting.comment.presentation.reply.request.MeetingQuestionCommentReplyRequest;
import org.depromeet.sambad.moring.infra.annotation.UserId;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.depromeet.sambad.moring.meeting.handwaving.presentation;
package org.depromeet.sambad.moring.api.meeting.handwaving;

import org.depromeet.sambad.moring.meeting.handwaving.application.HandWavingService;
import org.depromeet.sambad.moring.meeting.handwaving.presentation.request.HandWavingRequest;
import org.depromeet.sambad.moring.meeting.handwaving.presentation.response.HandWavingStatusResponse;
import org.depromeet.sambad.moring.user.presentation.resolver.UserId;
import org.depromeet.sambad.moring.domain.meeting.handwaving.application.HandWavingService;
import org.depromeet.sambad.moring.domain.meeting.handwaving.presentation.request.HandWavingRequest;
import org.depromeet.sambad.moring.domain.meeting.handwaving.presentation.response.HandWavingStatusResponse;
import org.depromeet.sambad.moring.infra.annotation.UserId;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package org.depromeet.sambad.moring.meeting.meeting.presentation;
package org.depromeet.sambad.moring.api.meeting.meeting;

import static org.springframework.http.HttpStatus.*;

import java.util.List;

import org.depromeet.sambad.moring.meeting.meeting.application.MeetingService;
import org.depromeet.sambad.moring.meeting.meeting.application.MeetingTypeService;
import org.depromeet.sambad.moring.meeting.meeting.domain.Meeting;
import org.depromeet.sambad.moring.meeting.meeting.domain.MeetingType;
import org.depromeet.sambad.moring.meeting.meeting.presentation.request.MeetingPersistRequest;
import org.depromeet.sambad.moring.meeting.meeting.presentation.response.MeetingCodeResponse;
import org.depromeet.sambad.moring.meeting.meeting.presentation.response.MeetingNameResponse;
import org.depromeet.sambad.moring.meeting.meeting.presentation.response.MeetingPersistResponse;
import org.depromeet.sambad.moring.meeting.meeting.presentation.response.MeetingResponse;
import org.depromeet.sambad.moring.meeting.meeting.presentation.response.MeetingTypeResponse;
import org.depromeet.sambad.moring.user.presentation.resolver.UserId;
import org.depromeet.sambad.moring.domain.meeting.meeting.application.MeetingService;
import org.depromeet.sambad.moring.domain.meeting.meeting.application.MeetingTypeService;
import org.depromeet.sambad.moring.domain.meeting.meeting.domain.Meeting;
import org.depromeet.sambad.moring.domain.meeting.meeting.domain.MeetingType;
import org.depromeet.sambad.moring.domain.meeting.meeting.presentation.request.MeetingPersistRequest;
import org.depromeet.sambad.moring.domain.meeting.meeting.presentation.response.MeetingCodeResponse;
import org.depromeet.sambad.moring.domain.meeting.meeting.presentation.response.MeetingNameResponse;
import org.depromeet.sambad.moring.domain.meeting.meeting.presentation.response.MeetingPersistResponse;
import org.depromeet.sambad.moring.domain.meeting.meeting.presentation.response.MeetingResponse;
import org.depromeet.sambad.moring.domain.meeting.meeting.presentation.response.MeetingTypeResponse;
import org.depromeet.sambad.moring.infra.annotation.UserId;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.depromeet.sambad.moring.meeting.member.presentation;
package org.depromeet.sambad.moring.api.meeting.member;

import org.depromeet.sambad.moring.meeting.member.application.HobbyService;
import org.depromeet.sambad.moring.meeting.member.presentation.response.HobbyResponse;
import org.depromeet.sambad.moring.domain.meeting.member.application.HobbyService;
import org.depromeet.sambad.moring.domain.meeting.member.presentation.response.HobbyResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down
Loading

0 comments on commit 6f8671f

Please sign in to comment.