-
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.
Update and modernize code, update dependencies (part 2)
- Loading branch information
Showing
12 changed files
with
60 additions
and
58 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
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
2 changes: 1 addition & 1 deletion
2
...tionrelay/common/NotificationRequest.java → ...emis/push/common/NotificationRequest.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,4 +1,4 @@ | ||
package de.tum.cit.artemis.push.artemispushnotificationrelay.common; | ||
package de.tum.cit.artemis.push.common; | ||
|
||
public record NotificationRequest(String initializationVector, String payloadCipherText, String token) { | ||
} |
2 changes: 1 addition & 1 deletion
2
...notificationrelay/common/SendService.java → .../cit/artemis/push/common/SendService.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
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
8 changes: 0 additions & 8 deletions
8
...emis/push/artemispushnotificationrelay/firebase/FirebaseSendPushNotificationsRequest.java
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
.../src/main/java/de/tum/cit/artemis/push/firebase/FirebaseSendPushNotificationsRequest.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,8 @@ | ||
package de.tum.cit.artemis.push.firebase; | ||
|
||
import de.tum.cit.artemis.push.common.NotificationRequest; | ||
|
||
import java.util.List; | ||
|
||
public record FirebaseSendPushNotificationsRequest(List<NotificationRequest> notificationRequest) { | ||
} |
6 changes: 3 additions & 3 deletions
6
...onrelay/firebase/FirebaseSendService.java → ...is/push/firebase/FirebaseSendService.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
2 changes: 1 addition & 1 deletion
2
...emisPushNotificationRelayApplication.java → ...emisPushNotificationRelayApplication.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
38 changes: 38 additions & 0 deletions
38
hermes/src/main/java/de/tum/cit/artemis/push/RelayRestController.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,38 @@ | ||
package de.tum.cit.artemis.push; | ||
|
||
import de.tum.cit.artemis.push.apns.ApnsSendService; | ||
import de.tum.cit.artemis.push.common.NotificationRequest; | ||
import de.tum.cit.artemis.push.firebase.FirebaseSendPushNotificationsRequest; | ||
import de.tum.cit.artemis.push.firebase.FirebaseSendService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequestMapping("/api/push_notification") | ||
public class RelayRestController { | ||
|
||
private final FirebaseSendService firebaseSendService; | ||
|
||
private final ApnsSendService apnsSendService; | ||
|
||
public RelayRestController(FirebaseSendService firebaseSendService, ApnsSendService apnsSendService) { | ||
this.firebaseSendService = firebaseSendService; | ||
this.apnsSendService = apnsSendService; | ||
} | ||
|
||
@PostMapping("send_firebase") | ||
public ResponseEntity<Void> send(@RequestBody FirebaseSendPushNotificationsRequest notificationRequests) { | ||
return firebaseSendService.send(notificationRequests.notificationRequest()); | ||
} | ||
|
||
@PostMapping("send_apns") | ||
public ResponseEntity<Void> send(@RequestBody NotificationRequest notificationRequest) { | ||
return apnsSendService.send(notificationRequest); | ||
} | ||
|
||
@GetMapping("alive") | ||
public ResponseEntity<Void> alive() { | ||
return ResponseEntity.ok().build(); | ||
} | ||
} |
34 changes: 0 additions & 34 deletions
34
...c/main/java/de/tum/cit/artemis/push/artemispushnotificationrelay/RelayRestController.java
This file was deleted.
Oops, something went wrong.