Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions .github/workflows/DEV-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,46 @@ name: DEV-CI
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Comment on lines +6 to +8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 여러 워크플로우에 대한 동시성 설정인가요?! 신기하군요


jobs:
ci:
runs-on: ubuntu-22.04

permissions:
contents: read
pull-requests: read

env:
TZ: 'Asia/Seoul'
SECRET_KEY: ${{ secrets.SECRET_KEY }}
KAKAO_URL: ${{ secrets.KAKAO_URL }}
APPLE_URL: ${{ secrets.APPLE_URL }}
ACCESS_TOKEN_EXPIRED: ${{ secrets.ACCESS_TOKEN_EXPIRED }}
REFRESH_TOKEN_EXPIRED: ${{ secrets.REFRESH_TOKEN_EXPIRED }}

steps:
- name: 체크아웃
uses: actions/checkout@v3
- name: 저장소 코드 체크아웃
uses: actions/checkout@v4

# GraalVM 설정 대신 일반 JDK를 사용하도록 수정
- name: Set up JDK 21
uses: actions/setup-java@v3
- name: JDK 21 설정
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

# - name: Set up GraalVM JDK 21 with native-image
# GraalVM 네이티브 이미지 빌드를 위한 주석 처리된 설정
# - name: Set up GraalVM JDK 21 with native-image
# uses: graalvm/setup-graalvm@v1.1.1
# with:
# distribution: 'graalvm-community'
# version: '23.1.0'
# java-version: '21'

- name: Gradle 캐시 설정
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -45,13 +54,14 @@ jobs:
- name: Gradle 실행 권한 부여
run: chmod +x ./gradlew

- name: Gradle Build & Test 실행
run: ./gradlew build

- name: ktlint 실행
- name: ktlint로 코드 스타일 검사
run: ./gradlew ktlintCheck

# - name: Native Image Compile (Fail-safe)
- name: 테스트 프로필로 Gradle 빌드 및 테스트 실행
run: ./gradlew build -Dspring.profiles.active=test

# GraalVM 네이티브 이미지 빌드를 위한 주석 처리된 단계
# - name: Native Image Compile (Fail-safe)
# continue-on-error: true
# run: |
# echo "::group::GraalVM Native Image Build"
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ dependencies {
testImplementation("io.mockk:mockk:1.13.10")
testImplementation("org.springframework.security:spring-security-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.springframework.security:spring-security-test")
}

kapt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.terning.server.kotlin.application.announcement.AnnouncementService
import com.terning.server.kotlin.application.announcement.dto.DetailAnnouncementResponse
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
Expand All @@ -16,11 +17,9 @@ class AnnouncementController(
) {
@GetMapping("/{internshipAnnouncementId}")
fun getDetailInternshipAnnouncement(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@PathVariable internshipAnnouncementId: Long,
): ResponseEntity<ApiResponse<DetailAnnouncementResponse>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

val response =
announcementService.getDetailAnnouncement(
userId = userId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.terning.server.kotlin.application.calendar.dto.MonthlyViewResponse
import org.springframework.format.annotation.DateTimeFormat
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
Expand All @@ -20,10 +21,9 @@ class CalendarController(
) {
@GetMapping("/daily")
fun getDailyScraps(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@RequestParam("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) date: LocalDate,
): ResponseEntity<ApiResponse<List<DailyScrapsResponse>>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 교체
val dailyScrapsResponse = calendarService.getDailyScraps(userId, date)
return ResponseEntity.ok(
ApiResponse.success(
Expand All @@ -36,11 +36,10 @@ class CalendarController(

@GetMapping("/monthly-list")
fun getDetailedMonthlyScraps(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@RequestParam("year") year: Int,
@RequestParam("month") month: Int,
): ResponseEntity<ApiResponse<List<DetailedMonthlyScrapsResponse>>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거
val detailedMonthlyScrapsResponse = calendarService.getDetailedMonthlyScraps(userId, year, month)
return ResponseEntity.ok(
ApiResponse.success(
Expand All @@ -53,11 +52,10 @@ class CalendarController(

@GetMapping("/monthly-default")
fun getMonthlyScraps(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@RequestParam("year") year: Int,
@RequestParam("month") month: Int,
): ResponseEntity<ApiResponse<MonthlyViewResponse>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거
val monthlyViewResponse = calendarService.getMonthlyScraps(userId, year, month)
return ResponseEntity.ok(
ApiResponse.success(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.terning.server.kotlin.application.filter.dto.GetFilterResponse
import com.terning.server.kotlin.application.filter.dto.UpdateFilterRequest
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.PutMapping
Expand All @@ -20,11 +21,9 @@ class FilterController(
) {
@PostMapping("auth/sign-up/filter")
fun createUserFilter(
// TODO : @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@RequestBody createFilterRequest: CreateFilterRequest,
): ResponseEntity<ApiResponse<Unit>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

filterService.createUserFilter(
userId = userId,
createFilterRequest = createFilterRequest,
Expand All @@ -41,10 +40,8 @@ class FilterController(

@GetMapping("filters")
fun getUserFilter(
// TODO : @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
): ResponseEntity<ApiResponse<GetFilterResponse>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

val response = filterService.getUserFilter(userId)

return ResponseEntity.ok(
Expand All @@ -58,11 +55,9 @@ class FilterController(

@PutMapping("filters")
fun updateUserFilter(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@RequestBody updateFilterRequest: UpdateFilterRequest,
): ResponseEntity<ApiResponse<Unit>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

filterService.updateUserFilter(
userId = userId,
updateFilterRequest = updateFilterRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.springframework.data.domain.Pageable
import org.springframework.data.web.PageableDefault
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
Expand All @@ -19,17 +20,14 @@ class HomeController(
) {
@GetMapping
fun getInternshipAnnouncementsFilteredByUserFilter(
// TODO: 실제 로그인된 사용자의 인증 정보 주입 필요
// @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@RequestParam(name = "sortBy", required = false, defaultValue = "deadlineSoon")
sortingCondition: String,
@PageableDefault(size = 10) pageable: Pageable,
): ResponseEntity<ApiResponse<HomeResponse>> {
val authenticatedUserId: Long = 1L // TODO: 인증 시스템 연동 시 실제 유저 ID로 대체

val internshipAnnouncementResponse: HomeResponse =
homeService.getFilteredAnnouncements(
userId = authenticatedUserId,
userId = userId,
sortBy = sortingCondition,
pageable = pageable,
)
Expand All @@ -45,9 +43,8 @@ class HomeController(

@GetMapping("/upcoming")
fun getUpcomingDeadlineScraps(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
): ResponseEntity<ApiResponse<UpcomingDeadlineScrapResponse>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 교체
val response = homeService.findUpcomingDeadlineScraps(userId)

return ResponseEntity.ok(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.terning.server.kotlin.application.mypage.ProfileRequest
import com.terning.server.kotlin.application.mypage.ProfileResponse
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PatchMapping
import org.springframework.web.bind.annotation.RequestBody
Expand All @@ -18,30 +19,24 @@ class MyPageController(
) {
@GetMapping("/profile")
fun getProfile(
// TODO : @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
): ResponseEntity<ApiResponse<ProfileResponse>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

val response = mypageService.getUserProfile(userId)

return ResponseEntity
.status(HttpStatus.CREATED)
.body(
ApiResponse.success(
status = HttpStatus.OK,
message = "마이페이지 > 프로필 정보 불러오기를 성공했습니다",
result = response,
),
)
return ResponseEntity.ok(
ApiResponse.success(
status = HttpStatus.OK,
message = "마이페이지 > 프로필 정보 불러오기를 성공했습니다",
result = response,
),
)
}

@PatchMapping("/profile")
fun updateProfile(
// TODO : @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@RequestBody profileRequest: ProfileRequest,
): ResponseEntity<ApiResponse<Unit>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

mypageService.updateUserProfile(
userId = userId,
profileRequest = profileRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.terning.server.kotlin.application.scrap.dto.ScrapRequest
import com.terning.server.kotlin.application.scrap.dto.ScrapUpdateRequest
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.PatchMapping
import org.springframework.web.bind.annotation.PathVariable
Expand All @@ -20,12 +21,10 @@ class ScrapController(
) {
@PostMapping("/{internshipAnnouncementId}")
fun scrap(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@PathVariable internshipAnnouncementId: Long,
@RequestBody scrapRequest: ScrapRequest,
): ResponseEntity<ApiResponse<Unit>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

scrapService.scrap(
userId = userId,
internshipAnnouncementId = internshipAnnouncementId,
Expand All @@ -45,12 +44,10 @@ class ScrapController(

@PatchMapping("/{internshipAnnouncementId}")
fun updateScrap(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@PathVariable internshipAnnouncementId: Long,
@RequestBody scrapUpdateRequest: ScrapUpdateRequest,
): ResponseEntity<ApiResponse<Unit>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

scrapService.updateScrap(
userId = userId,
internshipAnnouncementId = internshipAnnouncementId,
Expand All @@ -68,11 +65,9 @@ class ScrapController(

@DeleteMapping("/{internshipAnnouncementId}")
fun cancelScrap(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@PathVariable internshipAnnouncementId: Long,
): ResponseEntity<ApiResponse<Unit>> {
val userId: Long = 1 // 임시 userId

scrapService.cancelScrap(
userId = userId,
internshipAnnouncementId = internshipAnnouncementId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.springframework.data.domain.Pageable
import org.springframework.data.web.PageableDefault
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
Expand All @@ -21,13 +22,11 @@ class SearchController(
) {
@GetMapping
fun search(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
@RequestParam(required = false) keyword: String?,
@RequestParam(defaultValue = "DEADLINE_SOON") sortBy: String,
@PageableDefault(size = 10) pageable: Pageable,
): ResponseEntity<ApiResponse<SearchPageResponse>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

val response =
searchService.search(
userId = userId,
Expand All @@ -47,10 +46,8 @@ class SearchController(

@GetMapping("/views")
fun getMostViewedAnnouncements(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
): ResponseEntity<ApiResponse<ViewCountResponse>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

val response = searchService.getMostViewedAnnouncements(userId)

return ResponseEntity.ok(
Expand All @@ -64,10 +61,8 @@ class SearchController(

@GetMapping("/scraps")
fun getMostScrappedAnnouncements(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
): ResponseEntity<ApiResponse<ScrapCountResponse>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

val response = searchService.getMostScrappedAnnouncements(userId)

return ResponseEntity.ok(
Expand All @@ -81,10 +76,8 @@ class SearchController(

@GetMapping("/banners")
fun getBanners(
// TODO: @AuthenticationPrincipal userId: Long,
@AuthenticationPrincipal userId: Long,
): ResponseEntity<ApiResponse<BannersView>> {
val userId: Long = 1 // TODO: @AuthenticationPrincipal 구현 시 제거

val response = searchService.getBanners(userId)

return ResponseEntity.ok(
Expand Down
Empty file.
Loading
Loading