Add news feature with CRUD operations and real-time notifications
- Implemented news management functionality, allowing admins to create, read, update, and delete news posts. - Introduced a new SignalR event for broadcasting news updates to all connected clients. - Updated API documentation to include new endpoints for news management. - Enhanced frontend with a dedicated news page and admin interface for managing news posts. - Added necessary localization for news-related terms in both Russian and English.
This commit is contained in:
@@ -101,6 +101,20 @@ status, createdAt }`. `expiresAt` всегда `null` (лимиты по сро
|
||||
```
|
||||
Значение `OsPlatform` в C#/JSON — `IOS` (не `iOS`).
|
||||
|
||||
## News — лента новостей
|
||||
|
||||
| Метод | Путь | Роль | Тело запроса | Тело ответа |
|
||||
| ------ | ------------------------ | ----- | ------------------------ | ------------- |
|
||||
| GET | `/api/news` | user | query: `page, pageSize` | `PagedList<NewsPostDto>` |
|
||||
| GET | `/api/admin/news` | admin | query: `page, pageSize` | `PagedList<NewsPostDto>` |
|
||||
| POST | `/api/admin/news` | admin | `{ title, body }` | `NewsPostDto` |
|
||||
| PUT | `/api/admin/news/{id}` | admin | `{ title, body }` | `NewsPostDto` |
|
||||
| DELETE | `/api/admin/news/{id}` | admin | — | `204 No Content` |
|
||||
|
||||
Нет черновиков/отложенной публикации — `POST` сразу видна всем аутентифицированным пользователям
|
||||
и триггерит SignalR-событие `newsPublished` (см. ниже). `NewsPostDto`:
|
||||
`{ id, title, body, createdAt, updatedAt }`.
|
||||
|
||||
## Activation (пользователь)
|
||||
|
||||
| Метод | Путь | Роль | Тело запроса | Тело ответа |
|
||||
@@ -190,6 +204,7 @@ totalConfigs, activeConfigs, totalUsedUpBytes, totalUsedDownBytes }` — счи
|
||||
| `nodeStatusChanged` | `{ nodeId, status, lastSyncAt }` | `admins` |
|
||||
| `activationRequested` | `{ requestId, userId, userName, comment, createdAt }` | `admins` |
|
||||
| `userActivated` | `{ userId }` | владельцу |
|
||||
| `newsPublished` | `{ id, title, createdAt }` | все (broadcast) |
|
||||
|
||||
### Client → Server
|
||||
Клиент только слушает; группировка по пользователю происходит на сервере при подключении, по
|
||||
|
||||
Reference in New Issue
Block a user