From 8814ba493f526fb253b05c63f40d5ca05162e301 Mon Sep 17 00:00:00 2001 From: SangHun Date: Fri, 4 Nov 2022 15:49:07 +0900 Subject: [PATCH] =?UTF-8?q?feat=20#15:=20=20=EC=B6=9C=EA=B8=88=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=B4=88=EA=B8=B0=EC=85=8B=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WithDrawController.java | 38 +++++++++++++++++++ .../app/withdraw/entity/WithDraw.java | 34 +++++++++++++++++ .../repository/WithDrawRepository.java | 7 ++++ 3 files changed, 79 insertions(+) create mode 100644 3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/controller/WithDrawController.java create mode 100644 3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/entity/WithDraw.java create mode 100644 3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/repository/WithDrawRepository.java diff --git a/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/controller/WithDrawController.java b/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/controller/WithDrawController.java new file mode 100644 index 0000000..1f3150a --- /dev/null +++ b/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/controller/WithDrawController.java @@ -0,0 +1,38 @@ +package com.ebook.multbooks.app.withdraw.controller; + +import com.ebook.multbooks.global.rq.Rq; +import lombok.RequiredArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import javax.validation.Valid; + +@RequestMapping("/withdraw") +@RequiredArgsConstructor +@Controller +public class WithDrawController { + private final Rq rq; + + /* + * 출금 페이지로 이동 + * */ + @PreAuthorize("isAuthenticated()") + @GetMapping("/apply") + public String showApply(Model model){ + + return "withdraw/apply"; + } + /* + * 출금 처리 후 + * 내역으로 이동 + * */ + @PreAuthorize("isAuthenticated()") + @PostMapping("/apply") + public String apply(){ + return "withdraw/list"; + } +} diff --git a/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/entity/WithDraw.java b/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/entity/WithDraw.java new file mode 100644 index 0000000..37b4013 --- /dev/null +++ b/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/entity/WithDraw.java @@ -0,0 +1,34 @@ +package com.ebook.multbooks.app.withdraw.entity; + +import com.ebook.multbooks.app.base.entity.BaseEntity; +import com.ebook.multbooks.app.base.entity.BaseTimeEntity; +import com.ebook.multbooks.app.cash.entity.CashLog; +import com.ebook.multbooks.app.member.entity.Member; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.ManyToOne; +import java.time.LocalDateTime; + +@SuperBuilder +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Entity +public class WithDraw extends BaseEntity { + private int price; + private String bankName; + private String bankAccount; + private LocalDateTime WithDrawDate; + + @ManyToOne(fetch = FetchType.LAZY) + private Member member; + + @ManyToOne(fetch = FetchType.LAZY) + private CashLog cashLog; + +} diff --git a/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/repository/WithDrawRepository.java b/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/repository/WithDrawRepository.java new file mode 100644 index 0000000..50148ba --- /dev/null +++ b/3_Week_Mission/multbooks/src/main/java/com/ebook/multbooks/app/withdraw/repository/WithDrawRepository.java @@ -0,0 +1,7 @@ +package com.ebook.multbooks.app.withdraw.repository; + +import com.ebook.multbooks.app.withdraw.entity.WithDraw; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface WithDrawRepository extends JpaRepository { +}