add build.gradle dependencies(gson,poi,poi-ooxml) please refresh gradle

This commit is contained in:
Kana
2024-01-03 16:50:18 +09:00
parent 28eecf0f24
commit dac2f36cea
6 changed files with 44 additions and 4 deletions

View File

@@ -33,6 +33,12 @@ dependencies {
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper' implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:3.0.3' testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:3.0.3'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
// https://mvnrepository.com/artifact/org.apache.poi/poi
implementation group: 'org.apache.poi', name: 'poi', version: '5.2.3'
// https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.2.3'
} }
tasks.named('test') { tasks.named('test') {

View File

@@ -16,6 +16,16 @@ public class CategoryController {
@Autowired @Autowired
CategoryService categoryService; CategoryService categoryService;
// 테스트
@GetMapping("/category/test")
public String testpage(Model m) {
List<CategoryDto> dto = categoryService.selectAllCategory();
m.addAttribute("dto", dto);
return "category/test";
}
// 카테고리 리스트 출력 // 카테고리 리스트 출력
@GetMapping("/category/list") @GetMapping("/category/list")
public String list(@RequestParam(name="p", defaultValue = "1")int p, Model m) { public String list(@RequestParam(name="p", defaultValue = "1")int p, Model m) {

View File

@@ -10,7 +10,7 @@ public interface CategoryMapper {
List<CategoryDto> categoryList(Map<String, Object> m); List<CategoryDto> categoryList(Map<String, Object> m);
CategoryDto selectByKanCode(String kan_code); CategoryDto selectByKanCode(String kan_code);
int createProcess(CategoryDto dto); int createProcess(CategoryDto dto);
List<CategoryDto> selectAllCategory();
} }

View File

@@ -37,7 +37,9 @@ public class CategoryService {
return 1; return 1;
} }
public List<CategoryDto> selectAllCategory() {
return mapper.selectAllCategory();
}
} }

View File

@@ -31,9 +31,13 @@
order by kan_code desc limit #{start} , #{count} order by kan_code desc limit #{start} , #{count}
</select> </select>
<select id="selectByKancode" parameterType="String" resultType="CategoryDto"> <select id="selectByKanCode" parameterType="String" resultType="CategoryDto">
select * from product_category where kan_code = #{kan_code} select * from product_category where kan_code = #{kan_code}
</select> </select>
<select id="selectAllCategory" resultType="CategoryDto">
select * from product_category
</select>
</mapper> </mapper>

View File

@@ -0,0 +1,18 @@
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test상세페이지</title>
</head>
<body>
test success<br>
<hr>
<c:forEach items="${dto }" var="item">
${item.kan_code} : ${item.cls_nm_1} > ${item.cls_nm_2} > ${item.cls_nm_3} > ${item.cls_nm_4}<br>
활성화 : ${item.activation}<br>
<hr>
</c:forEach>
</body>
</html>