Skip to content

Commit

Permalink
#87 rename: data -> infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
rivkode committed Jun 9, 2024
1 parent 99c6a09 commit 517d862
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seoultech.synergybe.domain.post.data;
package com.seoultech.synergybe.domain.post.infrastructure;

import com.seoultech.synergybe.domain.post.Post;
import com.seoultech.synergybe.domain.post.exception.PostNotFoundException;
Expand All @@ -16,11 +16,15 @@ public void save(Post post) {
postRepository.save(post);
}

public void saveAll(List<Post> postList) {
postRepository.saveAll(postList);
}

public void delete(Post post) {
postRepository.delete(post);
}

public Post findById(String postId) {
public Post findById(Long postId) {
return postRepository.findById(postId)
.orElseThrow(() -> new PostNotFoundException("존재하지 않는 게시글입니다."));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seoultech.synergybe.domain.post.data;
package com.seoultech.synergybe.domain.post.infrastructure;

import com.seoultech.synergybe.domain.post.Post;
import org.springframework.data.domain.Page;
Expand All @@ -10,7 +10,7 @@

import java.util.List;

public interface PostRepository extends JpaRepository<Post, String>, PostRepositoryCustom {
public interface PostRepository extends JpaRepository<Post, Long>, PostRepositoryCustom {

@Query(value = "SELECT * FROM post WHERE post_id < :postId AND is_deleted = 0 ORDER BY post_id DESC LIMIT 10", nativeQuery = true)
List<Post> findAllByEndId(@Param("postId") String postId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.seoultech.synergybe.domain.post.data;
package com.seoultech.synergybe.domain.post.infrastructure;

import com.seoultech.synergybe.domain.post.Post;
import com.seoultech.synergybe.domain.post.presentation.dto.response.GetPostResponse;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seoultech.synergybe.domain.post.data;
package com.seoultech.synergybe.domain.post.infrastructure;

import com.querydsl.jpa.impl.JPAQueryFactory;
import com.seoultech.synergybe.domain.post.Post;
Expand Down

0 comments on commit 517d862

Please sign in to comment.