diff --git a/src/main/java/com/no1/wms/mypage/MypageController.java b/src/main/java/com/no1/wms/mypage/MypageController.java new file mode 100644 index 0000000..f04e7ae --- /dev/null +++ b/src/main/java/com/no1/wms/mypage/MypageController.java @@ -0,0 +1,51 @@ +package com.no1.wms.mypage; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import org.springframework.beans.factory.annotation.Autowired; +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.PutMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.no1.wms.account.AccountDto; +import com.no1.wms.account.AccountService; + +@Controller +public class MypageController { + + @Autowired + AccountService accountService; + + + + @GetMapping("/mypage") + public String mypage(Model m, HttpServletRequest request) { + + HttpSession session = request.getSession(); + AccountDto dto = (AccountDto) session.getAttribute("userData"); + + AccountDto list = accountService.selectById(dto); + m.addAttribute("list", list); + + return "mypage/mypage"; + } + + @ResponseBody + @PutMapping("/mypage/updateUserInfo") + public boolean updateUserInfo(AccountDto dto) { + int i = accountService.update(dto); + System.out.println(i); + if (i == 1) { + return true; + } else { + return false; + } + } + + + +} diff --git a/src/main/resources/static/img/mypage/defaultimg.png b/src/main/resources/static/img/mypage/defaultimg.png new file mode 100644 index 0000000..147064e Binary files /dev/null and b/src/main/resources/static/img/mypage/defaultimg.png differ diff --git a/src/main/webapp/WEB-INF/views/mypage/mypage.jsp b/src/main/webapp/WEB-INF/views/mypage/mypage.jsp new file mode 100644 index 0000000..5e6f162 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/mypage/mypage.jsp @@ -0,0 +1,179 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> + + + + +Insert title here + + +
+

마이페이지

+
+
+
+
+
+
+ Default Image +
+

+ ${list.positionDto.name }   + ${list.name} +

+
+
+ +
+
+ + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+
+
+ +
+
+ + + + + + +
+
+
+
+
+ + + + + + \ No newline at end of file