thread-master/apps/backend/generate/api/notifications.api

47 lines
966 B
Plaintext
Raw Permalink Normal View History

2026-07-13 01:15:30 +00:00
syntax = "v1"
type (
NotificationPublic {
Id string `json:"id"`
Title string `json:"title"`
Body string `json:"body"`
Kind string `json:"kind"` // job|system
RefType string `json:"ref_type"`
RefId string `json:"ref_id,optional"`
ReadAt int64 `json:"read_at,optional"`
CreatedAt int64 `json:"created_at"`
}
NotificationListData {
List []NotificationPublic `json:"list"`
}
UnreadCountData {
Count int64 `json:"count"`
}
NotificationIdPath {
Id string `path:"id"`
}
)
@server (
jwt: Auth
group: notifications
prefix: /api/v1/notifications
middleware: AuthJWT
)
service gateway {
@handler ListNotifications
get / returns (NotificationListData)
@handler UnreadNotificationCount
get /unread-count returns (UnreadCountData)
@handler MarkNotificationRead
post /:id/read (NotificationIdPath) returns (OkData)
@handler MarkAllNotificationsRead
post /read-all returns (OkData)
}