Skip to content

Commit

Permalink
[+] withdrawal view 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
woody35545 committed Oct 15, 2023
1 parent ccc2654 commit 938f775
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.teamseven.MusicVillain.Notification.Notification;
import com.teamseven.MusicVillain.Record.Record;
import com.teamseven.MusicVillain.Record.RecordService;
import com.teamseven.MusicVillain.Withdrawal.Withdrawal;
import com.teamseven.MusicVillain.Withdrawal.WithdrawalRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
Expand All @@ -28,20 +30,28 @@ public class DatabaseViewContorller {
private final RecordService recordService;
private final InteractionService interactionService;
private final NotificationRepository notificationRepository;
private final WithdrawalRepository withdrawalRepository;

@Autowired
public DatabaseViewContorller(MemberService memberService, FeedService feedService,
RecordService recordService, InteractionService interactionService,
FeedRepository feedRepository, NotificationRepository notificationRepository,
MemberRepository memberRepository) {
MemberRepository memberRepository, WithdrawalRepository withdrawalRepository) {
this.memberService = memberService;
this.feedService = feedService;
this.recordService = recordService;
this.interactionService = interactionService;
this.feedRepository = feedRepository;
this.notificationRepository = notificationRepository;
this.memberRepository = memberRepository;
this.withdrawalRepository = withdrawalRepository;
}

@GetMapping("/view/withdrawals")
public String withdrawalView(Model model) {
List<Withdrawal> withdrawalList = withdrawalRepository.findAll();
model.addAttribute("withdrawalList", withdrawalList);
return "withdrawal_view";
}

@GetMapping("/view/members")
Expand Down
58 changes: 58 additions & 0 deletions src/main/resources/templates/withdrawal_view.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="kr" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>Withdrawals Table</title>
<style>

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: #f5f5f5;
padding: 20px;
}
h1 {
text-align: center;
}
table {
width: 100%;
border-collapse: collapse;
background-color: #ffffff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
th, td {
border: 1px solid #bcbcbc;
padding: 10px;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
text-transform: uppercase;
font-size: 12px;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
</style>
</head>
<body>
<h1> WITHDRAWAL TABLE VIEW </h1>
<table>
<thead>
<tr>
<th>withdrawal_id</th>
<th>reason</th>
<th>created_at</th>

</tr>
</thead>
<tbody>
<tr th:each="withdrawal : ${withdrawalList}">
<td th:text="${withdrawal.withdrawalId}"></td>
<td th:text="${withdrawal.reason}"></td>
<td th:text="${withdrawal.createdAt}"></td>
</tr>
</tbody>
</table>
</body>
</html>

0 comments on commit 938f775

Please sign in to comment.