-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: 없는 게시판에 대한 게시글 조회 요청 시 예외 발생 * feat: 전체 게시글 검색 기능 구현 * test: 전체 게시글 검색 Controller 테스트 구현 * docs: 전체 게시글 검색 API 문서 반영 * test: 게시글 Fixture id 수정 * docs: API 문서 rebase 후 최신화
- Loading branch information
Showing
11 changed files
with
611 additions
and
278 deletions.
There are no files selected for viewing
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
11 changes: 8 additions & 3 deletions
11
src/main/java/com/ssafy/ssafsound/domain/board/repository/BoardRepository.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,12 +1,17 @@ | ||
package com.ssafy.ssafsound.domain.board.repository; | ||
|
||
import java.util.List; | ||
|
||
import com.ssafy.ssafsound.domain.board.domain.Board; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
public interface BoardRepository extends JpaRepository<Board, Long> { | ||
List<Board> findAllByUsedBoardTrue(); | ||
List<Board> findAllByUsedBoardTrue(); | ||
|
||
Optional<Board> findByIdAndUsedBoardTrue(Long id); | ||
|
||
Boolean existsByIdAndUsedBoardTrue(Long id); | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostAllSearchOffsetReqDto.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,29 @@ | ||
package com.ssafy.ssafsound.domain.post.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.Size; | ||
|
||
@Getter | ||
@Setter | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class GetPostAllSearchOffsetReqDto extends BasePageRequest { | ||
@Size(min = 2) | ||
@NotBlank | ||
private String keyword; | ||
|
||
public void setKeyword(String keyword) { | ||
this.keyword = removeBlank(keyword); | ||
} | ||
|
||
private String removeBlank(String value) { | ||
return value.replaceAll(" ", ""); | ||
} | ||
} |
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
Oops, something went wrong.