tiles * 일때 기능 없앰

This commit is contained in:
Suh
2024-01-11 10:46:09 +09:00
parent 6434cd8774
commit 6f2cd14220
11 changed files with 101 additions and 11 deletions

View File

@@ -1,4 +1,26 @@
package com.no1.wms.account;
import com.no1.wms.utils.ConstantValues;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
@Controller
public class AccountController {
@Autowired
AccountService accountService;
public ModelAndView list(ModelAndView mav, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "0") int start){
List<AccountDto> list = accountService.selectAll(search, start, ConstantValues.PER_PAGE);
mav.addObject("list", list);
mav.setViewName("account/list");
return mav;
}
}

View File

@@ -0,0 +1,19 @@
package com.no1.wms.account;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Repository
@Mapper
public interface AccountMapper {
int insert(AccountDto dto);
int update(AccountDto dto);
int selectById(AccountDto dto);
List<AccountDto> selectAll(Map<String, Object> m);
}

View File

@@ -1,4 +1,35 @@
package com.no1.wms.account;
public interface AccountService {
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class AccountService {
@Autowired
AccountMapper mapper;
public int insert(AccountDto dto){
return mapper.insert(dto);
}
public int update(AccountDto dto){
return mapper.update(dto);
}
public int selectById(AccountDto dto){
return mapper.selectById(dto);
}
public List<AccountDto> selectAll(String search, int start, int perPage){
HashMap<String, Object> map = new HashMap<String, Object>();
return mapper.selectAll(map);
}
}

View File

@@ -1,5 +0,0 @@
package com.no1.wms.account;
public class AccountServiceImpl {
}

View File

@@ -1,6 +1,7 @@
package com.no1.wms.authority;
import com.google.gson.Gson;
import com.no1.wms.utils.ConstantValues;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@@ -14,11 +15,10 @@ import java.util.UUID;
public class AuthorityController {
@Autowired
AuthorityService authorityService;
private static final int PER_PAGE = 1000;
@GetMapping("/list")
public ModelAndView list(ModelAndView mav, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "0") int start){
List<AuthorityDto> list = authorityService.selectAll(search, start, PER_PAGE);
List<AuthorityDto> list = authorityService.selectAll(search, start, ConstantValues.PER_PAGE);
mav.addObject("list", list);
mav.setViewName("/authority/list");
return mav;

View File

@@ -0,0 +1,5 @@
package com.no1.wms.utils;
public class ConstantValues {
public static final int PER_PAGE = 1000;
}

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.no1.wms.authority.AuthorityMapper">
</mapper>

View File

@@ -2,15 +2,24 @@
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
<definition name="layout-empty" template="/WEB-INF/views/base/empty.jsp">
<put-attribute name="content" value="" />
</definition>
<definition name="layout-tiles" template="/WEB-INF/views/base/layout.jsp">
<put-attribute name="navigation" value="/WEB-INF/views/base/navigation.jsp" />
<put-attribute name="content" value="">
</put-attribute>
<put-attribute name="content" value="" />
</definition>
<definition name="*" extends="layout-tiles" template="/WEB-INF/views/base/empty.jsp">
<put-attribute name="content" value="/WEB-INF/views/modal/{1}.jsp" />
</definition>
<definition name="*/*" extends="layout-tiles">
<put-attribute name="content" value="/WEB-INF/views/{1}/{2}.jsp" />
</definition>
<definition name="*/*/*" extends="layout-tiles">
<put-attribute name="content" value="/WEB-INF/views/{1}/{2}/{3}.jsp" />
</definition>

View File

@@ -6,6 +6,6 @@
<title>Title</title>
</head>
<body>
kkkkkk
ddddddddddddddddd
</body>
</html>

View File

@@ -0,0 +1,3 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<tiles:insertAttribute name="content" />