-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [etc] logger 추가 및 Exception logging 추가 (#71) * [etc] CODEOWNERS 수정 (#72) * Spring boot version 3.1.2 -> 3.1.6 (#73) * [refactor]cursor 기반 page 타입 변경 (#74) * [refactor] Swagger UI 라이브러리 변경: Spring REST docs -> Springdoc (#75) * Swagger UI 라이브러리 변경 - Spring REST docs -> Springdoc * 컨트롤러 인터페이스 분리 * Update src/main/resources/static/swagger-ui/openapi3.yaml Co-authored-by: 유도진 <[email protected]> * build.gradle 의존성 제거 * 인터페이스 이름 변경: ApiPresentation 추가 * 커버리지 체크 제외할 리스트 수정 * postfix 수정 * postfix 수정 * postfix 수정 * postfix 수정 * postfix수정 * REST doc 관련 의존성 및 파일 삭제 * 변경 사항 반영 * 리뷰 반영해서 수정 * 초깃값 동작 체크 --------- Co-authored-by: 유도진 <[email protected]> * [etc] version 수정 (#77) * [etc] storeId → cursor 수정 (#79) * [etc] version 수정 (#80) * swagger 수정 (#83) * [fix] redis 분리 및 api 추가 (#85) --------- Co-authored-by: Bokyeom <[email protected]> Co-authored-by: YOON <[email protected]> Co-authored-by: Gopistol <[email protected]> Co-authored-by: k-kbk <[email protected]>
- Loading branch information
1 parent
f953696
commit c19ef3b
Showing
8 changed files
with
42 additions
and
7 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 |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
<option name="Make" enabled="true" /> | ||
</method> | ||
</configuration> | ||
</component> | ||
</component> |
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
4 changes: 4 additions & 0 deletions
4
src/main/kotlin/com/mjucow/eatda/domain/notice/service/command/dto/CreateNoticeCommand.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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
package com.mjucow.eatda.domain.notice.service.command.dto | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
data class CreateNoticeCommand( | ||
@Schema(name = "title", example = "공지사항 제목") | ||
val title: String, | ||
@Schema(name = "content", example = "공지사항 내용") | ||
val content: String, | ||
) |
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
26 changes: 26 additions & 0 deletions
26
src/main/kotlin/com/mjucow/eatda/presentation/store/popularstore/PopularStoreController.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 |
---|---|---|
@@ -1,22 +1,48 @@ | ||
package com.mjucow.eatda.presentation.store.popularstore | ||
|
||
import com.mjucow.eatda.domain.poplarstore.service.PopularStoreCacheService | ||
import com.mjucow.eatda.domain.poplarstore.service.PopularStoreQueryService | ||
import com.mjucow.eatda.domain.poplarstore.service.dto.PopularStoreDtos | ||
import com.mjucow.eatda.presentation.common.ApiResponse | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.ResponseStatus | ||
import org.springframework.web.bind.annotation.RestController | ||
import java.time.Instant | ||
|
||
@RequestMapping("/api/v1/stores/popular") | ||
@RestController | ||
class PopularStoreController( | ||
private val cacheService: PopularStoreCacheService, | ||
private val queryService: PopularStoreQueryService, | ||
) : PopularStoreApiPresentation { | ||
@GetMapping | ||
@ResponseStatus(HttpStatus.OK) | ||
override fun findAllPopularStore(): ApiResponse<PopularStoreDtos> { | ||
return ApiResponse.success(queryService.getPopularStores()) | ||
} | ||
|
||
@PostMapping("/cache/{storeId}") | ||
@ResponseStatus(HttpStatus.NO_CONTENT) | ||
fun setRedis(@PathVariable storeId: String) { | ||
cacheService.setStore(Instant.now(), storeId.toLong()) | ||
} | ||
|
||
@GetMapping("/cache/{storeId}") | ||
@ResponseStatus(HttpStatus.OK) | ||
fun getRedis(@PathVariable storeId: String): ApiResponse<RedisCache?> { | ||
val key = cacheService.createSearchKey(Instant.now()) | ||
val popularStores = cacheService.getStoresSortByPopular(key) | ||
if (popularStores.isEmpty()) { | ||
return ApiResponse.success(null) | ||
} else { | ||
val e = popularStores[0] | ||
return ApiResponse.success(RedisCache(e.storeId, e.count)) | ||
} | ||
} | ||
|
||
data class RedisCache(val storeId: Long, val count: Long) | ||
} |
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