-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT] NoticeCategory 추가 #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5839d67
[FEAT] Notice 안에 noticeIcon 추가
rinarina0429 d7f45bf
[FEAT] NoticeCategory 도메인 추가
rinarina0429 f4cbe0a
[FEAT] NoticeCategory 레포지토리 추가
rinarina0429 4e3200c
[FEAT] Notice에 NoticeCategory 연결
rinarina0429 214e5cf
[FIX] 공지 GET 할 때 noticeCategoryImage 함께 내려주도록 수정
rinarina0429 ffbba11
[FEAT] NoticeCategory 관련 에러 처리 추가
rinarina0429 901b343
[FIX] Notice Edit, Post Request에서 noticeCategoryId 함께 받도록 수정
rinarina0429 207d003
[FIX] 추가된 NoticeCategory를 바탕으로 NoticeService 수정
rinarina0429 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
28 changes: 28 additions & 0 deletions
28
src/main/java/org/websoso/WSSServer/domain/NoticeCategory.java
This file contains hidden or 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,28 @@ | ||
| package org.websoso.WSSServer.domain; | ||
|
|
||
| import static jakarta.persistence.GenerationType.IDENTITY; | ||
|
|
||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.GeneratedValue; | ||
| import jakarta.persistence.Id; | ||
| import lombok.AccessLevel; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Entity | ||
| @Getter | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| public class NoticeCategory { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = IDENTITY) | ||
| @Column(nullable = false) | ||
| private Byte noticeCategoryId; | ||
|
|
||
| @Column(columnDefinition = "varchar(10)", nullable = false) | ||
| private String noticeCategoryName; | ||
|
|
||
| @Column(columnDefinition = "text", nullable = false) | ||
| private String noticeCategoryImage; | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
19 changes: 19 additions & 0 deletions
19
src/main/java/org/websoso/WSSServer/exception/error/CustomNoticeCategoryError.java
This file contains hidden or 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,19 @@ | ||
| package org.websoso.WSSServer.exception.error; | ||
|
|
||
| import static org.springframework.http.HttpStatus.NOT_FOUND; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import org.springframework.http.HttpStatus; | ||
| import org.websoso.WSSServer.exception.common.ICustomError; | ||
|
|
||
| @AllArgsConstructor | ||
| @Getter | ||
| public enum CustomNoticeCategoryError implements ICustomError { | ||
|
|
||
| NOTICE_CATEGORY_NOT_FOUND("NOTICE_CATEGORY-001", "해당 아이디를 가진 공지 카테고리를 찾을 수 없습니다.", NOT_FOUND); | ||
|
|
||
| private final String code; | ||
| private final String description; | ||
| private final HttpStatus statusCode; | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/main/java/org/websoso/WSSServer/exception/exception/CustomNoticeCategoryException.java
This file contains hidden or 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,13 @@ | ||
| package org.websoso.WSSServer.exception.exception; | ||
|
|
||
| import lombok.Getter; | ||
| import org.websoso.WSSServer.exception.common.AbstractCustomException; | ||
| import org.websoso.WSSServer.exception.error.CustomNoticeCategoryError; | ||
|
|
||
| @Getter | ||
| public class CustomNoticeCategoryException extends AbstractCustomException { | ||
|
|
||
| public CustomNoticeCategoryException(CustomNoticeCategoryError customNoticeCategoryError, String message) { | ||
| super(customNoticeCategoryError, message); | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
src/main/java/org/websoso/WSSServer/repository/NoticeCategoryRepository.java
This file contains hidden or 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,9 @@ | ||
| package org.websoso.WSSServer.repository; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
| import org.websoso.WSSServer.domain.NoticeCategory; | ||
|
|
||
| @Repository | ||
| public interface NoticeCategoryRepository extends JpaRepository<NoticeCategory, Byte> { | ||
| } |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3; 해당 로직에서 공지 카테고리 ID를 받아 공지 카테고리 엔티티를 조회하도록 구현하셨는데,
NoticeCategory엔티티의noticeCategoryName컬럼을 활용해보는 건 어떨까요? 현재 방식은 카테고리 ID를 이용해서 카테고리 종류가 많아질 경우 클라이언트가 각 ID를 일일이 외워야 한다는 점에서 다소 불편할 수 있을 것 같다는 생각이 듭니당카테고리 이름을 활용하면 클라이언트 입장에서 더 유연한 접근이 가능해질 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하! 클라에서 사용하지 않는 api라 그냥 이렇게 만들었는데 저희가 그냥 포스트맨에서 쓰기에도 그게 편하겠네요. 수정하겠슴다~!👍🏻👍🏻