-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#21 - Feat: 관리자 홈 메인 페이지 추가, username이 admin인 회원을 관리자 회원으로 설정
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
.../mutbooks/src/main/java/com/example/mutbooks/app/home/controller/AdminHomeController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.example.mutbooks.app.home.controller; | ||
|
||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequestMapping("/adm") | ||
public class AdminHomeController { | ||
@GetMapping("") | ||
@PreAuthorize("hasAuthority('ADMIN')") | ||
public String showIndex() { | ||
return "redirect:/adm/home/main"; | ||
} | ||
|
||
// 관리자 메인페이지 | ||
@GetMapping("/home/main") | ||
@PreAuthorize("hasAuthority('ADMIN')") | ||
public String showMain() { | ||
return "adm/home/main"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
3Week_Mission/mutbooks/src/main/resources/templates/adm/home/main.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html layout:decorate="~{/layout/layout}"> | ||
|
||
<head> | ||
<title>관리자 메인</title> | ||
</head> | ||
|
||
<main layout:fragment="main"> | ||
<div class="container mx-auto flex-grow flex items-center justify-center"> | ||
<h1>관리자 메인페이지</h1> | ||
</div> | ||
</main> | ||
|
||
</html> |