-
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.
- Loading branch information
Showing
28 changed files
with
580 additions
and
39 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
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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/_119/wepro/image/dto/request/ImageCreateRequest.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,10 @@ | ||
package com._119.wepro.image.dto.request; | ||
|
||
import com._119.wepro.project.domain.Project; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class ImageCreateRequest { | ||
String url; | ||
Project project; | ||
} |
2 changes: 1 addition & 1 deletion
2
.../_119/wepro/image/dto/ImagesResponse.java → ...ro/image/dto/response/ImagesResponse.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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/_119/wepro/image/presentation/ImageController.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
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
21 changes: 21 additions & 0 deletions
21
src/main/java/com/_119/wepro/member/domain/repository/MemberCustomRepository.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,21 @@ | ||
package com._119.wepro.member.domain.repository; | ||
|
||
import static com._119.wepro.member.domain.QMember.member; | ||
|
||
import com._119.wepro.member.domain.Member; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@RequiredArgsConstructor | ||
@Repository | ||
public class MemberCustomRepository { | ||
|
||
private final JPAQueryFactory queryFactory; | ||
|
||
public List<Member> findMembers(String keyword) { | ||
return queryFactory.select(member).from(member) | ||
.where(member.tag.contains(keyword).or(member.profile.name.contains(keyword))).fetch(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/_119/wepro/member/dto/response/MemberListResponse.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,23 @@ | ||
package com._119.wepro.member.dto.response; | ||
|
||
import com._119.wepro.member.domain.Member; | ||
import java.io.Serializable; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class MemberListResponse implements Serializable { | ||
|
||
private Long id; | ||
private String name; | ||
private String tag; | ||
|
||
public static MemberListResponse of(Member member){ | ||
return MemberListResponse.builder() | ||
.id(member.getId()) | ||
.name(member.getProfile().getName()) | ||
.tag(member.getTag()) | ||
.build(); | ||
} | ||
} |
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
15 changes: 14 additions & 1 deletion
15
src/main/java/com/_119/wepro/member/service/MemberService.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,10 +1,23 @@ | ||
package com._119.wepro.member.service; | ||
|
||
import com._119.wepro.member.domain.Member; | ||
import com._119.wepro.member.domain.repository.MemberCustomRepository; | ||
import com._119.wepro.member.dto.response.MemberListResponse; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.cache.annotation.Cacheable; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class MemberService { | ||
|
||
} | ||
private final MemberCustomRepository memberCustomRepository; | ||
|
||
@Cacheable(value = "findMemberCache") | ||
public List<MemberListResponse> findMembers(String keyword) { | ||
List<Member> result = memberCustomRepository.findMembers(keyword); | ||
|
||
return result.stream().map(MemberListResponse::of).toList(); | ||
} | ||
} |
Oops, something went wrong.