테스트용 controller
package com.metacoding.storev1;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HelloController {
@GetMapping("/log/list")
public String t1() {
return "log/list";
}
@GetMapping("/store/list")
public String t2() {
return "store/list";
}
@GetMapping("/store/detail")
public String t3() {
return "store/detail";
}
@GetMapping("/store/save-form")
public String t4() {
return "store/save-form";
}
@GetMapping("/store/update-form")
public String t5() {
return "store/update-form";
}
}0. 헤더
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>blog</title>
</head>
<body>
<nav>
<ul>
<li>
<a href="#">상품목록</a>
</li>
<li>
<a href="#">상품등록</a>
</li>
<li>
<a href="#">구매목록</a>
</li>
</ul>
</nav>
<hr>1. 구매 기록
{{>layout/header}}
<section>
<table border="1">
<tr>
<th>주문번호</th>
<th>상품명(조인)</th>
<th>구매개수</th>
<th>총가격</th>
<th>구매자이름</th>
</tr>
<tr>
<td>1</td>
<td>바나나</td>
<td>5개</td>
<td>15000원</td>
<td>ssar</td>
</tr>
<tr>
<td>2</td>
<td>바나나</td>
<td>5개</td>
<td>15000원</td>
<td>ssar</td>
</tr>
<tr>
<td>3</td>
<td>딸기</td>
<td>5개</td>
<td>10000원</td>
<td>cos</td>
</tr>
</table>
</section>
</body>
</html>
2. 상품목록
{{>layout/header}}
<section>
<table border="1">
<tr>
<th>번호</th>
<th>상품명</th>
<th></th>
</tr>
<tr>
<td>1</td>
<td>바나나</td>
<td><a href="#">상세보기</a></td>
</tr>
<tr>
<td>2</td>
<td>딸기</td>
<td><a href="#">상세보기</a></td>
</tr>
</table>
</section>
</body>
</html>
3. 상품 상세보기
{{> layout/header}}
<section>
<a href="#">수정화면가기</a>
<form action="#">
<button type="submit">삭제</button>
</form>
<div>
번호 : 1 <br>
상품명 : 바나나 <br>
상품가격 : 3000원 <br>
상품재고 : 100개 <br>
</div>
<form action="#">
<input type="hidden" value="1">
<input type="text" placeholder="당신은 누구인가요?">
<input type="text" placeholder="Enter 개수">
<button type="submit">구매</button>
</form>
</section>
</body>
</html>
4. 상품 등록
{{> layout/header}}
<section>
<form action="#">
<input type="text" placeholder="상품명"><br>
<input type="text" placeholder="수량"><br>
<input type="text" placeholder="가격"><br>
<button type="submit">상품등록</button>
</form>
</section>
</body>
</html>
5. 상품 수정
{{> layout/header}}
<section>
<form action="#">
<input type="text" value="바나나"><br>
<input type="text" value="100"><br>
<input type="text" value="3000"><br>
<button type="submit">상품수정</button>
</form>
</section>
</body>
</html>
Share article