-
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/#41 문의하기 조회 & 삭제 & 답변 기능 구현
- Loading branch information
Showing
15 changed files
with
431 additions
and
18 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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/pyro/yolog/domain/inquiry/dto/request/InquiryAnswerRequest.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.pyro.yolog.domain.inquiry.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class InquiryAnswerRequest { | ||
@Schema(description = "답변 내용입니다. 공백으로 제출하면 안됩니다.") | ||
@NotBlank | ||
private String answer; | ||
} |
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/pyro/yolog/domain/inquiry/dto/response/DetailInquiryResponse.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,27 @@ | ||
package com.pyro.yolog.domain.inquiry.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Builder | ||
public class DetailInquiryResponse { | ||
@Schema(description = "문의 ID") | ||
private Long id; | ||
private String title; | ||
private String content; | ||
@Schema(description = "문의에 대한 답변") | ||
private String answer; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul") | ||
private LocalDateTime createdAt; | ||
|
||
@Schema(description = "답변 완료되었는지 여부") | ||
private Boolean isAnswered; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/pyro/yolog/domain/inquiry/dto/response/InquiryPreview.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,24 @@ | ||
package com.pyro.yolog.domain.inquiry.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Builder | ||
public class InquiryPreview { | ||
@Schema(description = "문의 ID") | ||
private Long id; | ||
private String title; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul") | ||
private LocalDateTime createdAt; | ||
|
||
@Schema(description = "답변 완료되었는지 여부") | ||
private Boolean isAnswered; | ||
} |
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
...in/java/com/pyro/yolog/domain/inquiry/exception/InquiryAnswerNotAdminMemberException.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.pyro.yolog.domain.inquiry.exception; | ||
|
||
import com.pyro.yolog.global.error.ErrorCode; | ||
import com.pyro.yolog.global.error.exception.BusinessException; | ||
|
||
public class InquiryAnswerNotAdminMemberException extends BusinessException { | ||
public InquiryAnswerNotAdminMemberException() { | ||
super(ErrorCode.INQUIRY_NOT_ADMIN_MEMBER); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/pyro/yolog/domain/inquiry/exception/InquiryNotFoundException.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.pyro.yolog.domain.inquiry.exception; | ||
|
||
import com.pyro.yolog.global.error.ErrorCode; | ||
import com.pyro.yolog.global.error.exception.BusinessException; | ||
|
||
public class InquiryNotFoundException extends BusinessException { | ||
public InquiryNotFoundException() { | ||
super(ErrorCode.INQUIRY_NOT_FOUND_ERROR); | ||
} | ||
} |
8 changes: 7 additions & 1 deletion
8
src/main/java/com/pyro/yolog/domain/inquiry/mapper/InquiryMapper.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,11 +1,17 @@ | ||
package com.pyro.yolog.domain.inquiry.mapper; | ||
|
||
import com.pyro.yolog.domain.inquiry.dto.response.DetailInquiryResponse; | ||
import com.pyro.yolog.domain.inquiry.dto.response.InquiryPreview; | ||
import com.pyro.yolog.domain.inquiry.entity.Inquiry; | ||
import com.pyro.yolog.domain.member.entity.Member; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.MappingConstants; | ||
|
||
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING) | ||
public interface InquiryMapper { | ||
Inquiry toEntity(Member member, String content); | ||
Inquiry toEntity(Member member, String title, String content); | ||
|
||
InquiryPreview toPreviewResponse(Inquiry inquiry); | ||
|
||
DetailInquiryResponse toDetailResponse(Inquiry inquiry); | ||
} |
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
Oops, something went wrong.