refactoring channels

This commit is contained in:
ggmaleva 2021-08-17 16:42:01 +03:00
parent 5141b2137f
commit 88c4ad1d0c
No known key found for this signature in database
GPG Key ID: 0E412B78565B108F
12 changed files with 94 additions and 26 deletions

View File

@ -0,0 +1,6 @@
name: notificationName
in: path
description: Название нотификации
required: true
schema:
$ref: '../schemas/NotificationName.yaml'

View File

@ -3,4 +3,6 @@ required:
- result
properties:
result:
$ref: '../schemas/Channel.yaml'
type: array
items:
$ref: '../schemas/Channel.yaml'

View File

@ -0,0 +1,8 @@
type: object
required:
- result
properties:
result:
type: array
items:
$ref: '../schemas/Notification.yaml'

View File

@ -1,20 +1,16 @@
type: object
properties:
alertchanel:
channel:
type: string
createdAt:
type: string
format: date-time
frequency:
type: string
groupbyparams:
type: string
name:
type: string
period:
type: string
queryText:
type: string
status:
type: string
enum:
@ -23,9 +19,7 @@ properties:
- ARCHIVE
subject:
type: string
templateType:
type: string
templateValue:
type:
type: string
updatedAt:
type: string

View File

@ -0,0 +1,4 @@
description: Название нотификации
type: string
minLength: 1
maxLength: 40

View File

@ -0,0 +1,8 @@
type: object
properties:
status:
type: string
enum:
- CREATED
- ACTIVE
- ARCHIVE

View File

@ -48,13 +48,15 @@ paths:
# Notifications
/notifications:
$ref: ./paths/notifications/createOrUpdateNotification.yaml
$ref: ./paths/notifications/notifications.yaml
/notifications/{name}:
$ref: ./paths/notifications/removeNotification.yaml
/notifications/validate:
$ref: ./paths/notifications/validateNotification.yaml
$ref: ./paths/notifications/notification.yaml
/notifications/validating:
$ref: ./paths/notifications/validating.yaml
/notifications/{name}/statuses:
$ref: ./paths/notifications/statuses.yaml
# Notifications channel
# Notifications channels
/notifications/channels:
$ref: ./paths/notifications/channels.yaml
/notifications/channels/{name}:

View File

@ -12,7 +12,7 @@ delete:
responses:
'204':
description: Notofication was removed
description: Channel was removed
'401':
description: Unauthorized
'403':

View File

@ -4,17 +4,10 @@ delete:
tags:
- notification
parameters:
- name: name
in: path
required: true
schema:
type: string
- $ref: '../../components/parameters/notificationName.yaml'
responses:
'200':
description: Removed notification
'204':
description: No Content
description: Notification was removed
'401':
description: Unauthorized
'403':

View File

@ -1,3 +1,25 @@
get:
summary: Получение списка нотификаций
operationId: getNotifications
tags:
- notification
responses:
'200':
description: Notifications list
content:
application/json:
schema:
$ref: '../../components/responses/NotificationListResponse.yaml'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
post:
summary: Создание нотификации
operationId: createOrUpdateNotification
@ -12,7 +34,7 @@ post:
responses:
'201':
description: Created row in list
description: Created notification
content:
application/json:
schema:

View File

@ -0,0 +1,29 @@
patch:
summary: Изменение статуса нотификации
operationId: updateNotificationStatus
tags:
- notification
parameters:
- $ref: '../../components/parameters/notificationName.yaml'
requestBody:
content:
application/json:
schema:
$ref: '../../components/schemas/NotificationStatus.yaml'
responses:
'201':
description: Updated status
content:
application/json:
schema:
$ref: '../../components/schemas/NotificationStatus.yaml'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found

View File

@ -12,7 +12,7 @@ post:
responses:
'201':
description: Created row in list
description: Validation result
content:
application/json:
schema: