diff --git a/plu-api/src/main/kotlin/com/th/plu/api/controller/answer/AnswerController.kt b/plu-api/src/main/kotlin/com/th/plu/api/controller/answer/AnswerController.kt index 622ed96..fa2d8fe 100644 --- a/plu-api/src/main/kotlin/com/th/plu/api/controller/answer/AnswerController.kt +++ b/plu-api/src/main/kotlin/com/th/plu/api/controller/answer/AnswerController.kt @@ -8,8 +8,8 @@ import com.th.plu.api.controller.answer.dto.response.AnswerInfoResponse import com.th.plu.api.controller.answer.dto.response.EveryAnswerInfoResponse import com.th.plu.api.controller.answer.dto.toAnswerWriting import com.th.plu.api.controller.answer.dto.toWritingAnswerResponse -import com.th.plu.common.dto.response.ApiResponse import com.th.plu.api.service.answer.AnswerService +import com.th.plu.common.dto.response.ApiResponse import com.th.plu.domain.domain.answer.dto.EveryAnswerRetrieveResponses import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag @@ -62,7 +62,7 @@ class AnswerController( @GetMapping("/v1/answers/info") fun findEveryAnswerInfo( ): ApiResponse { - return ApiResponse.success(answerService.findEveryAnswerInfo()) + return ApiResponse.success(answerService.findAllAnswerInfo()) } @Auth @@ -72,7 +72,7 @@ class AnswerController( @RequestParam(defaultValue = Long.MAX_VALUE.toString()) lastAnswerId: Long, @RequestParam(defaultValue = "10") pageSize: Long, ): ApiResponse { - return ApiResponse.success(answerService.findEveryAnswersWithCursor(lastAnswerId, pageSize)) + return ApiResponse.success(answerService.findAllAnswersWithCursor(lastAnswerId, pageSize)) } @Auth @@ -81,6 +81,6 @@ class AnswerController( fun getAnswersAboutLikeTopN( @RequestParam(defaultValue = "10") getCount: Long, ): ApiResponse { - return ApiResponse.success(answerService.findEveryAnswersLikeTopN(getCount)) + return ApiResponse.success(answerService.findAllAnswersLikeTopN(getCount)) } } \ No newline at end of file diff --git a/plu-api/src/main/kotlin/com/th/plu/api/service/answer/AnswerService.kt b/plu-api/src/main/kotlin/com/th/plu/api/service/answer/AnswerService.kt index 2f33526..8342712 100644 --- a/plu-api/src/main/kotlin/com/th/plu/api/service/answer/AnswerService.kt +++ b/plu-api/src/main/kotlin/com/th/plu/api/service/answer/AnswerService.kt @@ -63,21 +63,21 @@ class AnswerService( } @Transactional(readOnly = true) - fun findEveryAnswersWithCursor(lastAnswerId: Long, pageSize: Long): EveryAnswerRetrieveResponses { + fun findAllAnswersWithCursor(lastAnswerId: Long, pageSize: Long): EveryAnswerRetrieveResponses { val todayQuestionId = questionExplorer.findTodayQuestion().id val answers = answerRepository.findEveryAnswersWithCursorAndPageSize(todayQuestionId, lastAnswerId, pageSize) return EveryAnswerRetrieveResponses(answers) } @Transactional(readOnly = true) - fun findEveryAnswerInfo(): EveryAnswerInfoResponse { + fun findAllAnswerInfo(): EveryAnswerInfoResponse { val todayQuestion = questionExplorer.findTodayQuestion() val answerCount = answerRepository.findPublicAnswersCountByQuestionId(todayQuestion.id) return EveryAnswerInfoResponse.of(todayQuestion, answerCount) } - fun findEveryAnswersLikeTopN(getCount: Long): EveryAnswerRetrieveResponses { + fun findAllAnswersLikeTopN(getCount: Long): EveryAnswerRetrieveResponses { val todayQuestion = questionExplorer.findTodayQuestion() val answers = answerRepository.findPublicAnswersLikeTopN(todayQuestion.id, getCount)