-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: #89 판매자 정보 조회 API 구현
- Loading branch information
Showing
6 changed files
with
162 additions
and
0 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
50 changes: 50 additions & 0 deletions
50
src/main/java/com/ajou/hertz/domain/user/dto/response/SellerInfoResponse.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,50 @@ | ||
package com.ajou.hertz.domain.user.dto.response; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import com.ajou.hertz.domain.user.dto.UserDto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Getter | ||
public class SellerInfoResponse { | ||
|
||
@Schema(description = "Id of user", example = "1") | ||
private Long id; | ||
|
||
@Schema(description = "이메일", example = "[email protected]") | ||
private String email; | ||
|
||
@Schema(description = "프로필 이미지 url", example = "https://user-profile-image") | ||
private String profileImage; | ||
|
||
@Schema(description = "연락 수단", example = "https://contack-link") | ||
private String contactLink; | ||
|
||
@Schema(description = "가입일", example = "2024.01.01") | ||
private LocalDateTime createdAt; | ||
|
||
@Schema(description = "판매중인 물품의 수", example = "10") | ||
private long sellingItemCount; | ||
|
||
@Schema(description = "판매완료한 물품의 수", example = "10") | ||
private long soldItemCount; | ||
|
||
public static SellerInfoResponse from(UserDto userDto, long sellingItemCount, long soldItemCount) { | ||
return new SellerInfoResponse( | ||
userDto.getId(), | ||
userDto.getEmail(), | ||
userDto.getProfileImageUrl(), | ||
userDto.getContactLink(), | ||
userDto.getCreatedAt(), | ||
sellingItemCount, | ||
soldItemCount | ||
); | ||
} | ||
} |
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