-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
18 changes: 13 additions & 5 deletions
18
...main/notification/api/PushController.java → ...ification/api/NotificationController.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,30 +1,38 @@ | ||
package com.depromeet.domain.notification.api; | ||
|
||
import com.depromeet.domain.notification.application.PushService; | ||
import com.depromeet.domain.notification.application.NotificationService; | ||
import com.depromeet.domain.notification.dto.NotificationFindAllResponse; | ||
import com.depromeet.domain.notification.dto.request.PushMissionRemindRequest; | ||
import com.depromeet.domain.notification.dto.request.PushUrgingSendRequest; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@Tag(name = "8. [알림]", description = "알림 관련 API") | ||
@RestController | ||
@RequestMapping("/notifications") | ||
@RequiredArgsConstructor | ||
public class PushController { | ||
private final PushService pushService; | ||
public class NotificationController { | ||
private final NotificationService notificationService; | ||
|
||
@Operation(summary = "알림센터 조회", description = "알림센터 목록을 조회합니다.") | ||
@GetMapping | ||
public List<NotificationFindAllResponse> notificationFindAll() { | ||
return notificationService.findAllNotification(); | ||
} | ||
|
||
@Operation(summary = "재촉하기", description = "당일 미션을 완료하지 않은 친구에게 재촉하기 Push Message를 발송합니다.") | ||
@PostMapping("/urging") | ||
public void urgingSend(@Valid @RequestBody PushUrgingSendRequest request) { | ||
pushService.sendUrgingPush(request); | ||
notificationService.sendUrgingPush(request); | ||
} | ||
|
||
@Operation(summary = "미션 타이머 리마인드 알림", description = "인증을 놓치는 경우에 대비하여 리마인드 알림을 전송합니다.") | ||
@PostMapping("/missions/remind") | ||
public void missionRemindSend(@Valid @RequestBody PushMissionRemindRequest request) { | ||
pushService.sendMissionRemindPush(request); | ||
notificationService.sendMissionRemindPush(request); | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/depromeet/domain/notification/dto/NotificationFindAllResponse.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,16 @@ | ||
package com.depromeet.domain.notification.dto; | ||
|
||
import com.depromeet.domain.mission.domain.*; | ||
import com.depromeet.domain.notification.domain.NotificationType; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalDateTime; | ||
|
||
public record NotificationFindAllResponse( | ||
@Schema(description = "알림 타입") NotificationType notificationType, | ||
@Schema(description = "알림 날짜") LocalDateTime createdAt) { | ||
|
||
public static NotificationFindAllResponse of( | ||
NotificationType notificationType, LocalDateTime createdAt) { | ||
return new NotificationFindAllResponse(notificationType, createdAt); | ||
} | ||
} |
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