-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from Weit-2nd/feature/ROFO-181
�ROFO 181 리포트 랭킹 구현, 조회 api 개발
- Loading branch information
Showing
13 changed files
with
317 additions
and
25 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
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
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/kr/weit/roadyfoody/global/config/SchedulingConfig.kt
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,8 @@ | ||
package kr.weit.roadyfoody.global.config | ||
|
||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.scheduling.annotation.EnableScheduling | ||
|
||
@EnableScheduling | ||
@Configuration | ||
class SchedulingConfig |
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
23 changes: 23 additions & 0 deletions
23
src/main/kotlin/kr/weit/roadyfoody/ranking/presentation/api/RankingController.kt
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,23 @@ | ||
package kr.weit.roadyfoody.ranking.presentation.api | ||
|
||
import jakarta.validation.constraints.Positive | ||
import kr.weit.roadyfoody.foodSpots.application.dto.UserReportCount | ||
import kr.weit.roadyfoody.foodSpots.application.service.FoodSpotsCommandService | ||
import kr.weit.roadyfoody.ranking.presentation.spec.RankingControllerSpec | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RequestParam | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
@RestController | ||
@RequestMapping("/api/v1/ranking") | ||
class RankingController( | ||
private val foodSpotsCommandService: FoodSpotsCommandService, | ||
) : RankingControllerSpec { | ||
@GetMapping("/report") | ||
override fun getReportRanking( | ||
@Positive(message = "size는 양수여야 합니다.") | ||
@RequestParam(defaultValue = "10") | ||
size: Long, | ||
): List<UserReportCount> = foodSpotsCommandService.getReportRanking(size) | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/kotlin/kr/weit/roadyfoody/ranking/presentation/spec/RankingControllerSpec.kt
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,40 @@ | ||
package kr.weit.roadyfoody.ranking.presentation.spec | ||
|
||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.media.Content | ||
import io.swagger.v3.oas.annotations.media.Schema | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse | ||
import io.swagger.v3.oas.annotations.tags.Tag | ||
import jakarta.validation.constraints.Positive | ||
import kr.weit.roadyfoody.foodSpots.application.dto.UserReportCount | ||
import kr.weit.roadyfoody.global.swagger.v1.SwaggerTag | ||
import org.springframework.http.MediaType | ||
import org.springframework.web.bind.annotation.RequestParam | ||
|
||
@Tag(name = SwaggerTag.RANKING) | ||
interface RankingControllerSpec { | ||
@Operation( | ||
description = "리포트 랭킹 조회 API", | ||
responses = [ | ||
ApiResponse( | ||
responseCode = "200", | ||
description = "리포트 랭킹 조회 성공", | ||
content = [ | ||
Content( | ||
mediaType = MediaType.APPLICATION_JSON_VALUE, | ||
schema = | ||
Schema( | ||
implementation = UserReportCount::class, | ||
), | ||
), | ||
], | ||
), | ||
|
||
], | ||
) | ||
fun getReportRanking( | ||
@Positive(message = "size는 양수여야 합니다.") | ||
@RequestParam(defaultValue = "10") | ||
size: Long, | ||
): List<UserReportCount> | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/resources/db/migration/V17__alter_composite_index_food_spots_histories.sql
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,4 @@ | ||
DROP INDEX FOOD_SPOTS_HISTORIES_ID_USER_ID_INDEX; | ||
|
||
CREATE INDEX FOOD_SPOTS_HISTORIES_USER_ID_CREATED_DATETIME_INDEX | ||
ON FOOD_SPOTS_HISTORIES(USER_ID, CREATED_DATETIME) |
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
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.