-
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 #45 from TEAM-DHS/feat/program
[FEAT] 신청자 리스트 조회 API
- Loading branch information
Showing
10 changed files
with
160 additions
and
20 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/main/java/com/efub/dhs/domain/member/service/MemberService.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,23 @@ | ||
package com.efub.dhs.domain.member.service; | ||
|
||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.efub.dhs.domain.member.entity.Member; | ||
import com.efub.dhs.domain.member.repository.MemberRepository; | ||
import com.efub.dhs.global.utils.SecurityUtils; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Service | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class MemberService { | ||
private final MemberRepository memberRepository; | ||
|
||
public Member getCurrentUser() { | ||
String username = SecurityUtils.getCurrentUsername(); | ||
return memberRepository.findByUsername(username) | ||
.orElseThrow(() -> new IllegalArgumentException("해당 아이디의 회원을 찾을 수 없습니다.")); | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/efub/dhs/domain/registration/dto/PaymentDto.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,24 @@ | ||
package com.efub.dhs.domain.registration.dto; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class PaymentDto { | ||
|
||
private Boolean check; | ||
private String name; | ||
private LocalDateTime date; | ||
private String price; | ||
|
||
public PaymentDto(Boolean check, String name, LocalDateTime date, String price) { | ||
this.check = check; | ||
this.name = name; | ||
this.date = date; | ||
this.price = price; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/efub/dhs/domain/registration/dto/RefundDto.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,24 @@ | ||
package com.efub.dhs.domain.registration.dto; | ||
|
||
import com.efub.dhs.domain.registration.entity.RefundStatus; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class RefundDto { | ||
|
||
private String status; | ||
private String bank; | ||
private String account; | ||
private String name; | ||
|
||
public RefundDto(RefundStatus refundStatus, String bank, String account, String name) { | ||
this.status = RefundStatus.to(refundStatus); | ||
this.bank = bank; | ||
this.account = account; | ||
this.name = name; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/efub/dhs/domain/registration/dto/RegistrationResponseDto.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,28 @@ | ||
package com.efub.dhs.domain.registration.dto; | ||
|
||
import com.efub.dhs.domain.registration.entity.Registration; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class RegistrationResponseDto { | ||
|
||
private String name; | ||
private String phone; | ||
private PaymentDto payment; | ||
private RefundDto refund; | ||
|
||
public static RegistrationResponseDto from(Registration registration) { | ||
return new RegistrationResponseDto( | ||
registration.getRegistrantName(), | ||
registration.getRegistrantPhone(), | ||
new PaymentDto(registration.getDepositCheck(), registration.getDepositName(), | ||
registration.getDepositDate(), registration.getDepositAmount()), | ||
new RefundDto(registration.getRefundStatus(), registration.getRefundBank(), | ||
registration.getRefundAccount(), registration.getRefundName()) | ||
); | ||
} | ||
} |
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