응원 전체보기 API 추가

This commit is contained in:
Klaus 2023-08-29 15:24:55 +09:00
parent ad66be3449
commit ed78959817
2 changed files with 24 additions and 0 deletions

View File

@ -96,4 +96,15 @@ class ExplorerController(private val service: ExplorerService) {
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
ApiResponse.ok(service.getFollowerList(creatorId, member, pageable))
}
@GetMapping("/profile/{id}/cheers")
fun getCreatorProfileCheers(
@PathVariable("id") creatorId: Long,
@RequestParam timezone: String,
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
pageable: Pageable
) = run {
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
ApiResponse.ok(service.getCreatorProfileCheers(creatorId, timezone, pageable))
}
}

View File

@ -353,6 +353,19 @@ class ExplorerService(
cheersRepository.save(cheers)
}
fun getCreatorProfileCheers(
creatorId: Long,
timezone: String,
pageable: Pageable
): GetCheersResponse {
return queryRepository.getCheersList(
creatorId = creatorId,
timezone = timezone,
offset = pageable.offset,
limit = pageable.pageSize.toLong()
)
}
@Transactional
fun modifyCheers(request: PutWriteCheersRequest, member: Member) {
val cheers = queryRepository.getCheers(request.cheersId, member.id!!)