-
Notifications
You must be signed in to change notification settings - Fork 0
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
create notice board post, getAll apis #74
Conversation
src/apis/notice-boards/controllers/notice-boards.controller.spec.ts
Outdated
Show resolved
Hide resolved
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.
|
||
@ApiProperty({ | ||
description: '댓글 허용 여부 (false: 비활성화, true: 허용)', | ||
default: true, |
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.
이거 default 가 없는거아닌가요??
description: 'title 필터링', | ||
maxLength: NOTICE_BOARD_TITLE_LENGTH.MAX, | ||
}) | ||
@Length(NOTICE_BOARD_TITLE_LENGTH.MIN - 1, NOTICE_BOARD_TITLE_LENGTH.MAX) |
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.
min 에 -1 은 왜 하는건가요???
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.
Optional인데 min이 1이 걸려 있으면 안되지 않을까 했는데 직접 돌려 보니까 상관 없네용 수정하겠습니다!
}) | ||
@IsBoolean() | ||
@IsOptional() | ||
@Type(() => Boolean) |
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.
query string 은 문자열로 평가되기때문에 Type decorator 로 boolean 변환을 한다면 'true', 'false' 둘다 js 상에서 true 로 평가돼서 값이 들어오는 경우에 무조건적으로 true 로 들어오게 될거같네요
comment: '공지게시글 내용', | ||
}, | ||
{ | ||
name: 'allow_comment', |
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.
이게 원래 전에 notice_board 를 생성할 때 했어야하는 피드백인데 allow_comment 는 허용여부라는 의미를 정확하게 표현하지 못하는거같아요 is_allow_comment 같은 컬럼명으로 변경하는건 어떨까요??
변경한다면 notice_board table 도 같이 변경돼야할듯합니다.
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.
수정하고 다시 리뷰요청 하겠습니다!
|
||
@ApiNoticeBoard.Create({ summary: '공지 게시글 생성 API' }) | ||
@UseGuards(JwtAuthGuard) | ||
@SetResponse({ type: ResponseType.Detail, key: 'board' }) |
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.
key 에 notice 도 포함되면 좋을거같네요
default: true, | ||
}) | ||
@IsBoolean() | ||
allowComment: boolean; |
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.
migration 에서 드렸던 피드백을 수용한다면 여기도 변경돼야할듯 합니다.
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.
얜 칼럼명 변경하면서 사용한 마이그레이션데 삭제해야 할 것 같으면 지우겠습니다.
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.
상태 변경용
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.
dto 기본값반 수정하면 될듯합니다.
order: Order<typeof NOTICE_BOARD_ORDER_FIELD> = { id: SortOrder.Desc }; | ||
|
||
@IsDefined() | ||
status: NoticeBoardStatus.Posting; |
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.
여기 기본값이 필요할듯합니다.
default: NoticeBoardStatus.Posting, | ||
}) | ||
@IsDefined() | ||
status: NoticeBoardStatus.Posting; |
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.
swagger 상에 디폴트가 아닌 서버 내부에서 디폴트가 필요할듯해요
게시글 생성 시 clident 측에서 게시글의 상태를 핸들링하게할 수 없으니 서버 내부에서 기본적으로 Posting 상태로 되게끔 해야합니다. ㅎㅎ
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.
앗 넵!
@IsOptional() | ||
order: Order<typeof NOTICE_BOARD_ORDER_FIELD> = { id: SortOrder.Desc }; | ||
|
||
@ApiProperty({ |
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 propery 데코레이터는 제거하는게 좋을거같아요
@hobiJeong 충돌 해결 후 머지해주세요 고생하셨습니다. |
Description
공지게시판 게시글 작성, 전체 조회 api를 만들었습니다.
To Reviewer
엔티티 변경 및 history 엔티티 및 service도 추가 되었습니다.
Reference Link
Related Issue Link
#66
API