-
Notifications
You must be signed in to change notification settings - Fork 1
dev to main #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dev to main #69
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
357765f
feat: Subscription, Summary, API μΉ κ°μ
wlgusqkr 994d32c
Merge pull request #64 from Today-s-Sound/feat/#63
wlgusqkr 62b05c3
feat: flywayμ€μ
wlgusqkr 9dc1fe4
[feat] μ¬μ©λμ§ μλ μ»¬λΌ μ κ±°
DOHOON0127 f2f63f2
fi
wlgusqkr 259424c
feat: flywayμ€μ
wlgusqkr d778817
feat: ꡬλ
λͺ©λ‘ API μΆκ°
wlgusqkr 991e50a
hotfix flyway μμ
wlgusqkr 90f9f18
hotfix flyway
wlgusqkr 1f0d860
feat: keywordMatchedμ λ°λΌμ μλ μ λͺ© λ³κ²½
wlgusqkr f90674d
feat: keywordMatchedλ‘ summaryμ μ₯ λλλ‘ μμ
wlgusqkr 68be1f1
hotfix: HTTP μμ² histogram bucket λ°μ΄ν° μμ§ μ€μ
wlgusqkr 485b6bf
feat: ciμΆκ°
wlgusqkr 3b7ce0f
fix: ci branch λ³κ²½
wlgusqkr c460e5f
Change CI runner from self-hosted to ubuntu-latest
wlgusqkr 6ccedf8
feat: test μμ‘΄μ± μΆκ°, application-ciκ°μ , ci.yml κ°μ
wlgusqkr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or 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,61 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - dev | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| checks: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'corretto' | ||
| cache: gradle | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Compile Check | ||
| run: ./gradlew compileJava compileTestJava | ||
|
|
||
| - name: Run Tests | ||
| env: | ||
| SPRING_PROFILES_ACTIVE: ci | ||
| run: ./gradlew test | ||
|
|
||
| - name: Publish Test Results | ||
| uses: EnricoMi/publish-unit-test-result-action@v2 | ||
| if: always() | ||
| with: | ||
| files: build/test-results/test/*.xml | ||
| check_name: "Test Results" | ||
|
|
||
| - name: Build JAR (verify build) | ||
| run: ./gradlew bootJar | ||
|
|
||
| - name: Build Summary | ||
| if: always() | ||
| run: | | ||
| echo "### CI Summary :white_check_mark:" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Branch:** ${{ github.head_ref }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Event:** ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY |
This file contains hidden or 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
Binary file not shown.
This file contains hidden or 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
62 changes: 9 additions & 53 deletions
62
src/main/java/com/todaysound/todaysound_server/domain/alarm/controller/AlarmController.java
This file contains hidden or 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 |
|---|---|---|
| @@ -1,63 +1,19 @@ | ||
| package com.todaysound.todaysound_server.domain.alarm.controller; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import com.todaysound.todaysound_server.domain.alarm.dto.request.SummaryReadRequestDto; | ||
| import org.springframework.web.bind.annotation.*; | ||
| import com.todaysound.todaysound_server.domain.alarm.dto.response.RecentAlarmResponse; | ||
| import com.todaysound.todaysound_server.domain.alarm.dto.response.UnreadAlarmResponse; | ||
| import com.todaysound.todaysound_server.domain.alarm.service.AlarmQueryService; | ||
| import com.todaysound.todaysound_server.domain.summary.service.SummaryCommandService; | ||
| import com.todaysound.todaysound_server.global.dto.PageRequestDTO; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.web.bind.annotation.DeleteMapping; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/alarms") | ||
| @RequiredArgsConstructor | ||
| public class AlarmController implements AlarmApi { | ||
|
|
||
| private final AlarmQueryService alarmQueryService; | ||
| private final SummaryCommandService summaryCommandService; | ||
|
|
||
| /** | ||
| * μ΅κ·Ό μλ¦Ό λͺ©λ‘ μ‘°ν | ||
| */ | ||
| @GetMapping() | ||
| @Override | ||
| public List<RecentAlarmResponse> getRecentAlarms( | ||
| @ModelAttribute final PageRequestDTO pageRequest, | ||
| @RequestHeader("X-User-ID") String userUuid, | ||
| @RequestHeader("X-Device-Secret") String deviceSecret) { | ||
|
|
||
| return alarmQueryService.getRecentAlarms(pageRequest, userUuid, deviceSecret); | ||
| } | ||
|
|
||
|
|
||
|
|
||
| /** | ||
| * λ©μΈνλ©΄μ© μ½μ§ μμ μλ μ‘°ν - μ½μ§ μμ Summaryλ§ ν¬ν¨νμ¬ λ°ν | ||
| */ | ||
| @GetMapping("/unread") | ||
| @Override | ||
| public List<UnreadAlarmResponse> getUnreadAlarmsForMain( | ||
| @ModelAttribute final PageRequestDTO pageRequest, | ||
| @RequestHeader("X-User-ID") String userUuid, | ||
| @RequestHeader("X-Device-Secret") String deviceSecret) { | ||
|
|
||
| return alarmQueryService.getUnreadAlarmsForMain(pageRequest, userUuid, deviceSecret); | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Summary μ½μ μ²λ¦¬ - νλ‘ νΈμμ μ¬μ©μκ° Summaryλ₯Ό μ½μμ λ νΈμΆ | ||
| */ | ||
| @PatchMapping("/summaries/read") | ||
| @Override | ||
| public void markSummaryAsRead(@RequestBody SummaryReadRequestDto summaryReadRequestDto, | ||
| @RequestHeader("X-User-ID") String userUuid, | ||
| @RequestHeader("X-Device-Secret") String deviceSecret) { | ||
|
|
||
| summaryCommandService.markSummaryAsRead(summaryReadRequestDto, userUuid, deviceSecret); | ||
| } | ||
| public class AlarmController { | ||
| // | ||
| // @DeleteMapping | ||
| // public void deleteAlarms(@RequestMapping) { | ||
| // | ||
| // } | ||
|
|
||
| } |
33 changes: 33 additions & 0 deletions
33
...n/java/com/todaysound/todaysound_server/domain/alarm/controller/AlarmQueryController.java
This file contains hidden or 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,33 @@ | ||
| package com.todaysound.todaysound_server.domain.alarm.controller; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.springframework.web.bind.annotation.*; | ||
| import com.todaysound.todaysound_server.domain.alarm.dto.response.RecentAlarmResponse; | ||
| import com.todaysound.todaysound_server.domain.alarm.service.AlarmQueryService; | ||
| import com.todaysound.todaysound_server.domain.summary.service.SummaryCommandService; | ||
| import com.todaysound.todaysound_server.global.dto.PageRequestDTO; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/alarms") | ||
| @RequiredArgsConstructor | ||
| public class AlarmQueryController implements AlarmApi { | ||
|
|
||
| private final AlarmQueryService alarmQueryService; | ||
| private final SummaryCommandService summaryCommandService; | ||
|
|
||
| /** | ||
| * μ΅κ·Ό μλ¦Ό λͺ©λ‘ μ‘°ν | ||
| */ | ||
| @GetMapping() | ||
| @Override | ||
| public List<RecentAlarmResponse> getRecentAlarms( | ||
| @ModelAttribute final PageRequestDTO pageRequest, | ||
| @RequestHeader("X-User-ID") String userUuid, | ||
| @RequestHeader("X-Device-Secret") String deviceSecret) { | ||
|
|
||
| return alarmQueryService.getRecentAlarms(pageRequest, userUuid, deviceSecret); | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SummaryCommandServiceκ° μ£Όμ λμμ§λ§ μ΄ ν΄λμ€ λ΄μμ μ¬μ©λμ§ μμ΅λλ€. μ¬μ©νμ§ μλ μμ‘΄μ±μ μ κ±°νμ¬ μ½λμ λͺ νμ±μ λμ΄κ³ λΆνμν μμ ν λΉμ λ°©μ§νλ κ²μ΄ μ’μ΅λλ€.