-
Notifications
You must be signed in to change notification settings - Fork 1
[LNK-71] domain/notification 코틀린 마이그레이션 #93
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
base: dev
Are you sure you want to change the base?
The head ref may contain hidden characters: "LNK-71-Leenk-domain-notification-\uCF54\uD2C0\uB9B0-\uB9C8\uC774\uADF8\uB808\uC774\uC158"
Changes from 19 commits
2bbe0d6
5e78777
e957861
3a186b7
f9cae6f
fd0b3eb
78df67d
a4713ff
4c3d8ed
2756c0b
7ba0535
b0a2cb1
af84645
1f4fa72
e973728
e1ad234
01d2b01
8a8687a
cb055bd
7760fdc
23f21ef
1cee64a
0a2450e
0ecce79
2c27215
904a626
135491a
16b3f1a
6cbcb68
18099c3
5172409
29eb1e5
b7c8449
a12e2a9
80e8843
7be63af
1e83fe0
b8dde76
6a8f274
7ef2c53
5bd6876
8194de3
d585c83
cddb6d6
6bae775
c2fa607
74559ae
72e3936
e215a3c
8780959
e51b6fe
98c051a
dbfd30d
3ce17aa
16cdcdf
0d291b2
5da3012
4697206
11b5758
1880574
1027e22
28c2769
ff92ce1
7334555
871db61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m | ||
| org.gradle.parallel=true | ||
| org.gradle.caching=true | ||
| kotlin.daemon.jvmargs=-Xmx2048m | ||
| org.gradle.java.home=/Users/jj/Library/Java/JavaVirtualMachines/corretto-21.0.6/Contents/Home | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| import leets.leenk.domain.notification.domain.entity.Notification; | ||
| import leets.leenk.domain.notification.domain.service.NotificationCountGetService; | ||
| import leets.leenk.domain.notification.domain.service.NotificationGetService; | ||
| import leets.leenk.domain.notification.domain.service.NotificationMarkReadService; | ||
| import leets.leenk.domain.user.domain.entity.User; | ||
| import leets.leenk.domain.user.domain.service.user.UserGetService; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
@@ -22,6 +23,7 @@ public class NotificationUseCase { | |
|
|
||
| private final UserGetService userGetService; | ||
| private final NotificationGetService notificationGetService; | ||
| private final NotificationMarkReadService notificationMarkReadService; | ||
|
|
||
| private final NotificationCountGetService notificationCountGetService; | ||
| private final NotificationResponseMapper notificationResponseMapper; | ||
|
|
@@ -39,4 +41,10 @@ public NotificationCountResponse getNotificationCount(long userId) { | |
| User user = userGetService.findById(userId); | ||
| return notificationResponseMapper.toCountResponse(notificationCountGetService.getNotificationCount(user)); | ||
| } | ||
|
|
||
| @Transactional | ||
| public void markNotificationAsRead(Long userId, String notificationId) { | ||
|
||
| User user = userGetService.findById(userId); | ||
| notificationMarkReadService.markReadNotification(user, notificationId); | ||
| } | ||
| } | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| package leets.leenk.domain.feed.domain.event | ||
|
|
||
| /** | ||
| * Feed 도메인의 단일 이벤트 | ||
| * eventType으로 이벤트 종류 구분, data로 필요한 정보 전달 | ||
| */ | ||
| data class FeedDomainEvent( | ||
| val eventType: FeedEventType, | ||
| val data: Map<String, Any>, | ||
| ) { | ||
| companion object { | ||
| /** | ||
| * 피드 생성 이벤트 | ||
| */ | ||
| @JvmStatic | ||
| fun created( | ||
| feedId: Long, | ||
| authorId: Long, | ||
| authorName: String, | ||
| taggedUserIds: List<Long> = emptyList(), | ||
| ) = FeedDomainEvent( | ||
| eventType = FeedEventType.CREATED, | ||
| data = | ||
| mapOf( | ||
| "feedId" to feedId, | ||
| "authorId" to authorId, | ||
| "authorName" to authorName, | ||
| "taggedUserIds" to taggedUserIds, | ||
| ), | ||
| ) | ||
|
|
||
| /** | ||
| * 피드 공감 이벤트 | ||
| */ | ||
| @JvmStatic | ||
| fun reacted( | ||
| feedId: Long, | ||
| feedAuthorId: Long, | ||
| reactorId: Long, | ||
| reactorName: String, | ||
| previousReactionCount: Long, | ||
| totalReactionCount: Long, | ||
| ) = FeedDomainEvent( | ||
| eventType = FeedEventType.REACTED, | ||
| data = | ||
| mapOf( | ||
| "feedId" to feedId, | ||
| "feedAuthorId" to feedAuthorId, | ||
| "reactorId" to reactorId, | ||
| "reactorName" to reactorName, | ||
| "previousReactionCount" to previousReactionCount, | ||
| "totalReactionCount" to totalReactionCount, | ||
| ), | ||
| ) | ||
| } | ||
|
|
||
| // 타입 안전한 접근자 | ||
| val feedId: Long get() = data["feedId"] as Long | ||
| val authorId: Long get() = data["authorId"] as Long | ||
| val authorName: String get() = data["authorName"] as String | ||
| val taggedUserIds: List<Long> | ||
| get() = (data["taggedUserIds"] as? List<*>)?.filterIsInstance<Long>() ?: emptyList() | ||
| val feedAuthorId: Long get() = data["feedAuthorId"] as Long | ||
| val reactorId: Long get() = data["reactorId"] as Long | ||
| val reactorName: String get() = data["reactorName"] as String | ||
| val previousReactionCount: Long get() = data["previousReactionCount"] as Long | ||
| val totalReactionCount: Long get() = data["totalReactionCount"] as Long | ||
jj0526 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package leets.leenk.domain.feed.domain.event | ||
|
|
||
| /** | ||
| * Feed 도메인 이벤트 타입 | ||
| */ | ||
| enum class FeedEventType { | ||
| CREATED, // 피드 생성 | ||
| REACTED, // 피드 공감 | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.