diff --git a/README.md b/README.md index 3d2b6af7..ca71f403 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,11 @@ ## ๐Ÿ–ผ๏ธ ํ”„๋กœ๊ทธ๋žจ ๊ตฌ์กฐ๋„ ### CI CD + ![Backend_CICD](https://github.com/user-attachments/assets/f7db576e-5150-443c-8d2f-ab232294c296) ### System Architecture + ![Architecture](https://github.com/user-attachments/assets/b21a697a-003e-4371-bdde-e12db6dbc1d9) ## ๐Ÿ“Š API & ERD @@ -615,17 +617,23 @@ ## ์ปจ๋ฒค์…˜ -> [**Commit Convention**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/Commit-%EC%BB%A8%EB%B2%A4%EC%85%98) +> [**Commit Convention +**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/Commit-%EC%BB%A8%EB%B2%A4%EC%85%98) > > [**PR Convention**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/PR-%EC%BB%A8%EB%B2%A4%EC%85%98) > -> [**Issue Convention**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/%EC%9D%B4%EC%8A%88-%EC%BB%A8%EB%B2%A4%EC%85%98) +> [**Issue Convention +**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/%EC%9D%B4%EC%8A%88-%EC%BB%A8%EB%B2%A4%EC%85%98) +> +> [**Coding Convention +**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/%EC%BD%94%EB%94%A9-%EC%BB%A8%EB%B2%A4%EC%85%98) > -> [**Coding Convention**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/%EC%BD%94%EB%94%A9-%EC%BB%A8%EB%B2%A4%EC%85%98) -> -> [**๋ธŒ๋žœ์น˜ ์ „๋žต**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/%EB%B8%8C%EB%9E%9C%EC%B9%98-%EC%A0%84%EB%9E%B5) -> -๐Ÿ’ก *์ปจ๋ฒค์…˜๊ณผ ๋ธŒ๋žœ์น˜์ „๋žต์€ [Notiion](https://quickest-asterisk-75d.notion.site/7-7-05d799c3f023443f8fb66abf97ca5965)์—์„œ๋„ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค!* +> [**๋ธŒ๋žœ์น˜ ์ „๋žต +**](https://github.com/kakao-tech-campus-2nd-step3/Team7_BE/wiki/%EB%B8%8C%EB%9E%9C%EC%B9%98-%EC%A0%84%EB%9E%B5) +> +๐Ÿ’ก *์ปจ๋ฒค์…˜๊ณผ +๋ธŒ๋žœ์น˜์ „๋žต์€ [Notiion](https://quickest-asterisk-75d.notion.site/7-7-05d799c3f023443f8fb66abf97ca5965) +์—์„œ๋„ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค!* ## ๐Ÿ“‚ ์ €์žฅ์†Œ ์ •๋ณด @@ -667,11 +675,11 @@ > Spring-Cloud-Starter-AWS:2.2.6.RELEASE > > **JWT** -> +> > JJWT-API:0.12.3 -> +> > JJWT-IMPL:0.12.3 -> +> > JJWT-JACKSON:0.12.3 > > **SpringDoc(Swagger)** @@ -693,6 +701,7 @@ > spring-boot-starter-data-redis > > spring-boot-starter-thymeleaf + ## ๐Ÿš€ ๊ธฐ์ˆ  ์Šคํƒ > **Backend** @@ -793,6 +802,13 @@ - DB์—์„œ ์ธํ”Œ๋ฃจ์–ธ์„œ ์œ ํŠœ๋ธŒ ์ฑ„๋„์„ ๊ฐ€์ ธ์™€ ์ƒˆ๋กœ ์—…๋ฐ์ดํŠธ ๋œ ์ •๋ณด ํฌ๋กค๋งํ•ด์„œ ์ •๊ทœํ‘œํ˜„์‹์œผ๋กœ ์ฃผ์†Œ์ •๋ณด๋ฅผ ์ถ”์ถœํ•ฉ๋‹ˆ๋‹ค. - Video์—์„œ ์žฅ์†Œ์ •๋ณด๊ฐ€ ์ถ”์ถœ๋˜๋ฉด kakaoApi๋ฅผ ํ†ตํ•ด ๋งค์žฅ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์™€ ์ธํ”Œ๋ฃจ์–ธ์„œ๋ณ„๋กœ ํŠธ๋žœ์žญ์…˜์„ ๋ถ„๋ฆฌํ•ด ์žฅ์†Œ์ •๋ณด๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. - Video์—์„œ ์žฅ์†Œ์ •๋ณด๊ฐ€ ์ถ”์ถœ๋˜์ง€ ์•Š์œผ๋ฉด AdminํŽ˜์ด์ง€๋ฅผ ํ†ตํ•ด ์ˆ˜๋™์œผ๋กœ ์žฅ์†Œ ์ •๋ณด๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- ### AdminPage + - ๋ฐฐ๋„ˆ, ์—๋Ÿฌ๋กœ๊ทธ, ๊ฐ•์ œํฌ๋กค๋ง ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. + - ํ™ˆํŽ˜์ด์ง€์— ๋ฐฐ๋„ˆ๋ฅผ ๋“ฑ๋กํ•˜๊ฑฐ๋‚˜ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + - ์„œ๋ฒ„ ๋‚ด์—์„œ ๋ฐœ์ƒํ•œ 500๋ฒˆ๋Œ€ ์—๋Ÿฌ๋กœ๊ทธ์™€ StackTrace๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + - ์Šค์ผ€์ฅด๋ง ๋˜์–ด์žˆ๋Š” ๋น„๋””์˜ค ํฌ๋กค๋ง์„ ๊ฐ•์ œ๋กœ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + - ์Šค์ผ€์ฅด๋ง ๋˜์–ด์žˆ๋Š” ์กฐํšŒ์ˆ˜ ํฌ๋กค๋ง์„ ๊ฐ•์ œ๋กœ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + ## ๐Ÿ“ฑ ์‚ฌ์šฉ ์˜ˆ์‹œ > ์‹ค์ œ ์œ ์ € ์‚ฌ์šฉ ํŽ˜์ด์ง€ ํ๋ฆ„ ๋ณด์—ฌ์ฃผ๊ธฐ ( ์˜์ƒ x ) diff --git a/prod.env b/prod.env new file mode 100644 index 00000000..efdecbd5 --- /dev/null +++ b/prod.env @@ -0,0 +1,17 @@ +KAKAO_CLIENT_ID=059dc1f42bbce3a6499c8c35e806b59e +KAKAO_CLIENT_SECRET=XhG4I7doMSAPynuSj3YeCUJfHMGflQZ7 +KAKAO_REDIRECT_URI={baseUrl}/login/oauth2/code/kakao + +JWT_SECRET=1234567890 +JWT_ACCESS_TOKEN_EXPIRED_TIME=300000 +JWT_REFRESH_TOKEN_EXPIRED_TIME=60 + +YOUTUBE_API_KEY=AIzaSyCVxk43oKFnjbMacGK7m9MqPzsU5-736Ok +KAKAO_REST_API_KEY=89fb1518340b58930403f620b14e697d + +DATABASE_URL=jdbc:mysql://inplace-database.cnqma68ee3ul.ap-northeast-2.rds.amazonaws.com:3306/inplace +DATABASE_USERNAME=admin +DATABASE_PASSWORD=tanghulu123! + +REDIS_DATABASE_URL=localhost +REDIS_DATABASE_PORT=6379 \ No newline at end of file diff --git a/src/main/java/team7/inplace/admin/crawling/application/CrawlingFacade.java b/src/main/java/team7/inplace/admin/crawling/application/CrawlingFacade.java index 34fac4d5..1a6f1e95 100644 --- a/src/main/java/team7/inplace/admin/crawling/application/CrawlingFacade.java +++ b/src/main/java/team7/inplace/admin/crawling/application/CrawlingFacade.java @@ -2,6 +2,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Scheduled; import team7.inplace.admin.crawling.application.dto.CrawlingInfo; import team7.inplace.global.annotation.Facade; import team7.inplace.place.application.command.PlacesCommand; @@ -16,7 +17,7 @@ public class CrawlingFacade { private final KakaoCrawlingService kakaoCrawlingService; private final VideoFacade videoFacade; - //TODO: ์Šค์ผ€์ฅด๋ง ์ถ”๊ฐ€ ์˜ˆ์ • + @Scheduled(cron = "0 0 2 * * *", zone = "Asia/Seoul") public void updateVideos() { var crawlingInfos = youtubeCrawlingService.crawlAllVideos(); for (var crawlingInfo : crawlingInfos) { @@ -29,7 +30,7 @@ public void updateVideos() { } } - //TODO: ์Šค์ผ€์ฅด๋ง ์ถ”๊ฐ€ ์˜ˆ์ • + @Scheduled(cron = "0 30 2 * * *", zone = "Asia/Seoul") public void updateVideoView() { var crawlingInfos = videoCrawlingService.crawlingVideoView(); var videoCommands = crawlingInfos.stream() diff --git a/src/main/java/team7/inplace/global/scheduler/ScheduledExecutorConfig.java b/src/main/java/team7/inplace/global/scheduler/ScheduledExecutorConfig.java index 097a65ca..0c4f502e 100644 --- a/src/main/java/team7/inplace/global/scheduler/ScheduledExecutorConfig.java +++ b/src/main/java/team7/inplace/global/scheduler/ScheduledExecutorConfig.java @@ -1,12 +1,13 @@ package team7.inplace.global.scheduler; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; @Configuration +@EnableScheduling public class ScheduledExecutorConfig { @Bean