-
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.
Merge pull request #133 from sharemindteam/feature/132-post-isPaid
feat: 일대다 비공개 상담 결제 여부 처리하는 어드민 api 구현
- Loading branch information
Showing
14 changed files
with
199 additions
and
44 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
46 changes: 46 additions & 0 deletions
46
src/main/java/com/example/sharemind/admin/dto/response/PostGetUnpaidPrivateResponse.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,46 @@ | ||
package com.example.sharemind.admin.dto.response; | ||
|
||
import com.example.sharemind.post.domain.Post; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalDateTime; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class PostGetUnpaidPrivateResponse { | ||
|
||
@Schema(description = "일대다 상담 아이디") | ||
private final Long postId; | ||
|
||
@Schema(description = "구매자 닉네임") | ||
private final String customerName; | ||
|
||
@Schema(description = "상담료") | ||
private final Long cost; | ||
|
||
@Schema(description = "상담 공개 여부") | ||
private final Boolean isPublic; | ||
|
||
@Schema(description = "상담 신청 일시") | ||
private final LocalDateTime createdAt; | ||
|
||
@Builder | ||
public PostGetUnpaidPrivateResponse(Long postId, String customerName, Long cost, | ||
Boolean isPublic, LocalDateTime createdAt) { | ||
this.postId = postId; | ||
this.customerName = customerName; | ||
this.cost = cost; | ||
this.isPublic = isPublic; | ||
this.createdAt = createdAt; | ||
} | ||
|
||
public static PostGetUnpaidPrivateResponse of(Post post) { | ||
return PostGetUnpaidPrivateResponse.builder() | ||
.postId(post.getPostId()) | ||
.customerName(post.getCustomer().getNickname()) | ||
.cost(post.getCost()) | ||
.isPublic(post.getIsPublic()) | ||
.createdAt(post.getCreatedAt()) | ||
.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
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: 6 additions & 0 deletions
6
src/main/java/com/example/sharemind/post/application/PostService.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,8 +1,14 @@ | ||
package com.example.sharemind.post.application; | ||
|
||
import com.example.sharemind.post.domain.Post; | ||
import com.example.sharemind.post.dto.request.PostCreateRequest; | ||
import java.util.List; | ||
|
||
public interface PostService { | ||
|
||
void createPost(PostCreateRequest postCreateRequest, Long customerId); | ||
|
||
List<Post> getUnpaidPrivatePosts(); | ||
|
||
Post getPostByPostId(Long postId); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/example/sharemind/post/exception/PostErrorCode.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.example.sharemind.post.exception; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum PostErrorCode { | ||
|
||
POST_NOT_FOUND(HttpStatus.NOT_FOUND, "일대다 상담이 존재하지 않습니다."), | ||
POST_ALREADY_PAID(HttpStatus.BAD_REQUEST, "이미 결제 완료된 일대다 상담입니다."); | ||
|
||
private final HttpStatus httpStatus; | ||
private final String message; | ||
} |
Oops, something went wrong.