Skip to content

Commit

Permalink
fix: 봉투 생성 및 수정 Response에 카테고리 정보를 포함
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Jul 8, 2024
1 parent f3169ac commit 9dbb853
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class EnvelopeFacade(
envelope = createdEnvelope,
friend = friend,
friendRelationship = friendRelationship,
relationship = relationship
relationship = relationship,
category = CategoryWithCustomModel.of(category, customCategory)
)
}
}
Expand Down Expand Up @@ -168,7 +169,8 @@ class EnvelopeFacade(
envelope = updatedEnvelope,
friend = friend,
friendRelationship = friendRelationship,
relationship = relationship
relationship = relationship,
category = CategoryWithCustomModel.of(category, customCategory)
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.oksusu.susu.api.envelope.model.response

import com.oksusu.susu.api.category.model.CategoryWithCustomModel
import com.oksusu.susu.api.envelope.model.EnvelopeModel
import com.oksusu.susu.api.friend.model.FriendModel
import com.oksusu.susu.api.friend.model.FriendRelationshipModel
Expand All @@ -17,19 +18,23 @@ data class CreateAndUpdateEnvelopeResponse(
val friendRelationship: FriendRelationshipModel,
/** 관계 정보 */
val relationship: RelationshipModel,
/** 카테고리 정보 */
val category: CategoryWithCustomModel,
) {
companion object {
fun of(
envelope: Envelope,
friend: Friend,
friendRelationship: FriendRelationship,
relationship: RelationshipModel,
category: CategoryWithCustomModel,
): CreateAndUpdateEnvelopeResponse {
return CreateAndUpdateEnvelopeResponse(
envelope = EnvelopeModel.from(envelope),
friend = FriendModel.from(friend),
friendRelationship = FriendRelationshipModel.from(friendRelationship),
relationship = relationship
relationship = relationship,
category = category
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface PostRepository : JpaRepository<Post, Long>, PostCustomRepository {
fun findAllByUidIn(uid: List<Long>): List<Post>

@Transactional(readOnly = true)
fun findAllByIdIn(punishPostIds: List<Long>) : List<Post>
fun findAllByIdIn(punishPostIds: List<Long>): List<Post>
}

interface PostCustomRepository {
Expand Down

0 comments on commit 9dbb853

Please sign in to comment.