backend: add push token API and FCM delivery pipeline
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class NotificationRequest(BaseModel):
|
||||
@@ -25,3 +25,15 @@ class PushTaskPayload(BaseModel):
|
||||
title: str
|
||||
body: str
|
||||
data: dict[str, Any]
|
||||
|
||||
|
||||
class PushTokenUpsertRequest(BaseModel):
|
||||
platform: str = Field(min_length=2, max_length=16)
|
||||
token: str = Field(min_length=8, max_length=512)
|
||||
device_id: str | None = Field(default=None, max_length=128)
|
||||
app_version: str | None = Field(default=None, max_length=64)
|
||||
|
||||
|
||||
class PushTokenDeleteRequest(BaseModel):
|
||||
platform: str = Field(min_length=2, max_length=16)
|
||||
token: str = Field(min_length=8, max_length=512)
|
||||
|
||||
Reference in New Issue
Block a user