Skip to content

Commit

Permalink
📝 UserAdapter 에 포인트 정보 불러오기 api 관련 함수 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuuuuuk committed Mar 25, 2024
1 parent 16a669f commit c67188f
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package andreas311.miso.domain.user.adapter.input

import andreas311.miso.common.annotation.RequestController
import andreas311.miso.domain.user.adapter.input.data.response.PointResponse
import andreas311.miso.domain.user.adapter.input.data.response.UserInfoResponse
import andreas311.miso.domain.user.adapter.input.mapper.UserDataMapper
import andreas311.miso.domain.user.application.port.input.GetPointUseCase
import andreas311.miso.domain.user.application.port.input.UserInfoUseCase
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
Expand All @@ -11,11 +13,18 @@ import org.springframework.web.bind.annotation.GetMapping
@RequestController("/user")
class UserAdapter(
private val userDataMapper: UserDataMapper,
private val userInfoUseCase: UserInfoUseCase
private val userInfoUseCase: UserInfoUseCase,
private val getPointUseCase: GetPointUseCase,
) {
@GetMapping
fun userInfo(): ResponseEntity<UserInfoResponse> =
userInfoUseCase.execute()
.let { userDataMapper.toResponse(it) }
.let { ResponseEntity.status(HttpStatus.OK).body(it) }

@GetMapping("/point")
fun getPoint(): ResponseEntity<PointResponse> =
getPointUseCase.execute()
.let { userDataMapper.toResponse(it) }
.let { ResponseEntity.status(HttpStatus.OK).body(it) }
}

0 comments on commit c67188f

Please sign in to comment.