Skip to content

Commit a26621f

Browse files
authored
Merge pull request #63 from noeyeyh/feat/notification
#59 Feat: 등록한 알림 삭제 API
2 parents d8937c8 + 40b6890 commit a26621f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/main/java/com/memesphere/domain/notification/controller/CoinNotificationController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public ApiResponse<NotificationResponse> updateNotificationStatus(@PathVariable(
102102
등록한 알림 조회 API 응답 형식과 동일
103103
```""")
104104
public ApiResponse<NotificationListResponse> deleteNotification(@PathVariable("notification-id") Long id) {
105-
return ApiResponse.onSuccess(coinNotificationService.removeNotification(id));
105+
coinNotificationService.removeNotification(id);
106+
return ApiResponse.onSuccess(coinNotificationService.findNotificationList());
106107
}
107108
}

src/main/java/com/memesphere/domain/notification/dto/request/NotificationRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@Builder
99
public class NotificationRequest {
1010

11-
@Schema(description = "코인 이름", example = "DOGE")
11+
@Schema(description = "코인 이름", example = "Dogecoin")
1212
private String name;
1313

1414
@Schema(description = "코인 심볼", example = "DOGE/USDT")

src/main/java/com/memesphere/domain/notification/service/CoinNotificationServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ public NotificationResponse modifyNotification(Long notificationId) {
6363

6464
@Override
6565
public NotificationListResponse removeNotification(Long notificationId) {
66+
67+
MemeCoin memeCoin = memeCoinRepository.findById(notificationId)
68+
.orElseThrow(() -> new GeneralException(ErrorStatus.MEMECOIN_NOT_FOUND));
69+
70+
notificationRepository.deleteById(notificationId);
71+
6672
return null;
6773
}
6874
}

0 commit comments

Comments
 (0)