-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ Feat : 멀티모듈 적용 및 FCM 구현 * 🔨 코드리뷰 반영
- Loading branch information
Showing
176 changed files
with
2,072 additions
and
732 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
tasks.named('bootJar') { //빌드할 때 bootjar 파일로 하겠다는 의미 | ||
enabled = true | ||
} | ||
|
||
tasks.named('jar') { //빌드할 때 jar 파일로 하겠다는 의미 | ||
enabled = false | ||
} | ||
|
||
dependencies { | ||
|
||
implementation project(':core:Briefing-Common') | ||
implementation project(':core:Briefing-Infra') | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
// querydsl | ||
// == 스프링 부트 3.0 이상 == | ||
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' | ||
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta" | ||
annotationProcessor "jakarta.annotation:jakarta.annotation-api" | ||
annotationProcessor "jakarta.persistence:jakarta.persistence-api" | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-redis:2.3.1.RELEASE' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
|
||
implementation 'io.springfox:springfox-swagger2:2.9.2' | ||
implementation 'io.springfox:springfox-swagger-ui:2.9.2' | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' | ||
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' | ||
implementation 'com.googlecode.json-simple:json-simple:1.1.1' | ||
implementation 'mysql:mysql-connector-java' // 추가 작성 | ||
|
||
implementation platform("org.springframework.cloud:spring-cloud-dependencies:2022.0.3") | ||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.h2database:h2' | ||
// runtimeOnly 'org.postgresql:postgresql' | ||
// runtimeOnly 'com.mysql:mysql-connector-j' | ||
|
||
// jwt 의존성 | ||
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5' | ||
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5' | ||
implementation 'io.jsonwebtoken:jjwt-api:0.11.5' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
|
||
// fcm 의존성 | ||
implementation 'com.google.firebase:firebase-admin:9.1.1' | ||
|
||
//spring batch 의존성 | ||
implementation 'org.springframework.boot:spring-boot-starter-batch' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
34 changes: 34 additions & 0 deletions
34
Briefing-Api/src/main/java/com/example/briefingapi/BriefingApiApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.example.briefingapi; | ||
|
||
import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||
import io.swagger.v3.oas.annotations.servers.Server; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.cloud.openfeign.EnableFeignClients; | ||
import org.springframework.cloud.openfeign.FeignAutoConfiguration; | ||
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; | ||
|
||
|
||
@OpenAPIDefinition( | ||
servers = { | ||
@Server(url = "http://localhost:8080", description = "local server"), | ||
@Server(url = "https://dev.briefing.store", description = "dev server"), | ||
@Server(url = "https://api.newsbreifing.store", description = "release server") | ||
}) | ||
@SpringBootApplication(scanBasePackages = {"com.example.briefingapi","com.example.briefingcommon","com.example.briefinginfra"}) | ||
@RequiredArgsConstructor | ||
@EnableCaching | ||
@EnableFeignClients(basePackages = "com.example.briefinginfra") | ||
@EnableRedisRepositories | ||
@ImportAutoConfiguration({FeignAutoConfiguration.class}) | ||
public class BriefingApiApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(BriefingApiApplication.class, args); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...op/annotation/CacheEvictByBriefingId.java → ...op/annotation/CacheEvictByBriefingId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Briefing-Api/src/main/java/com/example/briefingapi/batch/job/DailyPushJobConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.example.briefingapi.batch.job; | ||
|
||
import com.example.briefingapi.fcm.implementation.FcmCommandService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.batch.core.Job; | ||
import org.springframework.batch.core.Step; | ||
import org.springframework.batch.core.job.builder.JobBuilder; | ||
import org.springframework.batch.core.repository.JobRepository; | ||
import org.springframework.batch.core.step.builder.StepBuilder; | ||
import org.springframework.batch.core.step.tasklet.Tasklet; | ||
import org.springframework.batch.repeat.RepeatStatus; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.transaction.PlatformTransactionManager; | ||
|
||
@Slf4j | ||
@Configuration | ||
@RequiredArgsConstructor | ||
public class DailyPushJobConfig { | ||
|
||
private final FcmCommandService fcmCommandService; | ||
|
||
@Value("${fcm.topic.daily-push}") | ||
private String dailyPushTopic; | ||
|
||
@Bean | ||
public Job dailyPushJob(JobRepository jobRepository, Step simpleStep1) { | ||
return new JobBuilder("daily Push", jobRepository) | ||
.start(simpleStep1) | ||
.build(); | ||
} | ||
|
||
@Bean | ||
public Step dailyPushStep(JobRepository jobRepository, Tasklet testTasklet, PlatformTransactionManager platformTransactionManager){ | ||
return new StepBuilder("dailyPushStep", jobRepository) | ||
.tasklet(testTasklet, platformTransactionManager).build(); | ||
} | ||
@Bean | ||
public Tasklet dailyPushTasklet(){ | ||
return ((contribution, chunkContext) -> { | ||
log.info("request FCM!!"); | ||
fcmCommandService.sendMessage(dailyPushTopic); | ||
return RepeatStatus.FINISHED; | ||
}); | ||
} | ||
} | ||
|
39 changes: 39 additions & 0 deletions
39
Briefing-Api/src/main/java/com/example/briefingapi/batch/scheduler/DailyPush.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.example.briefingapi.batch.scheduler; | ||
|
||
import com.example.briefingapi.fcm.implementation.FcmCommandService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.batch.core.Job; | ||
import org.springframework.batch.core.JobExecutionException; | ||
import org.springframework.batch.core.JobParameters; | ||
import org.springframework.batch.core.JobParametersBuilder; | ||
import org.springframework.batch.core.launch.JobLauncher; | ||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Slf4j | ||
@Component | ||
@RequiredArgsConstructor | ||
@EnableScheduling | ||
public class DailyPush { | ||
|
||
private final JobLauncher jobLauncher; | ||
|
||
private final Job job; | ||
|
||
// 초 분 시 일 월 요일 | ||
@Scheduled(cron = "0 0 8,17 * * *") | ||
public void requestDailyTopicFcmJob(){ | ||
log.info("daily alarm launched"); | ||
try { | ||
JobParameters jobParameters = new JobParametersBuilder() | ||
.addLong("executedTime", System.currentTimeMillis()) | ||
.toJobParameters(); | ||
|
||
jobLauncher.run(job, jobParameters); | ||
} catch (JobExecutionException e) { | ||
log.error("SeatReleaseScheduler error : ", e); | ||
} | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
.../briefing/business/BriefingConverter.java → .../briefing/business/BriefingConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 15 additions & 14 deletions
29
...ing/briefing/business/BriefingFacade.java → ...api/briefing/business/BriefingFacade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
...g/briefing/business/BriefingV2Facade.java → ...i/briefing/business/BriefingV2Facade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...plement/context/BriefingQueryContext.java → ...plement/context/BriefingQueryContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../context/BriefingQueryContextFactory.java → .../context/BriefingQueryContextFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...lement/service/ArticleCommandService.java → ...lement/service/ArticleCommandService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...ervice/BriefingArticleCommandService.java → ...ervice/BriefingArticleCommandService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ement/service/BriefingCommandService.java → ...ement/service/BriefingCommandService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.