-
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.
issue/135 ✨ [FEAT] 오류 문의 및 신고하기 API 구현 (#141)
* ✨ Feat : 오류 문의 및 신고하기 API 추가 * ✨ Feat : 내가 적은 오류 문의 모아보기 API 구현
- Loading branch information
Showing
17 changed files
with
356 additions
and
9 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
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,47 @@ | ||
package zipdabang.server.domain.member; | ||
|
||
import lombok.*; | ||
import org.hibernate.annotations.DynamicInsert; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
import zipdabang.server.domain.common.BaseEntity; | ||
|
||
import javax.persistence.*; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
@NoArgsConstructor(access = AccessLevel.PUBLIC) | ||
@DynamicInsert | ||
@DynamicUpdate | ||
@Entity | ||
public class Inquery extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(nullable = false) | ||
private String receiveEmail; | ||
|
||
@Column(nullable = false,length = 20) | ||
private String title; | ||
|
||
@Column(nullable = false,length = 500) | ||
private String body; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "member_id") | ||
private Member member; | ||
|
||
@OneToMany(mappedBy = "inquery", cascade = CascadeType.ALL) | ||
private List<InqueryImage> inqueryImageList = new ArrayList<>(); | ||
|
||
public void setMember(Member member){ | ||
if(this.member != null) | ||
member.getInqueryList().remove(this); | ||
this.member = member; | ||
member.getInqueryList().add(this); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/zipdabang/server/domain/member/InqueryImage.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,34 @@ | ||
package zipdabang.server.domain.member; | ||
|
||
import lombok.*; | ||
import org.hibernate.annotations.DynamicInsert; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
|
||
import javax.persistence.*; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
@NoArgsConstructor(access = AccessLevel.PUBLIC) | ||
@DynamicInsert | ||
@DynamicUpdate | ||
@Entity | ||
public class InqueryImage { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private String imageUrl; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "inquery_id") | ||
private Inquery inquery; | ||
|
||
public void setInquery(Inquery inquery){ | ||
if (this.inquery != null) | ||
inquery.getInqueryImageList().remove(this); | ||
this.inquery = inquery; | ||
inquery.getInqueryImageList().add(this); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
src/main/java/zipdabang/server/repository/memberRepositories/InqueryImageRepository.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,7 @@ | ||
package zipdabang.server.repository.memberRepositories; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import zipdabang.server.domain.member.InqueryImage; | ||
|
||
public interface InqueryImageRepository extends JpaRepository<InqueryImage, Long> { | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/zipdabang/server/repository/memberRepositories/InqueryRepository.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,12 @@ | ||
package zipdabang.server.repository.memberRepositories; | ||
|
||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.PageRequest; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import zipdabang.server.domain.member.Inquery; | ||
import zipdabang.server.domain.member.Member; | ||
|
||
public interface InqueryRepository extends JpaRepository<Inquery, Long> { | ||
|
||
Page<Inquery> findByMember(Member member, PageRequest pageRequest); | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/zipdabang/server/validation/annotation/CheckPage.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,17 @@ | ||
package zipdabang.server.validation.annotation; | ||
|
||
import zipdabang.server.validation.validator.CheckPageValidator; | ||
|
||
import javax.validation.Constraint; | ||
import javax.validation.Payload; | ||
import java.lang.annotation.*; | ||
|
||
@Documented | ||
@Constraint(validatedBy = CheckPageValidator.class) | ||
@Target( { ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface CheckPage { | ||
String message() default "해당하는 페이지가 존재하지 않습니다."; | ||
Class<?>[] groups() default {}; | ||
Class<? extends Payload>[] payload() default {}; | ||
} |
Oops, something went wrong.