-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 일정찾기 - 키워드로 검색기능 #34
base: dev
Are you sure you want to change the base?
Conversation
build.gradle
Outdated
@@ -2,6 +2,8 @@ plugins { | |||
id 'java' | |||
id 'org.springframework.boot' version '3.1.4' | |||
id 'io.spring.dependency-management' version '1.1.3' | |||
// QueryDsl | |||
// id "com.ewerk.gradle.plugins.querydsl" version "1.0.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build.gradle 주석은 사용하지 않는다면 제거 해도 될거같아용!
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Table(name = "users") | ||
public class User extends BaseTimeEntity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user 엔티티부분 수정됐는데, 이후에, 이 부분은 제가 수정해도 될꺼같아요.
추가로 이부분은 제가 모르는 부분인데 User엔티티를 catcher-service에 구현하는게 맞을까용?(다른분들의 의견이 궁금합니다.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 철원님께 여쭤봣던 내용인데, 직접 접근한다는 가정하에 서비스마다 엔티티가 존재하긴 해야한다고 하셧습니다. 👍
|
||
private String keyword; | ||
|
||
// private String them; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
없어도 되는 부분이면 지워도 좋을거같아용!
public List<Schedule> getScheduleByKeywordAndFilter( | ||
final String keyword | ||
// final Long budget, | ||
// final ZonedDateTime startAt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 주석이 혹시 필요한 부분일까요?
import java.time.ZonedDateTime; | ||
import java.util.List; | ||
|
||
public interface ScheduleRepositoryCustom { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이클래스는 코어쪽에 들어가야하는것 같은데, 맞을까요 (cc.철원님) ㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 맞습니다. 위에서 언급한것과 같이 ScheduleRepository를 Core Layer에 생성하고, ScheduleJPARepository를 datasource쪽에 생성하시면 됩니다
* QAddress is a Querydsl query type for Address | ||
*/ | ||
@Generated("com.querydsl.codegen.DefaultEmbeddableSerializer") | ||
public class QAddress extends BeanPath<Address> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이부분 Qxxx 클래스는 컴파일 시점에 생성되기 때문에, gitignore에(src/main/generated/**) 넣어놓고 사용했던거 같아요!
혹시, 제가 잘못알고 있다면 지적부탁드립니당
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 그렇게 알고 있긴합니다
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface ScheduleRepository extends JpaRepository<Schedule, Long>, ScheduleRepositoryCustom { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ScheduleRepositoryCustom 인터페이스를 구현받도록 작성하는게 맞을까용?
@RequiredArgsConstructor | ||
public class ScheduleService { | ||
|
||
private final ScheduleRepository scheduleRepository; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scheduleRepository 는 jpa repository를 직접 참조하고 있는데 수정이 필요할거같아용
(Part-Backend 채팅방 아이디어 탭 참조해보면 될거같아용)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이해 안되시면 배치 서비스에 구현된 방법을 참고하셔도 될 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 사용하지 않는 코드 제거
- Core Layer에서 Datasource를 직접 접근하지 않도록 스케줄Repo 수정
- 스케줄 검색 관련 기능은 ElasticSearch로 진행해야 할텐데 인프라팀과 논의 부탁드려요
@RequiredArgsConstructor | ||
public class ScheduleService { | ||
|
||
private final ScheduleRepository scheduleRepository; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이해 안되시면 배치 서비스에 구현된 방법을 참고하셔도 될 것 같아요
import java.time.ZonedDateTime; | ||
|
||
@Data | ||
public class ScheduleCondition { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
얘는 사용 안하는것 같은데 사용하시다가 지운건가요?
import java.time.ZonedDateTime; | ||
import java.util.List; | ||
|
||
public interface ScheduleRepositoryCustom { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 맞습니다. 위에서 언급한것과 같이 ScheduleRepository를 Core Layer에 생성하고, ScheduleJPARepository를 datasource쪽에 생성하시면 됩니다
// final Long budget, | ||
// final ZonedDateTime startAt, | ||
// final ZonedDateTime endAt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용안하는 부분들은 다 지워주세요~
} | ||
|
||
@Override | ||
public List<Schedule> findScheduleByKeywordAndFilter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
근데 이 부분들은 JPA 통해서 하는것보다 ElasticSearch를 통해서 하는게 효율적이지 않을까요?
|
||
@GetMapping("/list") | ||
public CommonResponse<List<Schedule>> getScheduleByKeywordAndFilter( | ||
@RequestParam(defaultValue = "") String keyword |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디폴트가 빈 스트링이면 아무것도 안썼을때 정상동작하나요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryDSL 사용을 위해서 우선 병합 요청드렸습니다. 코멘트 남아있는 부분은 따로 정리해주시면 감사드리겠습니다!
일정찾기에서 키워드, 필터링을 통한 일정 검색 기능입니다.
우선적으로 테스트용으로 키워드만 조건으로 적용시켰습니다