Skip to content

Commit

Permalink
종원 sncak health header 수정 커밋
Browse files Browse the repository at this point in the history
  • Loading branch information
RowenKim committed Oct 13, 2021
1 parent 67fbbe6 commit 4fb150b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 21 deletions.
40 changes: 34 additions & 6 deletions src/main/java/com/lec/spring/crawling/Won_CrawlingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,26 @@ public void setAdminCheckService(adminCheckService adminService) {
Won_CrawlingDAO dao;

@GetMapping("/all/snack")
public String snack(Model model) throws IOException {
// System.out.println("컨트롤러창 뜸");
public String snack(Model model,Principal principal, UserDTO dto) throws Exception {

if(principal == null) {
model.addAttribute("message", "Hello Spring Security");
System.out.println("실패");
}
else {
model.addAttribute("user", principal.getName());
System.out.println("user : " + principal.getName());

String id = principal.getName();
dto.setM_id(id);
userService.login(dto);
System.out.println("userService: " + userService.login(dto));

model.addAttribute("dto", userService.login(dto));
}

model.addAttribute("list", wonService.list());
// model.addAttribute("list", wonService.snackList());

// System.out.println("컨트롤러창 뜸2");
model.addAttribute("list", wonService.list());

// List<Won_CrawlingDTO> snackProductList = won_crawlingService.getSnack();

Expand All @@ -65,7 +77,23 @@ public String snack(Model model) throws IOException {
}

@GetMapping("/all/health")
public String health(Model model) throws IOException {
public String health(Model model, Principal principal, UserDTO dto) throws Exception {

if(principal == null) {
model.addAttribute("message", "Hello Spring Security");
System.out.println("실패");
}
else {
model.addAttribute("user", principal.getName());
System.out.println("user : " + principal.getName());

String id = principal.getName();
dto.setM_id(id);
userService.login(dto);
System.out.println("userService: " + userService.login(dto));

model.addAttribute("dto", userService.login(dto));
}
model.addAttribute("list", wonService.Healthlist());

return "icmall/health";
Expand Down
10 changes: 5 additions & 5 deletions src/main/webapp/WEB-INF/views/icmall/health.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
<c:choose>
<c:when test="${user == null }">
<ul class="top-menu" style="float:right">
<li><a href="join">회원가입</a></li>
<li><a href="loginForm">로그인</a></li>
<li><a href="serviceCenter">고객센터</a></li>
<li><a href="/icmall/all/join">회원가입</a></li>
<li><a href="/icmall/all/loginForm">로그인</a></li>
<li><a href="/icmall/all/serviceCenter">고객센터</a></li>
</ul>
</c:when>
<c:otherwise>
<ul class="top-menu" style="float:right">
<li><a href="/icmall/myPage">마이페이지</a></li>
<li><a href="serviceCenter">고객센터</a></li>
<li><a href="/icmall/user/myPage">마이페이지</a></li>
<li><a href="/icmall/all/serviceCenter">고객센터</a></li>
</ul>
</c:otherwise>
</c:choose>
Expand Down
20 changes: 10 additions & 10 deletions src/main/webapp/WEB-INF/views/icmall/snack.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
<c:choose>
<c:when test="${user == null }">
<ul class="top-menu" style="float:right">
<li><a href="join">회원가입</a></li>
<li><a href="loginForm">로그인</a></li>
<li><a href="serviceCenter">고객센터</a></li>
<li><a href="/icmall/all/join">회원가입</a></li>
<li><a href="/icmall/all/loginForm">로그인</a></li>
<li><a href="/icmall/all/serviceCenter">고객센터</a></li>
</ul>
</c:when>
<c:otherwise>
<ul class="top-menu" style="float:right">
<li><a href="/icmall/myPage">마이페이지</a></li>
<li><a href="serviceCenter">고객센터</a></li>
<li><a href="/icmall/user/myPage">마이페이지</a></li>
<li><a href="/icmall/all/serviceCenter">고객센터</a></li>
</ul>
</c:otherwise>
</c:choose>
Expand Down Expand Up @@ -103,11 +103,11 @@
<nav>
<!--Left Menu-->
<ul>
<li><a href="vegetable">채소</a></li>
<li><a href="fruit">과일</a></li>
<li><a href="meat">정육</a></li>
<li class="current"><a href="snack">간식</a></li>
<li><a href="health">건강식품</a></li>
<li><a href="/icmall/all/vegetable">채소</a></li>
<li><a href="/icmall/all/fruit">과일</a></li>
<li><a href="/icmall/all/meat">정육</a></li>
<li class="current"><a href="/icmall/all/snack">간식</a></li>
<li><a href="/icmall/all/health">건강식품</a></li>
</ul>
<!--Right Menu-->
<ul>
Expand Down

0 comments on commit 4fb150b

Please sign in to comment.