-
Notifications
You must be signed in to change notification settings - Fork 0
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
#71 [feat] 디자이너 메인 뷰 기능 구현 #88
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0713aa9
#71 [feat] 디자이너 메인 뷰 기본 세팅
38e8c2b
#71 [feat] 디자이너 메인 뷰 기본 설정
4287b62
#71 [feat] response 추가
76c5d07
Merge branch 'develop' of https://github.com/TEAM-MODDY/moddy-server …
abf8c5e
Merge branch 'develop' of https://github.com/TEAM-MODDY/moddy-server …
5795c64
#71 [feat] 모델 메인 뷰 기능 구현
1c1caf1
Merge branch 'develop' of https://github.com/TEAM-MODDY/moddy-server …
d45cf6d
#71 [feat] designer 메인뷰 기능 구현 완료
aa87fab
#71 [refactor] 공백수정
29f5848
#71 [refactor] 나이 계산 로직 userService 밖으로 빼기
925ce43
#71 [remove] testcontroller 삭제
85bb4fc
#71 [refactor] 코드 수정
ee2b7fb
#71 [refactor] 코드 수정 완료
7d4db0b
#71[refactor] import 삭제
537e28e
#71 [refactor] response body 수정
bc281e7
Merge branch 'develop' of https://github.com/TEAM-MODDY/moddy-server …
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
32 changes: 31 additions & 1 deletion
32
src/main/java/com/moddy/server/controller/designer/DesignerController.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,14 +1,44 @@ | ||
package com.moddy.server.controller.designer; | ||
|
||
|
||
import com.moddy.server.common.dto.ErrorResponse; | ||
import com.moddy.server.common.dto.SuccessResponse; | ||
import com.moddy.server.common.exception.enums.SuccessCode; | ||
import com.moddy.server.config.resolver.user.UserId; | ||
import com.moddy.server.controller.designer.dto.response.DesignerMainResponse; | ||
import com.moddy.server.service.designer.DesignerService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/designer") | ||
@Tag(name = "DesignerController") | ||
@RequiredArgsConstructor | ||
public class DesignerController { | ||
private final DesignerService designerService; | ||
@Operation(summary = "[JWT] 디자이너 메인 뷰 조회", description = "디자이너 메인 뷰 조회 API입니다.") | ||
@ApiResponses({ | ||
@ApiResponse(responseCode = "200", description = "모델 메인뷰 조회 성공", content = @Content(schema = @Schema(implementation = DesignerMainResponse.class))), | ||
@ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
}) | ||
@GetMapping | ||
@SecurityRequirement(name = "JWT Auth") | ||
public SuccessResponse<DesignerMainResponse> getDesignerMainInfo( | ||
@Parameter(hidden = true) @UserId Long userId, | ||
@Parameter(name = "page", description = "페이지 ") @RequestParam(value = "page") int page, | ||
@Parameter(name = "size", description = "페이지 ") @RequestParam(value = "size") int size | ||
){ | ||
return SuccessResponse.success(SuccessCode.FIND_DESIGNER_MAIN_INFO_SUCCESS, designerService.getDesignerMainView(userId, page, size)); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/moddy/server/controller/designer/dto/response/DesignerMainResponse.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,14 @@ | ||
package com.moddy.server.controller.designer.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import java.util.List; | ||
|
||
@Schema(description = "디자이너 메인 뷰 Response DTO") | ||
public record DesignerMainResponse( | ||
int page, | ||
int size, | ||
String name, | ||
List<HairModelApplicationResponse> hairModelApplications | ||
) { | ||
} |
16 changes: 16 additions & 0 deletions
16
.../java/com/moddy/server/controller/designer/dto/response/HairModelApplicationResponse.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,16 @@ | ||
package com.moddy.server.controller.designer.dto.response; | ||
|
||
import com.moddy.server.domain.prefer_hair_style.HairStyle; | ||
import com.moddy.server.domain.user.Gender; | ||
|
||
import java.util.List; | ||
|
||
public record HairModelApplicationResponse( | ||
Long applicationId, | ||
String name, | ||
int age, | ||
String imgUrl, | ||
String gender, | ||
List<HairStyle> preferHairStyles | ||
) { | ||
} |
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
6 changes: 3 additions & 3 deletions
6
src/main/java/com/moddy/server/domain/model/repository/ModelJpaRepository.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,14 +1,14 @@ | ||
package com.moddy.server.domain.model.repository; | ||
|
||
import com.moddy.server.domain.user.User; | ||
import com.moddy.server.domain.model.Model; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Optional; | ||
|
||
@Repository | ||
public interface ModelJpaRepository extends JpaRepository<User, Long> { | ||
Optional<User> findById(Long userId); | ||
public interface ModelJpaRepository extends JpaRepository<Model, Long> { | ||
Optional<Model> findById(Long userId); | ||
|
||
} | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
p1
enum 클래스 내부에 있는 함수 때문에 Gender enum 을 그대로 사용해도 잘 들어옵니다!