Skip to content

Commit

Permalink
feat #15: 출금 도메인 초기셋팅
Browse files Browse the repository at this point in the history
  • Loading branch information
shzero211 committed Nov 4, 2022
1 parent ae0fc60 commit 8814ba4
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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";
}
}
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -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<WithDraw,Long> {
}

0 comments on commit 8814ba4

Please sign in to comment.