Skip to content

Commit

Permalink
[REFACTOR] #176 - Post GetMaaping url change
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwhyee committed Sep 27, 2022
1 parent ca1abba commit f37e828
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/matdongsan/infra/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected void configure(HttpSecurity http) throws Exception {
// 카카오 맵 외부 요청을 받
.csrf().disable() // /api/place 로 보내지지가 않아서 설정
.authorizeRequests()
.mvcMatchers("/login", "/signup", "/account/idCheck", "/account/kakao/**", "/", "/place", "/place/map", "/posts", "/post/**").permitAll() // 누구나 접근 가능
.mvcMatchers("/login", "/signup", "/account/idCheck", "/account/kakao/**", "/", "/place", "/place/map", "/posts", "/post/*/detail").permitAll() // 누구나 접근 가능
.anyRequest().authenticated(); // 나머지 요청은 권한이 있어야함
http.logout()
.logoutUrl("/logout")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class PostController {


// 게시글 상세 조회
@GetMapping("/post/{id}")
@GetMapping("/post/{id}/detail")
public String showDetailPost(@PathVariable long id,
@RequestParam(value = "page", defaultValue = "0") int page,
Model model, @ModelAttribute("replyDto") ReplyDto replyDto,
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/fragments/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="footer-logo">
<a th:href="@{/}"><img th:src="@{/media/logo_dark.png}" alt="Logo"></a>
</div>
<p>맛! 동! 산! 맛 동도로동동동동 산~!</p>
<p>맛동산 프로젝트 | <a href="https://github.com/likelion-backendschool/matdongsan" target="_blank">Github</a></p>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h3>인기 포스팅 TOP 5</h3>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item" th:each="top, status : ${top5Post}" th:classappend="${status.index == 0} ? active" style=" cursor: pointer;" th:onclick="'location.href=\'' + @{/post/{postId}(postId = ${top.id})} + '\''">
<div class="carousel-item" th:each="top, status : ${top5Post}" th:classappend="${status.index == 0} ? active" style=" cursor: pointer;" th:onclick="'location.href=\'' + @{/post/{postId}/detail(postId = ${top.id})} + '\''">
<img class="d-block w-100" th:src="@{${top.getPlace().mainPhotoUrl}}" style="height: 300px; opacity: 0.5;">
<div class="carousel-caption d-none d-md-block">
<h5 th:text="${top.title}">제목</h5>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/place/place-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h5 class="modal-title" id="staticBackdropLabel">북마크에 추가하기</h5>
<img src="/media/figure/author_6.jpg" alt="blog">
</div>
<div class="media-body">
<a th:href="@{/post/{id}(id = ${post.id})}">
<a th:href="@{/post/{id}/detail(id = ${post.id})}">
<div class="item-date" th:text="${#temporals.format(post.createdTime, 'yy-MM-dd HH:mm')}">DateTime</div>
<div class="author-name">
<h5 class="item-title" th:text="${post.author.nickname}">Writer</h5>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/post/post-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h5><a th:href="@{/login}">로그인</a> 후 댓글을 확인할 수 있습니
</div>
</div>
</div>
<th:block th:replace="/fragments/likes/post-like-fragments::likes(${post.getId()})"></th:block>
<th:block th:replace="fragments/likes/post-like-fragments::likes(${post.getId()})"></th:block>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion src/main/resources/templates/post/posts-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h3 class="heading-title">맛집 게시글</h3>
<tr th:each="post, loop : ${paging}">
<td th:text="${post.id}"></td>
<td class="text-start">
<a th:href="@{|/post/${post.id}|}" th:text="${post.title}"></a>
<a th:href="@{|/post/${post.id}/detail|}" th:text="${post.title}"></a>
</td>
<td>
<span th:text="${post.author?.nickname}"></span>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/profile/profile-main.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h5>아직 작성된 게시물이 없습니다.</h5>
<div class="row gutters-20 ">
<div class="col-lg-3 col-md-4 col-6" th:each="post : ${member.getPostList()}">
<div class="bg-white mb-2 p-2 rounded">
<a th:href="@{/post/{postId}(postId = ${post.getId()})}">
<a th:href="@{/post/{postId}/detail(postId = ${post.getId()})}">
<p class="text-dark" th:text="${post.getTitle()}">포스트 제목</p>
<div>
<span><i class="icofont-thumbs-up text-dark"></i><a th:text="${post.getPostLike().size()}" class="mx-2">추천 수</a></span>
Expand Down

0 comments on commit f37e828

Please sign in to comment.