-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: create notification domain (#173)
* ✨ feat: create notification domain * ♻️ chore: delete BaseTimeEntity * ♻️ chore: refactor Notification entity * ♻️ chore: refactor Target entity * ♻️ chore: refactor User entity * ♻️ chore: refactor UserDevice entity * ✨ feat: create NotificationRepository
- Loading branch information
Showing
10 changed files
with
114 additions
and
0 deletions.
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
9 changes: 9 additions & 0 deletions
9
...treetdrop-notification/src/main/java/com/depromeet/common/config/MongoAuditingConfig.java
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,9 @@ | ||
package com.depromeet.common.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.mongodb.config.EnableMongoAuditing; | ||
|
||
@Configuration | ||
@EnableMongoAuditing | ||
public class MongoAuditingConfig { | ||
} |
30 changes: 30 additions & 0 deletions
30
backend/streetdrop-notification/src/main/java/com/depromeet/domain/Notification.java
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,30 @@ | ||
package com.depromeet.domain; | ||
|
||
import lombok.Builder; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.Id; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.mongodb.core.mapping.Document; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.Date; | ||
|
||
@Builder | ||
@Document("notification") | ||
public class Notification { | ||
|
||
@Id | ||
private String id; | ||
private String title; | ||
private String content; | ||
private String type; | ||
private User user; | ||
private Target target; | ||
private LocalDateTime viewedTime; | ||
private boolean isDeleted; | ||
@CreatedDate | ||
private Date createdAt; | ||
@LastModifiedDate | ||
private Date modifiedAt; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
backend/streetdrop-notification/src/main/java/com/depromeet/domain/Target.java
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,14 @@ | ||
package com.depromeet.domain; | ||
|
||
import com.depromeet.domain.vo.Channel; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public class Target { | ||
|
||
private Channel channel; | ||
private int level; | ||
private String page; | ||
private long pageId; | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
backend/streetdrop-notification/src/main/java/com/depromeet/domain/User.java
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,11 @@ | ||
package com.depromeet.domain; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public class User { | ||
|
||
private Long userId; | ||
private String deviceToken; | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
backend/streetdrop-notification/src/main/java/com/depromeet/domain/UserDevice.java
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,27 @@ | ||
package com.depromeet.domain; | ||
|
||
import com.depromeet.domain.vo.OsType; | ||
import lombok.Builder; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.Id; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.mongodb.core.mapping.Document; | ||
|
||
import java.util.Date; | ||
|
||
@Builder | ||
@Document(collection = "user_device") | ||
public class UserDevice { | ||
|
||
@Id | ||
private String id; | ||
private Long userId; | ||
private String deviceToken; | ||
private OsType osType; | ||
private String osVersion; | ||
private boolean isDeleted; | ||
@CreatedDate | ||
private Date createdAt; | ||
@LastModifiedDate | ||
private Date modifiedAt; | ||
} |
5 changes: 5 additions & 0 deletions
5
backend/streetdrop-notification/src/main/java/com/depromeet/domain/vo/Channel.java
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,5 @@ | ||
package com.depromeet.domain.vo; | ||
|
||
public enum Channel { | ||
GENERAL | ||
} |
6 changes: 6 additions & 0 deletions
6
backend/streetdrop-notification/src/main/java/com/depromeet/domain/vo/OsType.java
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,6 @@ | ||
package com.depromeet.domain.vo; | ||
|
||
|
||
public enum OsType { | ||
IOS, ANDROID | ||
} |
7 changes: 7 additions & 0 deletions
7
...treetdrop-notification/src/main/java/com/depromeet/repository/NotificationRepository.java
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.depromeet.repository; | ||
|
||
import com.depromeet.domain.Notification; | ||
import org.springframework.data.mongodb.repository.MongoRepository; | ||
|
||
public interface NotificationRepository extends MongoRepository<Notification, String> { | ||
} |
4 changes: 4 additions & 0 deletions
4
backend/streetdrop-notification/src/main/resources/application.yml
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,2 +1,6 @@ | ||
spring: | ||
data: | ||
mongodb: | ||
uri: ${MONGO_DB_URL} | ||
fcm: | ||
value: streetdrop-notification-fcm.json |