-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from TEAM-DHS/feat/registration
[FEAT] 행사 참가 신청
- Loading branch information
Showing
17 changed files
with
182 additions
and
48 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
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
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
41 changes: 26 additions & 15 deletions
41
src/main/java/com/efub/dhs/domain/program/dto/response/ProgramRegistrationResponseDto.java
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,32 +1,43 @@ | ||
package com.efub.dhs.domain.program.dto.response; | ||
|
||
import com.efub.dhs.domain.program.dto.request.ProgramRegistrationRequestDto; | ||
import java.time.LocalDateTime; | ||
|
||
import com.efub.dhs.domain.registration.entity.RefundStatus; | ||
import com.efub.dhs.domain.registration.entity.Registration; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class ProgramRegistrationResponseDto { | ||
|
||
private long registrationId; | ||
private ProgramRegistrationRequestDto registrationInfo; | ||
private String depositorName; | ||
private String depositAmount; | ||
private LocalDateTime depositDate; | ||
private String registrantName; | ||
private String registrantPhone; | ||
private String refundBank; | ||
private String refundAccount; | ||
private String refundName; | ||
private String refundStatus; | ||
|
||
public static ProgramRegistrationResponseDto from(Registration registration) { | ||
return new ProgramRegistrationResponseDto( | ||
registration.getRegistrationId(), | ||
ProgramRegistrationRequestDto.builder() | ||
.depositorName(registration.getDepositName()) | ||
.depositAmount(registration.getDepositAmount()) | ||
.depositDate(registration.getDepositDate()) | ||
.registrantName(registration.getRegistrantName()) | ||
.registrantPhone(registration.getRegistrantPhone()) | ||
.refundBank(registration.getRefundBank()) | ||
.refundAccount(registration.getRefundAccount()) | ||
.refundName(registration.getRefundName()) | ||
.build() | ||
); | ||
return ProgramRegistrationResponseDto.builder() | ||
.registrationId(registration.getRegistrationId()) | ||
.depositorName(registration.getDepositName()) | ||
.depositAmount(registration.getDepositAmount()) | ||
.depositDate(registration.getDepositDate()) | ||
.registrantName(registration.getRegistrantName()) | ||
.registrantPhone(registration.getRegistrantPhone()) | ||
.refundBank(registration.getRefundBank()) | ||
.refundAccount(registration.getRefundAccount()) | ||
.refundName(registration.getRefundName()) | ||
.refundStatus(RefundStatus.to(registration.getRefundStatus())) | ||
.build(); | ||
} | ||
} |
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
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
36 changes: 36 additions & 0 deletions
36
src/main/java/com/efub/dhs/domain/registration/controller/RegistrationController.java
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.efub.dhs.domain.registration.controller; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.efub.dhs.domain.program.dto.response.ProgramRegistrationResponseDto; | ||
import com.efub.dhs.domain.registration.dto.RegistrationModificationRequestDto; | ||
import com.efub.dhs.domain.registration.entity.Registration; | ||
import com.efub.dhs.domain.registration.service.RegistrationService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/registrations") | ||
public class RegistrationController { | ||
|
||
private final RegistrationService registrationService; | ||
|
||
@GetMapping("/{registrationId}") | ||
public ProgramRegistrationResponseDto findRegistration(@PathVariable Long registrationId) { | ||
Registration registration = registrationService.findRegistration(registrationId); | ||
return ProgramRegistrationResponseDto.from(registration); | ||
} | ||
|
||
@PatchMapping("/{registrationId}") | ||
public ProgramRegistrationResponseDto modifyRegistration( | ||
@PathVariable Long registrationId, @RequestBody RegistrationModificationRequestDto requestDto) { | ||
Registration modifiedRegistration = registrationService.modifyRegistration(registrationId, requestDto); | ||
return ProgramRegistrationResponseDto.from(modifiedRegistration); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/efub/dhs/domain/registration/dto/RegistrationModificationRequestDto.java
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.efub.dhs.domain.registration.dto; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class RegistrationModificationRequestDto { | ||
|
||
private String registrantName; | ||
private String registrantPhone; | ||
private String refundBank; | ||
private String refundAccount; | ||
private String refundName; | ||
private String refundStatus; | ||
} |
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
Oops, something went wrong.