Skip to content

Commit 335712d

Browse files
authored
게시글 inform, practice 작성 실패 오류 해결 (#396)
1 parent deb43e4 commit 335712d

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

back/src/main/java/com/back/domain/post/post/entity/Post.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
public class Post extends BaseEntity {
2222
@NotNull(message = "제목은 null일 수 없습니다.")
2323
private String title;
24+
2425
@NotNull
26+
@Column(columnDefinition = "TEXT")
2527
private String content;
2628

2729
@ManyToOne(fetch = FetchType.LAZY)

back/src/main/java/com/back/domain/post/post/service/PostService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public PostCreateResponse createPost(PostCreateRequest postCreateRequest, Member
4848
.build();
4949

5050

51-
if(postType == Post.PostType.PRACTICEPOST) {
52-
post.updateJob(postCreateRequest.job());
53-
}
51+
// if(postType == Post.PostType.PRACTICEPOST) {
52+
// post.updateJob(postCreateRequest.job());
53+
// }
5454

5555
// PostType이 QUESTIONPOST인 경우 isResolve를 false로 초기화
5656
if(postType == Post.PostType.QUESTIONPOST) {

back/src/main/java/com/back/global/globalExceptionHandler/GlobalExceptionHandler.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,17 @@ public ResponseEntity<RsData<Void>> handle(ServiceException ex) {
148148
);
149149
}
150150

151-
// @ExceptionHandler(Exception.class)
152-
// public ResponseEntity<RsData<Void>> handle(Exception ex) {
153-
// log.error("Unhandled exception occurred", ex);
154-
// Sentry.captureException(ex);
155-
//
156-
// return new ResponseEntity<>(
157-
// new RsData<>(
158-
// "500-1",
159-
// "서버 오류가 발생했습니다."
160-
// ),
161-
// INTERNAL_SERVER_ERROR
162-
// );
163-
// }
151+
@ExceptionHandler(Exception.class)
152+
public ResponseEntity<RsData<Void>> handle(Exception ex) {
153+
log.error("Unhandled exception occurred", ex);
154+
Sentry.captureException(ex);
155+
156+
return new ResponseEntity<>(
157+
new RsData<>(
158+
"500-1",
159+
"서버 오류가 발생했습니다."
160+
),
161+
INTERNAL_SERVER_ERROR
162+
);
163+
}
164164
}

back/src/test/java/com/back/domain/post/post/service/PostServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void createPost_practicePost_mentor_success() {
8585
assertThat(savedPost.getPostType()).isEqualTo(Post.PostType.PRACTICEPOST);
8686
assertThat(savedPost.getTitle()).isEqualTo("실무경험");
8787
assertThat(savedPost.getContent()).isEqualTo("실무내용");
88-
assertThat(savedPost.getJob()).isEqualTo("백엔드");
88+
//assertThat(savedPost.getJob()).isEqualTo("백엔드");
8989
assertThat(savedPost.getMember()).isEqualTo(mentor);
9090
}
9191

0 commit comments

Comments
 (0)