-
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 #165 from Genti2024/hotfix/push-type
Fix: #163 swagger 문서화 추가
- Loading branch information
Showing
3 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
genti-api/src/main/java/com/gt/genti/admin/api/PushNotificationApi.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,40 @@ | ||
package com.gt.genti.admin.api; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
import com.gt.genti.admin.dto.request.SendPushRequestDto; | ||
import com.gt.genti.error.ResponseCode; | ||
import com.gt.genti.response.GentiResponse; | ||
import com.gt.genti.swagger.EnumResponse; | ||
import com.gt.genti.swagger.EnumResponses; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
|
||
@Tag(name = "[PushNotificationController] 푸시알림 컨트롤러", description = "백엔드용 푸시알림 보내기") | ||
public interface PushNotificationApi { | ||
|
||
@Operation(summary = "업데이트 푸시알림 보내기", description = "OB, YB 유저 식별하여 전체 푸시알림") | ||
@EnumResponses(value = { | ||
@EnumResponse(ResponseCode.OK), | ||
}) | ||
ResponseEntity<GentiResponse.ApiResult<Boolean>> sendUpdatePush( | ||
@RequestHeader(value = "Admin-Secret-Key") String adminSecretKey, | ||
@RequestBody SendPushRequestDto sendPushRequestDto | ||
); | ||
|
||
@Operation(summary = "푸시알림 테스트", description = "이메일 입력하여 해당 사용자에게 테스트") | ||
@EnumResponses(value = { | ||
@EnumResponse(ResponseCode.OK), | ||
}) | ||
ResponseEntity<GentiResponse.ApiResult<Boolean>> test( | ||
@RequestHeader(value = "Admin-Secret-Key") String adminSecretKey, | ||
@RequestBody SendPushRequestDto sendPushRequestDto, | ||
@RequestParam(name = "email") String email | ||
); | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -22,8 +22,8 @@ public void sendUpdatePush(SendPushRequestDto sendPushRequestDto) { | |
sendPushRequestDto.getBody())); | ||
} | ||
|
||
public void test(SendPushRequestDto sendPushRequestDto) { | ||
userRepository.findByEmail("[email protected]").ifPresent( | ||
public void test(SendPushRequestDto sendPushRequestDto, String email) { | ||
userRepository.findByEmail(email).ifPresent( | ||
u -> customEventPublisher.publishCustomEvent(u.getId(), sendPushRequestDto.getTitle(), | ||
sendPushRequestDto.getBody()) | ||
); | ||
|