-
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.
# Conflicts: # board_exam_project-master/.gradle/7.1.1/executionHistory/executionHistory.bin # board_exam_project-master/.gradle/7.1.1/executionHistory/executionHistory.lock # board_exam_project-master/.gradle/7.1.1/fileHashes/fileHashes.bin # board_exam_project-master/.gradle/7.1.1/fileHashes/fileHashes.lock # board_exam_project-master/.gradle/buildOutputCleanup/buildOutputCleanup.lock # board_exam_project-master/build/classes/java/main/com/study/board/BoardApplication.class # board_exam_project-master/build/classes/java/main/com/study/board/controller/FreeboardController.class # board_exam_project-master/build/tmp/compileJava/previous-compilation-data.bin
- Loading branch information
Showing
32 changed files
with
280 additions
and
6 deletions.
There are no files selected for viewing
Binary file added
BIN
+19.6 KB
board_exam_project-master/.gradle/7.1.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified
BIN
+486 Bytes
(100%)
board_exam_project-master/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...m_project-master/build/classes/java/main/com/study/board/controller/LoginController.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ct-master/build/classes/java/main/com/study/board/controller/RegistrationController.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
board_exam_project-master/build/classes/java/main/com/study/board/entity/Freeboard.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
board_exam_project-master/build/classes/java/main/com/study/board/entity/User.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
board_exam_project-master/build/classes/java/main/com/study/board/ga/Board.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
board_exam_project-master/build/classes/java/main/com/study/board/ga/BoardController.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
board_exam_project-master/build/classes/java/main/com/study/board/ga/BoardService.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
board_exam_project-master/build/classes/java/main/com/study/board/ga/dodo.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
board_exam_project-master/build/classes/java/main/com/study/board/ga/dodoController.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
board_exam_project-master/build/classes/java/main/com/study/board/ga/dodoService.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...m_project-master/build/classes/java/main/com/study/board/repository/BoardRepository.class
Binary file not shown.
Binary file modified
BIN
+269 Bytes
(180%)
...oject-master/build/classes/java/main/com/study/board/repository/FreeboardRepository.class
Binary file not shown.
Binary file modified
BIN
-240 Bytes
(64%)
...am_project-master/build/classes/java/main/com/study/board/repository/UserRepository.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...am_project-master/build/classes/java/main/com/study/board/repository/dodoRepository.class
Binary file not shown.
Binary file modified
BIN
+283 Bytes
(110%)
...xam_project-master/build/classes/java/main/com/study/board/service/FreeboardService.class
Binary file not shown.
Binary file modified
BIN
+212 Bytes
(110%)
board_exam_project-master/build/classes/java/main/com/study/board/service/UserService.class
Binary file not shown.
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
107 changes: 107 additions & 0 deletions
107
board_exam_project-master/build/resources/main/templates/users/mypage.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,107 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>사용자 페이지</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f2f2f2; | ||
} | ||
|
||
h1 { | ||
color: #333; | ||
text-align: center; | ||
} | ||
|
||
table { | ||
margin: 20px auto; | ||
border-collapse: collapse; | ||
width: 90%; | ||
max-width: 800px; | ||
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3); | ||
overflow: hidden; | ||
} | ||
|
||
th, td { | ||
padding: 12px 15px; | ||
text-align: left; | ||
border-bottom: 1px solid #ddd; | ||
} | ||
|
||
th { | ||
background-color: #7E8EFB; /* 변경된 부분 */ | ||
color: white; | ||
} | ||
|
||
tr:hover { | ||
background-color: #f5f5f5; | ||
} | ||
|
||
a { | ||
color: #007bff; | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
.add-button { | ||
display: block; | ||
text-align: center; | ||
margin-top: 20px; | ||
} | ||
</style> | ||
|
||
</head> | ||
<body> | ||
<h1>사용자 정보 보여주기~~<h1> | ||
<h3>user_id = <input type="text" th:value="${#session.getAttribute('user')}" name="user.id" id="user" readonly/></h3> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>Nickname</th> | ||
<th>Email</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr th:each="u : ${user}" th:if="${u.id == #session.getAttribute('user')}"> | ||
<td th:text="${u.id}"></td> | ||
<td th:text="${u.nickname}"></td> | ||
<td th:text="${u.email}"></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h1>사용자가 그동안 작성한 자유게시판 게시글 목록</h1> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>user</th> | ||
<th>contentId</th> | ||
<th>Title</th> | ||
<th>Content</th> | ||
<th>Created At</th> | ||
<th>Updated At</th> | ||
<th>Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr th:each="freeboard : ${userFreeboard}"> <!--컨트롤러에서 받은 Freeboard 타입의 리스트(현재 접속한 user id로 작성된 글들)를 받아서 데이터를 표형식으로 출력한다.--> | ||
<td th:text="${freeboard.user.id}"></td> | ||
<td th:text="${freeboard.contentId}"></td> | ||
<td th:text="${freeboard.title}"></td> | ||
<td th:text="${freeboard.content}"></td> | ||
<td th:text="${freeboard.contentAt}"></td> | ||
<td th:text="${freeboard.updatedAt}"></td> | ||
<td> | ||
<a th:href="@{/edit/{id}(id=${freeboard.contentId})}">Edit</a> | ||
<a th:href="@{/delete/{id}(id=${freeboard.contentId})}">Delete</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
</body> | ||
</html> |
Binary file added
BIN
+24.2 KB
board_exam_project-master/build/tmp/compileTestJava/previous-compilation-data.bin
Binary file not shown.
44 changes: 44 additions & 0 deletions
44
board_exam_project-master/src/main/java/com/study/board/controller/MyPageController.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,44 @@ | ||
package com.study.board.controller; | ||
|
||
import com.study.board.entity.Freeboard; | ||
import com.study.board.entity.User; | ||
import com.study.board.service.FreeboardService; | ||
import com.study.board.service.UserService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.servlet.http.HttpSession; | ||
import java.util.List; | ||
|
||
@RestController | ||
public class MyPageController { | ||
@Autowired | ||
private UserService userService; | ||
@Autowired | ||
private FreeboardService freeboardService; | ||
|
||
@GetMapping("/mypage") | ||
@ResponseBody | ||
public ResponseEntity<?> mypage(HttpSession session) { | ||
Object obj = session.getAttribute("user"); // 사용자 정보 받아서 오브젝트로 만들기 | ||
if (obj == null) { | ||
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body("사용자가 로그인되어 있지 않습니다."); | ||
} else { | ||
// 사용자 id를 Long 타입으로 변환 | ||
Long userId = Long.parseLong(obj.toString()); | ||
// 사용자 정보 불러오기 | ||
User user = userService.getUserInfo(userId); | ||
|
||
// freeboard에서 사용자가 작성한 글 불러오기 | ||
List<Freeboard> userFreeboards = freeboardService.getContentByUserId(userId); | ||
|
||
return ResponseEntity.ok().body(userFreeboards); | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -88,4 +88,5 @@ public int getIsDeleted() { | |
public void setIsDeleted(int isDeleted) { | ||
this.isDeleted = isDeleted; | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
board_exam_project-master/src/main/java/com/study/board/repository/FreeboardRepository.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 |
---|---|---|
@@ -1,8 +1,15 @@ | ||
package com.study.board.repository; | ||
|
||
import com.study.board.entity.Freeboard; | ||
import com.study.board.entity.Pdf; | ||
import com.study.board.entity.User; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
|
||
@Repository | ||
public interface FreeboardRepository extends JpaRepository<Freeboard, Integer> { | ||
|
||
List<Freeboard> findAllByUserId(Long userId); //마이페이지에서 유저가 작성한 자유게시판 글들을 찾을 때 사용하는 함수 | ||
} |
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
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
107 changes: 107 additions & 0 deletions
107
board_exam_project-master/src/main/resources/templates/users/mypage.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,107 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>사용자 페이지</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f2f2f2; | ||
} | ||
|
||
h1 { | ||
color: #333; | ||
text-align: center; | ||
} | ||
|
||
table { | ||
margin: 20px auto; | ||
border-collapse: collapse; | ||
width: 90%; | ||
max-width: 800px; | ||
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3); | ||
overflow: hidden; | ||
} | ||
|
||
th, td { | ||
padding: 12px 15px; | ||
text-align: left; | ||
border-bottom: 1px solid #ddd; | ||
} | ||
|
||
th { | ||
background-color: #7E8EFB; /* 변경된 부분 */ | ||
color: white; | ||
} | ||
|
||
tr:hover { | ||
background-color: #f5f5f5; | ||
} | ||
|
||
a { | ||
color: #007bff; | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
.add-button { | ||
display: block; | ||
text-align: center; | ||
margin-top: 20px; | ||
} | ||
</style> | ||
|
||
</head> | ||
<body> | ||
<h1>사용자 정보 보여주기~~<h1> | ||
<h3>user_id = <input type="text" th:value="${#session.getAttribute('user')}" name="user.id" id="user" readonly/></h3> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>Nickname</th> | ||
<th>Email</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr th:each="u : ${user}" th:if="${u.id == #session.getAttribute('user')}"> | ||
<td th:text="${u.id}"></td> | ||
<td th:text="${u.nickname}"></td> | ||
<td th:text="${u.email}"></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h1>사용자가 그동안 작성한 자유게시판 게시글 목록</h1> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>user</th> | ||
<th>contentId</th> | ||
<th>Title</th> | ||
<th>Content</th> | ||
<th>Created At</th> | ||
<th>Updated At</th> | ||
<th>Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr th:each="freeboard : ${userFreeboard}"> <!--컨트롤러에서 받은 Freeboard 타입의 리스트(현재 접속한 user id로 작성된 글들)를 받아서 데이터를 표형식으로 출력한다.--> | ||
<td th:text="${freeboard.user.id}"></td> | ||
<td th:text="${freeboard.contentId}"></td> | ||
<td th:text="${freeboard.title}"></td> | ||
<td th:text="${freeboard.content}"></td> | ||
<td th:text="${freeboard.contentAt}"></td> | ||
<td th:text="${freeboard.updatedAt}"></td> | ||
<td> | ||
<a th:href="@{/edit/{id}(id=${freeboard.contentId})}">Edit</a> | ||
<a th:href="@{/delete/{id}(id=${freeboard.contentId})}">Delete</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-1.49 MB
board_exam_project-master/uploads/pdf/2주차_글로벌 비즈니스환경에서의 정보시스템(Laudon_MIS14_ch01).pdf
Binary file not shown.