-
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.
Merge pull request #191 from bankidz/feature/notificationAPI
feat: 알림 관련 API 2개 추가 #189
- Loading branch information
Showing
7 changed files
with
118 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.ceos.bankids.dto; | ||
|
||
import com.ceos.bankids.domain.Notification; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import java.sql.Timestamp; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@ApiModel(value = "알림 리스트로 줄 때 DTO") | ||
@Getter | ||
@ToString | ||
@EqualsAndHashCode | ||
public class NotificationDTO { | ||
|
||
@ApiModelProperty(example = "1") | ||
private Long id; | ||
|
||
@ApiModelProperty(example = "알림 제목") | ||
private String title; | ||
|
||
@ApiModelProperty(example = "알림 내용") | ||
private String message; | ||
|
||
@ApiModelProperty(example = "false") | ||
private Boolean isRead; | ||
|
||
@ApiModelProperty(example = "2022/07/05 05:05:05") | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd hh:mm:ss", timezone = "Asia/Seoul") | ||
private Timestamp createdAt; | ||
|
||
public NotificationDTO(Notification notification) { | ||
this.id = notification.getId(); | ||
this.title = notification.getTitle(); | ||
this.message = notification.getMessage(); | ||
this.isRead = notification.getIsRead(); | ||
this.createdAt = notification.getCreatedAt(); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
src/main/java/com/ceos/bankids/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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package com.ceos.bankids.repository; | ||
|
||
import com.ceos.bankids.domain.Notification; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
|
||
public interface NotificationRepository extends | ||
JpaRepository<Notification, Long> { | ||
|
||
public List<Notification> findAllByUserId(Long userId); | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/ceos/bankids/service/ExpoNotificationService.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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
package com.ceos.bankids.service; | ||
|
||
import com.ceos.bankids.domain.User; | ||
import com.ceos.bankids.dto.NotificationDTO; | ||
import java.util.List; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public interface ExpoNotificationService { | ||
|
||
public List<NotificationDTO> readNotificationList(User user); | ||
|
||
public NotificationDTO updateNotification(User user, Long notificationId); | ||
} |
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