Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/main/kotlin/upbrella/be/rent/controller/RentController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ class RentController(
@GetMapping("/return/form/{storeId}")
fun findReturnForm(
@PathVariable storeId: Long,
httpSession: HttpSession,
@RequestParam(required = false) salt: String?,
@RequestParam(required = false) signature: String?
httpSession: HttpSession
): ResponseEntity<CustomResponse<ReturnFormResponse>> {
val user = httpSession.getAttribute("user") as SessionUser
val userToReturn = userReader.findUserById(user.id)

val returnForm = rentService.findReturnForm(storeId, userToReturn, salt!!, signature!!)
val returnForm = rentService.findReturnForm(storeId, userToReturn)

return ResponseEntity
.ok()
Expand Down
5 changes: 1 addition & 4 deletions src/main/kotlin/upbrella/be/rent/service/RentService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ class RentService(

fun findReturnForm(
storeId: Long,
userToReturn: User,
salt: String,
signature: String
userToReturn: User
): ReturnFormResponse {
val storeMeta: StoreMeta = storeMetaReader.findById(storeId)
lockerService.validateLockerSignature(storeMeta.id!!, salt, signature)
val history = rentRepository.findByUserIdAndReturnedAtIsNull(userToReturn.id!!)
.orElseThrow { NonExistingUmbrellaForRentException("[ERROR] 해당 유저가 대여 중인 우산이 없습니다.") }
return ReturnFormResponse.of(storeMeta, history)
Expand Down
10 changes: 2 additions & 8 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@

<!-- prod 환경에서만 파일로 저장 -->
<springProfile name="prod">
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/home/ubuntu/upbrella-log/upbrella.log</file>

<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>/home/ubuntu/upbrella-log/upbrella.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/>
</root>
</springProfile>

Expand Down
Loading