Skip to content

Commit cb14176

Browse files
authored
[BUG] API 충돌 해결 및 정렬 기준 수정 (#209)
* 응답값 또 수정 * [BUG]게시글 정렬 기준 수정 (createdDate → createdAt) * [BUG]포트폴리오 API 경로 충돌 해결( URL 변경)
1 parent 8243457 commit cb14176

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/com/brainpix/profile/controller/PortfolioController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public ResponseEntity<ApiResponse<Void>> deletePortfolio(
8181
@AllUser
8282
@Operation(summary = "사용자의 포트폴리오 목록 조회",
8383
description = "특정 사용자의 포트폴리오 목록을 조회합니다. 자신의 포트폴리오를 조회하려면 자신의 userId를 전달하세요.")
84-
@GetMapping("/{userId}")
84+
@GetMapping("/{userId}/list")
8585
@SwaggerPageable
8686
public ResponseEntity<CommonPageResponse<PortfolioResponse>> findPortfolios(
8787
@PathVariable Long userId,

src/main/java/com/brainpix/profile/controller/PublicProfileController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public ResponseEntity<ApiResponse<CompanyProfileResponseDto>> getPublicCompanyPr
5959
@SwaggerPageable
6060
public ResponseEntity<ApiResponse<CommonPageResponse<PublicProfileResponseDto.PostPreviewDto>>> getPostsByUser(
6161
@PathVariable Long userId,
62-
@PageableDefault(sort = "createdDate", direction = Sort.Direction.DESC) Pageable pageable) {
62+
@PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable) {
6363
CommonPageResponse<PublicProfileResponseDto.PostPreviewDto> pageResponse =
6464
CommonPageResponse.of(publicProfileService.getPostsByUser(userId, pageable));
6565
return ResponseEntity.ok(ApiResponse.success(pageResponse));

src/main/java/com/brainpix/profile/service/PublicProfileService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public IndividualProfileResponseDto getPublicIndividualProfile(Long userId) {
6262

6363
// 비공개 항목 처리 (비공개면 빈 값/리스트 반환)
6464
return IndividualProfileResponseDto.builder()
65+
.userId(profileDto.getUserId())
66+
.profileImage(profileDto.getProfileImage())
6567
.userType(profileDto.getUserType())
6668
.specializations(profileDto.getSpecializations())
6769
.name(profileDto.getName())
@@ -91,6 +93,8 @@ public CompanyProfileResponseDto getPublicCompanyProfile(Long userId) {
9193
CompanyProfileResponseDto profileDto = myProfileConverter.toCompanyDto((Company)user);
9294

9395
return CompanyProfileResponseDto.builder()
96+
.userId(profileDto.getUserId())
97+
.imageUrl(profileDto.getImageUrl())
9498
.userType(profileDto.getUserType())
9599
.specializations(profileDto.getSpecializations())
96100
.name(profileDto.getName())

0 commit comments

Comments
 (0)