Skip to content

Commit

Permalink
Update main
Browse files Browse the repository at this point in the history
  • Loading branch information
in27sung committed Dec 17, 2024
1 parent dbf19bc commit fc00541
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 430 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.util.Date;
import java.util.Locale;

import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
Expand Down Expand Up @@ -32,7 +34,7 @@ public String home(Locale locale, Model model) {
String formattedDate = dateFormat.format(date);

model.addAttribute("serverTime", formattedDate );
return "user/main";
return "main";
}
//http://localhost:8088/dashboard
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
Expand Down Expand Up @@ -62,4 +64,44 @@ public String qrScanner(Locale locale, Model model) {

return "qrScanner";
}

// 대시보드사용법 - /howtouse (GET)
@RequestMapping(value = "/howtouse", method = RequestMethod.GET)
public String howtouseGET(Model model, HttpSession session) throws Exception {
Long userId = (Long) session.getAttribute("userId");
// if (id == null) {
// // 세션에 id가 없으면 에러 처리
// return "redirect:/user/main";
// }
// UserVO resultVO = userService.getUser(userId);
// model.addAttribute("resultVO", resultVO);
return "howtouse";
}

// 상담하기 - /user/consultation (GET)
@RequestMapping(value = "/consultation", method = RequestMethod.GET)
public String consultationGET(Model model, HttpSession session) throws Exception {
Long userId = (Long) session.getAttribute("id");

// if (id == null) {
// // 세션에 id가 없으면 에러 처리
// return "redirect:/user/main";
// }
// UserVO resultVO = userService.getUser(userId, password );
// model.addAttribute("resultVO", resultVO);
return "consultation";
}

// 회사소개 - /intro (GET)
@RequestMapping(value = "/intro", method = RequestMethod.GET)
public String introGET(Model model, HttpSession session) throws Exception {
Long userId = (Long) session.getAttribute("userId");
// if (id == null) {
// // 세션에 id가 없으면 에러 처리
// return "redirect:/user/main";
// }
// UserVO resultVO = userService.getUser(userId);
// model.addAttribute("resultVO", resultVO);
return "/intro";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -392,23 +392,6 @@ public void changePasswordPOST(
}
}


// 상담하기 - /user/consultation (GET)
@RequestMapping(value = "/consultation", method = RequestMethod.GET)
public String consultationGET(Model model, HttpSession session) throws Exception {
Long userId = (Long) session.getAttribute("id");

// if (id == null) {
// // 세션에 id가 없으면 에러 처리
// return "redirect:/user/main";
// }
// UserVO resultVO = userService.getUser(userId, password );
// model.addAttribute("resultVO", resultVO);
return "/user/consultation";
}




@RequestMapping(value = "/sendConsultation", method = RequestMethod.POST)
public String sendConsultation(
Expand Down Expand Up @@ -491,21 +474,6 @@ protected PasswordAuthentication getPasswordAuthentication() {
}




// 대시보드사용법 - /howtouse (GET)
@RequestMapping(value = "/howtouse", method = RequestMethod.GET)
public String howtouseGET(Model model, HttpSession session) throws Exception {
Long userId = (Long) session.getAttribute("userId");
// if (id == null) {
// // 세션에 id가 없으면 에러 처리
// return "redirect:/user/main";
// }
// UserVO resultVO = userService.getUser(userId);
// model.addAttribute("resultVO", resultVO);
return "/user/howtouse";
}

// 대시보드사용법 - /howtouse2 (GET)
@RequestMapping(value = "/howtouse2", method = RequestMethod.GET)
public String howtouseGET2(Model model, HttpSession session) throws Exception {
Expand All @@ -519,18 +487,7 @@ public String howtouseGET2(Model model, HttpSession session) throws Exception {
return "/user/howtouse2";
}

// 회사소개 - /intro (GET)
@RequestMapping(value = "/intro", method = RequestMethod.GET)
public String introGET(Model model, HttpSession session) throws Exception {
Long userId = (Long) session.getAttribute("userId");
// if (id == null) {
// // 세션에 id가 없으면 에러 처리
// return "redirect:/user/main";
// }
// UserVO resultVO = userService.getUser(userId);
// model.addAttribute("resultVO", resultVO);
return "/user/intro";
}


// 회원정보 삭제 - 비밀번호 입력 (GET)
@RequestMapping(value = "/delete", method = RequestMethod.GET)
Expand Down
11 changes: 4 additions & 7 deletions stockMate/src/main/webapp/WEB-INF/views/dashboard.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,20 @@
<!-- Sidebar -->
<div class="sidebar">
<div class="disabled">Dashboard</div>
<a href="warehouse/register">창고 등록</a>
<a href="stock/register">재고 등록</a>
<a href="product/register">상품 등록</a>
<a href="user/editinfo1">내정보 조회/수정</a>
<a href="user/changepassword1">비밀번호 변경</a>
<a href="user/howtouse2">대시보드 사용법</a>
<a href="user/main" onclick="return confirmLogout();" style="color: red;">Sign out</a>
<a href="user/signout" style="color: red;">Sign out</a>
<a href="user/main" onclick="return confirmLogout();" style="color: red;">Sign out</a>
<script>
function confirmLogout() {
alert("로그아웃 되었습니다");
return true; // 링크 이동을 계속 진행
}
</script>
<a href="warehouse/register">창고 등록</a>
<a href="stock/register">재고 등록</a>
<a href="profile">내정보 조회/수정</a>
<a href="password">비밀번호 변경</a>
<a href="help">대시보드 사용법</a>
<a href="user/signout" style="color: red;">Sign out</a>
</div>
<!-- Main Content -->
<div class="main-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
</div>
</div>
<div class="back-button">
<a href="/user/main">뒤로 돌아가기</a>
<a href="/">뒤로 돌아가기</a>
</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<p>완성된 기능이 무사히 업그레이드되었을 때의 뿌듯함을 느끼며, 고객 만족도를 위해 지속적으로 노력하고 있습니다.</p>
</div>
<div class="back-button">
<a href="/user/main">뒤로 돌아가기</a>
<a href="/">뒤로 돌아가기</a>
</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ body {
<div class="nav">
<a href="user/signup">회원가입</a>
<a href="user/signin">로그인</a>
<a href="user/howtouse">대시보드 사용법</a>
<a href="user/consultation">상담문의</a>
<a href="intro">회사소개</a>
<a href="/howtouse">대시보드 사용법</a>
<a href="/consultation">상담문의</a>
<a href="/intro">회사소개</a>
</div>

<!-- Content -->
Expand Down
Loading

0 comments on commit fc00541

Please sign in to comment.