-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: notice 패키지 프론트에 맞게 협의 #54
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a1783da
fix: professor, staff에 uploadImage 추가
skfotakf 069212e
fix: research에서 isPublic 제거, feat: lab에서 attachments 추가
skfotakf 70c9e37
fix: attachments -> attachmentResponses 변경
skfotakf bda70ef
feat: LabProfessorResponse 추가
skfotakf b52619f
fix: pdf를 list가 아닌 단일항목으로 수정
skfotakf af19681
feat: readLab 추가
skfotakf b5f6a6b
feat: ResearchLabReponse 추가 및 주석 삭제
skfotakf 2975ebd
fix: researchDetail에 사진, 첨부파일 업로드 추가
skfotakf fa44f43
feat: notice에 attachments 추가
skfotakf 6340295
fix: fix_with_front1 변경 사항에 맞게 수정
skfotakf 50ee14b
feat: isImportant 추가
skfotakf c1f9589
feat: NoticeSearchDto에 hasAttachment 추가
skfotakf 13d1048
fix: update에서 attachmetnts가 null일 때 빈 목록 반환
skfotakf 3f96a6f
feat: 공지사항 선택 고정해제, 선택 삭제 추가
skfotakf c5b7b36
fix: news, seminar에 isImportant 추가
skfotakf dae2376
Merge branch 'develop' into fix/fix_with_front2
skfotakf 693ff58
fix: pr 리뷰 수정
skfotakf d0520b5
fix: 수정했던거 다시 복구
skfotakf 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 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
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
19 changes: 12 additions & 7 deletions
19
src/main/kotlin/com/wafflestudio/csereal/core/notice/database/NoticeEntity.kt
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,36 +1,41 @@ | ||
package com.wafflestudio.csereal.core.notice.database | ||
|
||
import com.wafflestudio.csereal.common.config.BaseTimeEntity | ||
import com.wafflestudio.csereal.common.controller.AttachmentContentEntityType | ||
import com.wafflestudio.csereal.core.notice.dto.NoticeDto | ||
import com.wafflestudio.csereal.core.resource.attachment.database.AttachmentEntity | ||
import com.wafflestudio.csereal.core.user.database.UserEntity | ||
import jakarta.persistence.* | ||
|
||
|
||
@Entity(name = "notice") | ||
class NoticeEntity( | ||
|
||
var isDeleted: Boolean = false, | ||
|
||
var title: String, | ||
|
||
var description: String, | ||
|
||
var isPublic: Boolean, | ||
|
||
var isPinned: Boolean, | ||
var isImportant: Boolean, | ||
|
||
@OneToMany(mappedBy = "notice", cascade = [CascadeType.ALL]) | ||
var noticeTags: MutableSet<NoticeTagEntity> = mutableSetOf(), | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "users_id") | ||
val author: UserEntity | ||
) : BaseTimeEntity() { | ||
val author: UserEntity, | ||
|
||
@OneToMany(mappedBy = "notice", cascade = [CascadeType.ALL], orphanRemoval = true) | ||
var attachments: MutableList<AttachmentEntity> = mutableListOf(), | ||
|
||
) : BaseTimeEntity(), AttachmentContentEntityType { | ||
override fun bringAttachments() = attachments | ||
|
||
fun update(updateNoticeRequest: NoticeDto) { | ||
this.title = updateNoticeRequest.title | ||
this.description = updateNoticeRequest.description | ||
this.isPublic = updateNoticeRequest.isPublic | ||
this.isPinned = updateNoticeRequest.isPinned | ||
this.isImportant = updateNoticeRequest.isImportant | ||
} | ||
|
||
} |
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
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/com/wafflestudio/csereal/core/notice/dto/NoticeIdListRequest.kt
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 com.wafflestudio.csereal.core.notice.dto | ||
|
||
data class NoticeIdListRequest( | ||
val idList: List<Long> | ||
) { | ||
|
||
} |
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.
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.
제가 알기로는 MainImage로의 OneToOne 관계에서 Cascade관련 설정이 되어있지 않은 것으로 알고 있습니다.
따로 정의되지 않은 경우 기본적으로 Cascading이 일어나지 않아서 여기서 null을 처리하더라도 mainImage 자체는 제거되지 않는 것으로 알고 있습니다.
이미 테스트를 해보셨고 잘 된다면 상관없지만, 아니라면 이 부분이 수정이 필요해 보입니다.
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.
mainImage가 잘나타나긴 하는데, 제거는 또 그거랑 다른 거라고 이해했습니다.
슬랙에서 말한 거 따라서 mainImage의 isDeleted을 true로 만들었습니다.