diff --git a/src/main/java/com/groom/wisebab/config/SecurityConfig.java b/src/main/java/com/groom/wisebab/config/SecurityConfig.java index e34c20a..87c6dd5 100644 --- a/src/main/java/com/groom/wisebab/config/SecurityConfig.java +++ b/src/main/java/com/groom/wisebab/config/SecurityConfig.java @@ -3,21 +3,18 @@ import com.groom.wisebab.jwt.JWTFilter; import com.groom.wisebab.jwt.JWTUtil; import com.groom.wisebab.jwt.LoginFilter; +import com.groom.wisebab.service.MemberService; import jakarta.servlet.http.HttpServletRequest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.config.annotation.SecurityBuilder; import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; -import org.springframework.security.config.annotation.web.WebSecurityConfigurer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.SecurityFilterChain; -import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; diff --git a/src/main/java/com/groom/wisebab/controller/MemberController.java b/src/main/java/com/groom/wisebab/controller/MemberController.java index 71aed33..40ff899 100644 --- a/src/main/java/com/groom/wisebab/controller/MemberController.java +++ b/src/main/java/com/groom/wisebab/controller/MemberController.java @@ -5,6 +5,7 @@ import com.groom.wisebab.dto.email.EmailCertifyDTO; import com.groom.wisebab.dto.member.MemberResponseDTO; import com.groom.wisebab.dto.member.SignUpDTO; +import com.groom.wisebab.jwt.JWTUtil; import com.groom.wisebab.service.MemberService; import com.univcert.api.UnivCert; import lombok.RequiredArgsConstructor; @@ -25,6 +26,7 @@ public class MemberController { private final MemberService memberService; private final String UnivCertKEY = "48ad7af1-31bc-4c1f-ad01-f06001a618da"; + private final JWTUtil jwtUtil; @PostMapping("/signup") public Long signUp(SignUpDTO signUpDTO) { @@ -47,12 +49,22 @@ public ResponseEntity findMemberById(@PathVariable Long membe return ResponseEntity.ok(memberResponseDTO); } + @GetMapping("/members/{memberUsername}") + public ResponseEntity findMemberByUsername(@PathVariable String memberUsername) { + Member member = memberService.findMemberByUsername(memberUsername); + MemberResponseDTO memberResponseDTO = new MemberResponseDTO(member.getId(), member.getUsername(), member.getNickname()); + return ResponseEntity.ok(memberResponseDTO); + } + + + // UnivCert API를 통해 가입하려는 회원의 대학교 이메일로 인증 코드 전송 @PostMapping("/verification") public Map emailVerification(@RequestBody EmailCertifyDTO emailCertifyDTO) throws IOException { return UnivCert.certify(UnivCertKEY, emailCertifyDTO.getEmail(), emailCertifyDTO.getUnivName(), true); } + // 이메일로 보낸 인증코드와 사용자가 입력한 코드가 일치하는지 검증 @PostMapping("/verificationCode") public Map emailCodeVerification(@RequestBody EmailCertifyCodeDTO emailCertifyCodeDTO) throws IOException { return UnivCert.certifyCode(UnivCertKEY, emailCertifyCodeDTO.getEmail(), emailCertifyCodeDTO.getUnivName(), emailCertifyCodeDTO.getCode()); diff --git a/src/main/java/com/groom/wisebab/controller/PreferTimetableController.java b/src/main/java/com/groom/wisebab/controller/PreferTimetableController.java index a7d3d14..12ad6a4 100644 --- a/src/main/java/com/groom/wisebab/controller/PreferTimetableController.java +++ b/src/main/java/com/groom/wisebab/controller/PreferTimetableController.java @@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.*; import java.util.List; -import java.util.Optional; @RestController @RequiredArgsConstructor @@ -24,6 +23,7 @@ public class PreferTimetableController { private final MemberService memberService; private final PromiseService promiseService; + // 약속 선호 시간 생성 @PostMapping("/promises/{promiseId}/members/{memberId}") public Long createPreferTimetable(@PathVariable Long promiseId, @PathVariable Long memberId, @RequestBody List preferTimetableDTOS) { Promise promise = promiseService.findPromiseById(promiseId) @@ -38,6 +38,7 @@ public Long createPreferTimetable(@PathVariable Long promiseId, @PathVariable Lo return preferTimetableService.createPreferTimetable(promise, member, preferTimetableDTOS); } + // 약속에서 해당 회원이 제출한 선호 시간표 조회 @GetMapping("/promises/{promiseId}/members/{memberId}") public ResponseEntity> findTimetableByPromiseAndMember(@PathVariable Long promiseId, @PathVariable Long memberId) { log.info("컨트롤러 진입"); @@ -52,7 +53,7 @@ public ResponseEntity> findTimetableByPromiseAndMember( ); log.info("회원 조회 완료"); List preferTimetableDTOS = preferTimetableService.findTimetableByPromiseAndMember(promise, member); - log.info("리턴 직전"); + log.info("DTO에 담기 성공"); return ResponseEntity.ok(preferTimetableDTOS); } } diff --git a/src/main/java/com/groom/wisebab/controller/PromiseController.java b/src/main/java/com/groom/wisebab/controller/PromiseController.java index 4f4bb93..0114f4b 100644 --- a/src/main/java/com/groom/wisebab/controller/PromiseController.java +++ b/src/main/java/com/groom/wisebab/controller/PromiseController.java @@ -9,12 +9,10 @@ import com.groom.wisebab.service.PromiseService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.coyote.Response; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; -import java.util.Optional; import java.util.UUID; @RestController @@ -56,16 +54,19 @@ public ResponseEntity> findAllPromiseByMemberAndSta return ResponseEntity.ok(promiseListResponseDTOList); } + // 대기중인 약속 -> 확정된 약속 @PatchMapping("/promises/{promiseId}/confirmation") public Long updateToConfirmed(@PathVariable Long promiseId, @RequestBody UpdateToConfirmedDTO updateToConfirmedDTO) { return promiseService.changeStatusToConfirmed(promiseId, updateToConfirmedDTO); } + // 확정된 약속 -> 만료된 약속 @PatchMapping("/promises/{promiseId}/termination") public Long updateToExpired(@PathVariable Long promiseId, @RequestBody UpdateToExpiredDTO updateToExpiredDTO) { return promiseService.changeStatusToExpired(promiseId, updateToExpiredDTO); } + // 약속의 초대 링크 조회 @GetMapping("/promises/{promiseId}/link") public ResponseEntity getPromiseLink(@PathVariable Long promiseId) { Promise promise = promiseService.findPromiseById(promiseId) @@ -79,6 +80,7 @@ public ResponseEntity getPromiseLink(@PathVariable Long promiseI return ResponseEntity.ok(promiseLinkDTO); } + // uuid로 이루어진 초대링크를 접속하면 그 회원을 약속 파티원으로 추가 @PostMapping("/members/{memberId}/promises/{uuid}") public Long memberParticipation(@PathVariable Long memberId, @PathVariable UUID uuid) { Member member = memberService.findMemberById(memberId) @@ -88,4 +90,12 @@ public Long memberParticipation(@PathVariable Long memberId, @PathVariable UUID return promiseService.memberParticipation(member, uuid); } + // 약속의 송금 정보 조회 + @GetMapping("/promises/{promiseId}/payment") + public ResponseEntity getPaymentInfo(@PathVariable Long promiseId) { + PromisePaymentResponseDTO promisePaymentResponseDTO = promiseService.getPaymentInfo(promiseId); + + return ResponseEntity.ok(promisePaymentResponseDTO); + } + } diff --git a/src/main/java/com/groom/wisebab/domain/Member.java b/src/main/java/com/groom/wisebab/domain/Member.java index b6c8902..73969f5 100644 --- a/src/main/java/com/groom/wisebab/domain/Member.java +++ b/src/main/java/com/groom/wisebab/domain/Member.java @@ -31,12 +31,6 @@ public class Member { //member이 연관관계 주인 @OneToMany(mappedBy = "member", cascade = CascadeType.ALL) private List promises = new ArrayList<>(); -/* - //member이 연관관계 주인 - @OneToMany(mappedBy = "owner", cascade = CascadeType.ALL, orphanRemoval = true) - private List ownerPromises = new ArrayList<>(); - - */ public Member(String username, String password, String nickname, String role) { this.username = username; diff --git a/src/main/java/com/groom/wisebab/domain/Promise.java b/src/main/java/com/groom/wisebab/domain/Promise.java index 511f8ce..068a6c7 100644 --- a/src/main/java/com/groom/wisebab/domain/Promise.java +++ b/src/main/java/com/groom/wisebab/domain/Promise.java @@ -20,11 +20,7 @@ public class Promise { private Long id; private String title; -/* - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "member_id") - private Member owner; - */ + private Long ownerId; //promise가 연관관계 주인 @@ -38,13 +34,6 @@ public class Promise { private String locAddress; - /* - //컬렉션 객체로 저장 - @ElementCollection - @CollectionTable(name = "confirmed_time", joinColumns = @JoinColumn(name = "promise_id")) - private List confirmedTime = new ArrayList<>(); - */ - private LocalDate confirmedDate; private String confirmedTime; @@ -57,29 +46,36 @@ public class Promise { private LocalDate startDate; + private LocalDate endDate; + private String memo; @Column(columnDefinition = "BINARY(16)") private UUID uuid; - public Promise(String title, Long ownerId, String locName, String locAddress, LocalDate startDate, String memo) { + //생성자 + public Promise(String title, Long ownerId, String locName, String locAddress, LocalDate startDate, LocalDate endDate, String memo) { this.title = title; this.ownerId = ownerId; this.state = State.PENDING; this.locName = locName; this.locAddress = locAddress; this.startDate = startDate; + this.endDate = endDate; this.memo = memo; this.uuid = UUID.randomUUID(); } + //대기중인 약속 -> 확정된 약속으로 변경하는 메서드 public void updateToConfirmed(LocalDate confirmedDate, String confirmedTime) { this.state = State.CONFIRMED; this.confirmedDate = confirmedDate; this.confirmedTime = confirmedTime; } + //확정된 약속 -> 만료된 약속으로 변경하는 메서드 public void updateToExpired(String bankAccount, String kakaopayLink, String payMemo) { + this.state = State.EXPIRED; this.bankAccount = bankAccount; this.kakaopayLink = kakaopayLink; this.payMemo = payMemo; diff --git a/src/main/java/com/groom/wisebab/dto/member/CustomUserDetails.java b/src/main/java/com/groom/wisebab/dto/member/CustomUserDetails.java index 510daec..5dd8fce 100644 --- a/src/main/java/com/groom/wisebab/dto/member/CustomUserDetails.java +++ b/src/main/java/com/groom/wisebab/dto/member/CustomUserDetails.java @@ -1,7 +1,6 @@ package com.groom.wisebab.dto.member; import com.groom.wisebab.domain.Member; -import lombok.RequiredArgsConstructor; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; diff --git a/src/main/java/com/groom/wisebab/dto/member/MemberResponseDTO.java b/src/main/java/com/groom/wisebab/dto/member/MemberResponseDTO.java index 3f5ee52..d0c655b 100644 --- a/src/main/java/com/groom/wisebab/dto/member/MemberResponseDTO.java +++ b/src/main/java/com/groom/wisebab/dto/member/MemberResponseDTO.java @@ -9,6 +9,10 @@ @AllArgsConstructor public class MemberResponseDTO { + /** + * 멤버 정보 조회 DTO + */ + private Long id; private String username; diff --git a/src/main/java/com/groom/wisebab/dto/promise/PromiseDTO.java b/src/main/java/com/groom/wisebab/dto/promise/PromiseDTO.java index c393058..719c0cd 100644 --- a/src/main/java/com/groom/wisebab/dto/promise/PromiseDTO.java +++ b/src/main/java/com/groom/wisebab/dto/promise/PromiseDTO.java @@ -24,5 +24,7 @@ public class PromiseDTO { private LocalDate startDate; + private LocalDate endDate; + private String memo; } diff --git a/src/main/java/com/groom/wisebab/dto/promise/PromiseDetailResponseDTO.java b/src/main/java/com/groom/wisebab/dto/promise/PromiseDetailResponseDTO.java index 644916c..757e81d 100644 --- a/src/main/java/com/groom/wisebab/dto/promise/PromiseDetailResponseDTO.java +++ b/src/main/java/com/groom/wisebab/dto/promise/PromiseDetailResponseDTO.java @@ -3,9 +3,7 @@ import com.groom.wisebab.domain.State; import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.RequiredArgsConstructor; import lombok.Setter; -import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDate; import java.util.List; @@ -38,6 +36,10 @@ public class PromiseDetailResponseDTO { private String locAddress; + private LocalDate startDate; + + private LocalDate endDate; + private String memo; private List participants; diff --git a/src/main/java/com/groom/wisebab/dto/promise/PromisePaymentResponseDTO.java b/src/main/java/com/groom/wisebab/dto/promise/PromisePaymentResponseDTO.java new file mode 100644 index 0000000..22858f3 --- /dev/null +++ b/src/main/java/com/groom/wisebab/dto/promise/PromisePaymentResponseDTO.java @@ -0,0 +1,21 @@ +package com.groom.wisebab.dto.promise; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class PromisePaymentResponseDTO { + + /** + * 송금 정보 조회 + */ + + private String payMemo; + + private String kakaopayLink; + + private String bankAccount; +} diff --git a/src/main/java/com/groom/wisebab/jwt/LoginFilter.java b/src/main/java/com/groom/wisebab/jwt/LoginFilter.java index b7f984b..084a211 100644 --- a/src/main/java/com/groom/wisebab/jwt/LoginFilter.java +++ b/src/main/java/com/groom/wisebab/jwt/LoginFilter.java @@ -1,9 +1,12 @@ package com.groom.wisebab.jwt; +import com.groom.wisebab.domain.Member; import com.groom.wisebab.dto.member.CustomUserDetails; +import com.groom.wisebab.service.MemberService; import jakarta.servlet.FilterChain; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; @@ -14,17 +17,12 @@ import java.util.Collection; import java.util.Iterator; +@RequiredArgsConstructor public class LoginFilter extends UsernamePasswordAuthenticationFilter { private final AuthenticationManager authenticationManager; private final JWTUtil jwtUtil; - public LoginFilter(AuthenticationManager authenticationManager, JWTUtil jwtUtil) { - - this.authenticationManager = authenticationManager; - this.jwtUtil = jwtUtil; - } - @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { diff --git a/src/main/java/com/groom/wisebab/repository/MemberRepository.java b/src/main/java/com/groom/wisebab/repository/MemberRepository.java index 25ca9ed..3ba7952 100644 --- a/src/main/java/com/groom/wisebab/repository/MemberRepository.java +++ b/src/main/java/com/groom/wisebab/repository/MemberRepository.java @@ -6,7 +6,7 @@ import java.util.Optional; public interface MemberRepository extends JpaRepository { - Member findByUsername(String username); + Optional findByUsername(String username); Member findByNickname(String nickname); } diff --git a/src/main/java/com/groom/wisebab/service/CustomUserDetailsService.java b/src/main/java/com/groom/wisebab/service/CustomUserDetailsService.java index 9d58058..be73020 100644 --- a/src/main/java/com/groom/wisebab/service/CustomUserDetailsService.java +++ b/src/main/java/com/groom/wisebab/service/CustomUserDetailsService.java @@ -18,7 +18,10 @@ public class CustomUserDetailsService implements UserDetailsService { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { - Member userData = memberRepository.findByUsername(username); + Member userData = memberRepository.findByUsername(username) + .orElseThrow( + NullPointerException::new + ); if (userData != null) { return new CustomUserDetails(userData); diff --git a/src/main/java/com/groom/wisebab/service/MemberService.java b/src/main/java/com/groom/wisebab/service/MemberService.java index d04c643..904e7b9 100644 --- a/src/main/java/com/groom/wisebab/service/MemberService.java +++ b/src/main/java/com/groom/wisebab/service/MemberService.java @@ -30,16 +30,6 @@ public Long createMember(SignUpDTO signUpDTO) { return member.getId(); } - - - public Member findMemberByUsername(String username) { - return memberRepository.findByUsername(username); - } - - public Member findMemberByNickname(String nickname) { - return memberRepository.findByNickname(nickname); - } - public Optional findMemberById(Long id) { return memberRepository.findById(id); } @@ -47,4 +37,11 @@ public Optional findMemberById(Long id) { public MemberResponseDTO convertToDTO(Member member) { return new MemberResponseDTO(member.getId(), member.getUsername(), member.getNickname()); } + + public Member findMemberByUsername(String username) { + return memberRepository.findByUsername(username) + .orElseThrow( + NullPointerException::new + ); + } } diff --git a/src/main/java/com/groom/wisebab/service/PreferTimetableService.java b/src/main/java/com/groom/wisebab/service/PreferTimetableService.java index 2ed8c0c..8b4d275 100644 --- a/src/main/java/com/groom/wisebab/service/PreferTimetableService.java +++ b/src/main/java/com/groom/wisebab/service/PreferTimetableService.java @@ -22,6 +22,7 @@ public class PreferTimetableService { private final PreferTimetableRepository preferTimetableRepository; + // 선호 시간표 제출 시 preferTimeTable 생성 @Transactional public Long createPreferTimetable(Promise promise, Member member, List timetableDTOS) { List timetables = flatPreferTimetable(timetableDTOS); @@ -31,6 +32,7 @@ public Long createPreferTimetable(Promise promise, Member member, List findTimetableByPromiseAndMember(Promise promise, Member member) { PreferTimetable preferTimeTable = preferTimetableRepository.findPreferTimeTableByPromiseAndMember(promise, member); return unflatPreferTimetable(promise.getStartDate(), preferTimeTable.getPreferTime()); diff --git a/src/main/java/com/groom/wisebab/service/PromiseMemberService.java b/src/main/java/com/groom/wisebab/service/PromiseMemberService.java index 707b994..479dbb4 100644 --- a/src/main/java/com/groom/wisebab/service/PromiseMemberService.java +++ b/src/main/java/com/groom/wisebab/service/PromiseMemberService.java @@ -4,13 +4,11 @@ import com.groom.wisebab.domain.PromiseMember; import com.groom.wisebab.domain.State; import com.groom.wisebab.repository.PromiseMemberRepository; -import com.groom.wisebab.repository.PromiseRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; -import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -20,10 +18,12 @@ public class PromiseMemberService { private final PromiseMemberRepository promiseMemberRepository; + // memberId로 promiseMember 배열을 반환 public List findAllByMemberId(Long memberId) { return promiseMemberRepository.findAllByMemberId(memberId); } + // 회원이 참가하는 약속들을 상태에 따라 promise 배열로 반환 public List findAllByMemberIdAndState(Long memberId, State state) { List findPromise = findAllByMemberId(memberId); return findPromise.stream() diff --git a/src/main/java/com/groom/wisebab/service/PromiseService.java b/src/main/java/com/groom/wisebab/service/PromiseService.java index e72b01e..75db5ec 100644 --- a/src/main/java/com/groom/wisebab/service/PromiseService.java +++ b/src/main/java/com/groom/wisebab/service/PromiseService.java @@ -29,13 +29,14 @@ public class PromiseService { private final PromiseMemberRepository promiseMemberRepository; private final PreferTimetableRepository preferTimetableRepository; + // 약속 생성 @Transactional public Long createPromise(PromiseDTO promiseDTO) { Member owner = memberRepository.findById(promiseDTO.getOwnerId()) .orElseThrow( NullPointerException::new ); - Promise promise = new Promise(promiseDTO.getTitle(), owner.getId(), promiseDTO.getLocName(), promiseDTO.getLocAddress(), promiseDTO.getStartDate(), promiseDTO.getMemo()); + Promise promise = new Promise(promiseDTO.getTitle(), owner.getId(), promiseDTO.getLocName(), promiseDTO.getLocAddress(), promiseDTO.getStartDate(), promiseDTO.getEndDate(), promiseDTO.getMemo()); promiseRepository.save(promise); PromiseMember promiseMember = new PromiseMember(promise, owner); @@ -47,14 +48,12 @@ public Long createPromise(PromiseDTO promiseDTO) { return promise.getId(); } + // PromiseId를 통해 약속 조회 public Optional findPromiseById(Long id) { return promiseRepository.findById(id); } - public List findAllPromiseByState(State state) { - return promiseRepository.findAllByState(state); - } - + // 약속 리스트 DTO로 변환 public List converToDTOList(List promises) { return promises.stream() .map(promise -> new PromiseListResponseDTO( @@ -72,6 +71,7 @@ public List converToDTOList(List promises) { .collect(Collectors.toList()); } + // 약속 상세정보 DTO로 변환 public PromiseDetailResponseDTO convertToDTO(Long promiseId, Long memberId) { Promise promise = promiseRepository.findById(promiseId) .orElseThrow( @@ -97,9 +97,10 @@ public PromiseDetailResponseDTO convertToDTO(Long promiseId, Long memberId) { boolean allResponded = confirmedPeopleCount == promise.getMemberList().size(); - return new PromiseDetailResponseDTO(promise.getId(), promise.getState(), promise.getTitle(), owner.getNickname(), isLeader, promise.getConfirmedDate(), promise.getConfirmedTime(), promise.getLocName(), promise.getLocAddress(), promise.getMemo(), promiseMembersInnerResponseDTOS, confirmedPeopleCount, allResponded); + return new PromiseDetailResponseDTO(promise.getId(), promise.getState(), promise.getTitle(), owner.getNickname(), isLeader, promise.getConfirmedDate(), promise.getConfirmedTime(), promise.getLocName(), promise.getLocAddress(), promise.getStartDate(), promise.getEndDate(), promise.getMemo(), promiseMembersInnerResponseDTOS, confirmedPeopleCount, allResponded); } + // 대기중인 약속 -> 확정된 약속으로 @Transactional public Long changeStatusToConfirmed(Long promiseId, UpdateToConfirmedDTO updateToConfirmedDTO) { Promise promise = promiseRepository.findById(promiseId) @@ -111,6 +112,7 @@ public Long changeStatusToConfirmed(Long promiseId, UpdateToConfirmedDTO updateT return promise.getId(); } + // 확정된 약속 -> 만료된 약속 @Transactional public Long changeStatusToExpired(Long promiseId, UpdateToExpiredDTO updateToExpiredDTO) { Promise promise = promiseRepository.findById(promiseId) @@ -122,6 +124,7 @@ public Long changeStatusToExpired(Long promiseId, UpdateToExpiredDTO updateToExp return promise.getId(); } + // 초대링크(UUID)로 들어오는 회원을 참가시키는 메서드 @Transactional public Long memberParticipation(Member member, UUID uuid) { Promise promise = promiseRepository.findPromiseByUuid(uuid); @@ -132,4 +135,13 @@ public Long memberParticipation(Member member, UUID uuid) { return savedPromiseMember.getPromise().getId(); } + + // 송금 정보 조회 + public PromisePaymentResponseDTO getPaymentInfo(Long promiseId) { + Promise promise = promiseRepository.findById(promiseId) + .orElseThrow( + NullPointerException::new + ); + return new PromisePaymentResponseDTO(promise.getPayMemo(), promise.getKakaopayLink(), promise.getBankAccount()); + } }