1455 lines
40 KiB
YAML
1455 lines
40 KiB
YAML
basePath: /api/system
|
|
definitions:
|
|
apierrors.Error:
|
|
properties:
|
|
details:
|
|
additionalProperties: {}
|
|
type: object
|
|
errorCode:
|
|
type: integer
|
|
errorMessage:
|
|
type: string
|
|
type: object
|
|
domain.AccessListDeleteListRequest:
|
|
properties:
|
|
appId:
|
|
type: integer
|
|
methods:
|
|
items:
|
|
type: string
|
|
minItems: 1
|
|
type: array
|
|
required:
|
|
- appId
|
|
- methods
|
|
type: object
|
|
domain.AccessListSetListRequest:
|
|
properties:
|
|
appId:
|
|
type: integer
|
|
methods:
|
|
items:
|
|
$ref: '#/definitions/domain.MethodInfo'
|
|
type: array
|
|
removeOld:
|
|
type: boolean
|
|
required:
|
|
- appId
|
|
type: object
|
|
domain.AccessListSetOneRequest:
|
|
properties:
|
|
appId:
|
|
type: integer
|
|
method:
|
|
type: string
|
|
value:
|
|
type: boolean
|
|
required:
|
|
- appId
|
|
- method
|
|
type: object
|
|
domain.AccessListSetOneResponse:
|
|
properties:
|
|
count:
|
|
type: integer
|
|
type: object
|
|
domain.AppGroup:
|
|
properties:
|
|
createdAt:
|
|
type: string
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
updatedAt:
|
|
type: string
|
|
type: object
|
|
domain.Application:
|
|
properties:
|
|
createdAt:
|
|
type: string
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
serviceId:
|
|
type: integer
|
|
type:
|
|
type: string
|
|
updatedAt:
|
|
type: string
|
|
type: object
|
|
domain.ApplicationCreateUpdateRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
serviceId:
|
|
type: integer
|
|
type:
|
|
enum:
|
|
- SYSTEM
|
|
- MOBILE
|
|
type: string
|
|
required:
|
|
- name
|
|
- serviceId
|
|
- type
|
|
type: object
|
|
domain.ApplicationSimple:
|
|
properties:
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
tokens:
|
|
items:
|
|
$ref: '#/definitions/domain.Token'
|
|
type: array
|
|
type:
|
|
type: string
|
|
type: object
|
|
domain.ApplicationWithTokens:
|
|
properties:
|
|
app:
|
|
$ref: '#/definitions/domain.Application'
|
|
tokens:
|
|
items:
|
|
$ref: '#/definitions/domain.Token'
|
|
type: array
|
|
type: object
|
|
domain.AuthData:
|
|
properties:
|
|
appName:
|
|
type: string
|
|
applicationId:
|
|
type: integer
|
|
domainId:
|
|
type: integer
|
|
serviceId:
|
|
type: integer
|
|
systemId:
|
|
type: integer
|
|
type: object
|
|
domain.AuthenticateRequest:
|
|
properties:
|
|
token:
|
|
type: string
|
|
required:
|
|
- token
|
|
type: object
|
|
domain.AuthenticateResponse:
|
|
properties:
|
|
authData:
|
|
$ref: '#/definitions/domain.AuthData'
|
|
authenticated:
|
|
type: boolean
|
|
errorReason:
|
|
type: string
|
|
type: object
|
|
domain.AuthorizeRequest:
|
|
properties:
|
|
applicationId:
|
|
type: integer
|
|
endpoint:
|
|
type: string
|
|
required:
|
|
- applicationId
|
|
- endpoint
|
|
type: object
|
|
domain.AuthorizeResponse:
|
|
properties:
|
|
authorized:
|
|
type: boolean
|
|
type: object
|
|
domain.CreateAppGroupRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
name:
|
|
type: string
|
|
required:
|
|
- name
|
|
type: object
|
|
domain.CreateApplicationRequest:
|
|
properties:
|
|
applicationGroupId:
|
|
type: integer
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
type:
|
|
enum:
|
|
- SYSTEM
|
|
- MOBILE
|
|
type: string
|
|
required:
|
|
- applicationGroupId
|
|
- id
|
|
- name
|
|
- type
|
|
type: object
|
|
domain.DeleteResponse:
|
|
properties:
|
|
deleted:
|
|
type: integer
|
|
type: object
|
|
domain.Domain:
|
|
properties:
|
|
createdAt:
|
|
type: string
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
systemId:
|
|
type: integer
|
|
updatedAt:
|
|
type: string
|
|
type: object
|
|
domain.DomainCreateUpdateRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
required:
|
|
- name
|
|
type: object
|
|
domain.DomainWithService:
|
|
properties:
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
services:
|
|
items:
|
|
$ref: '#/definitions/domain.ServiceWithApps'
|
|
type: array
|
|
type: object
|
|
domain.GetApplicationByTokenRequest:
|
|
properties:
|
|
token:
|
|
type: string
|
|
required:
|
|
- token
|
|
type: object
|
|
domain.GetApplicationByTokenResponse:
|
|
properties:
|
|
applicationGroupId:
|
|
type: integer
|
|
applicationId:
|
|
type: integer
|
|
type: object
|
|
domain.IdListRequest:
|
|
properties:
|
|
idList:
|
|
items:
|
|
type: integer
|
|
minItems: 1
|
|
type: array
|
|
required:
|
|
- idList
|
|
type: object
|
|
domain.Identity:
|
|
properties:
|
|
id:
|
|
type: integer
|
|
required:
|
|
- id
|
|
type: object
|
|
domain.MethodInfo:
|
|
properties:
|
|
method:
|
|
type: string
|
|
value:
|
|
type: boolean
|
|
type: object
|
|
domain.Service:
|
|
properties:
|
|
createdAt:
|
|
type: string
|
|
description:
|
|
type: string
|
|
domainId:
|
|
type: integer
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
updatedAt:
|
|
type: string
|
|
type: object
|
|
domain.ServiceCreateUpdateRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
domainId:
|
|
type: integer
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
required:
|
|
- domainId
|
|
- name
|
|
type: object
|
|
domain.ServiceWithApps:
|
|
properties:
|
|
apps:
|
|
items:
|
|
$ref: '#/definitions/domain.ApplicationSimple'
|
|
type: array
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
type: object
|
|
domain.Token:
|
|
properties:
|
|
appId:
|
|
type: integer
|
|
createdAt:
|
|
type: string
|
|
expireTime:
|
|
type: integer
|
|
token:
|
|
type: string
|
|
type: object
|
|
domain.TokenCreateRequest:
|
|
properties:
|
|
appId:
|
|
type: integer
|
|
expireTimeMs:
|
|
type: integer
|
|
required:
|
|
- appId
|
|
- expireTimeMs
|
|
type: object
|
|
domain.TokenRevokeRequest:
|
|
properties:
|
|
appId:
|
|
type: integer
|
|
tokens:
|
|
items:
|
|
type: string
|
|
type: array
|
|
required:
|
|
- appId
|
|
type: object
|
|
domain.UpdateAppGroupRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
required:
|
|
- id
|
|
- name
|
|
type: object
|
|
domain.UpdateApplicationRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
name:
|
|
type: string
|
|
newId:
|
|
type: integer
|
|
oldId:
|
|
type: integer
|
|
required:
|
|
- name
|
|
- newId
|
|
- oldId
|
|
type: object
|
|
entity.Token:
|
|
properties:
|
|
appId:
|
|
type: integer
|
|
createdAt:
|
|
type: string
|
|
expireTime:
|
|
type: integer
|
|
token:
|
|
type: string
|
|
type: object
|
|
host: localhost:9000
|
|
info:
|
|
contact: {}
|
|
description: Сервис управления реестром внешних приложений и токенами аутентификации
|
|
license:
|
|
name: GNU GPL v3.0
|
|
title: isp-system-service
|
|
version: 1.0.0
|
|
paths:
|
|
/access_list/delete_list:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Удаляет заданный список методов для приложения
|
|
parameters:
|
|
- description: тело запроса
|
|
in: body
|
|
name: body
|
|
schema:
|
|
$ref: '#/definitions/domain.AccessListDeleteListRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema: {}
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Удалить список доступных методов для приложения
|
|
tags:
|
|
- accessList
|
|
/access_list/get_by_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает список методов для приложения, для которых заданы настройки
|
|
доступа
|
|
parameters:
|
|
- description: идентификатор приложения
|
|
in: body
|
|
name: body
|
|
schema:
|
|
$ref: '#/definitions/domain.Identity'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: список доступности методов
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.MethodInfo'
|
|
type: array
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить список доступности методов для приложения
|
|
tags:
|
|
- accessList
|
|
/access_list/set_list:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает список методов для приложения, для которых заданы настройки
|
|
доступа
|
|
parameters:
|
|
- description: объект настройки доступа
|
|
in: body
|
|
name: body
|
|
schema:
|
|
$ref: '#/definitions/domain.AccessListSetListRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: список доступности методов
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.MethodInfo'
|
|
type: array
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Настроить доступность списка методов для приложения
|
|
tags:
|
|
- accessList
|
|
/access_list/set_one:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает количество измененных строк
|
|
parameters:
|
|
- description: объект для настройки доступа
|
|
in: body
|
|
name: body
|
|
schema:
|
|
$ref: '#/definitions/domain.AccessListSetOneRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: количество измененных строк
|
|
schema:
|
|
$ref: '#/definitions/domain.AccessListSetOneResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Настроить доступность метода для приложения
|
|
tags:
|
|
- accessList
|
|
/application/create_application:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Если приложение с такими идентификатором или связкой `applicationGroupId`-`name`
|
|
существует, то возвращает ошибку
|
|
parameters:
|
|
- description: Объект приложения
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateApplicationRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ApplicationWithTokens'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"409":
|
|
description: Conflict
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Создать приложение
|
|
tags:
|
|
- application
|
|
/application/create_update_application:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Если приложение с такими идентификатором существует, то обновляет
|
|
данные, если нет, то добавляет данные в базу
|
|
parameters:
|
|
- description: Объект приложения
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.ApplicationCreateUpdateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ApplicationWithTokens'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"409":
|
|
description: Conflict
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Создать/обновить приложение
|
|
tags:
|
|
- application
|
|
/application/delete_applications:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Удаляет приложения по списку их идентификаторов, возвращает количество
|
|
удаленных приложений
|
|
parameters:
|
|
- description: Массив идентификаторов приложений
|
|
in: body
|
|
name: body
|
|
schema:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DeleteResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Удалить приложения
|
|
tags:
|
|
- application
|
|
/application/get_all:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает список приложений
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.Application'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить список приложений
|
|
tags:
|
|
- application
|
|
/application/get_application_by_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает описание приложения по его идентификатору
|
|
parameters:
|
|
- description: Идентификатор приложения
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Identity'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ApplicationWithTokens'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить приложение по идентификатору
|
|
tags:
|
|
- application
|
|
/application/get_application_by_token:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает идентификатор приложения и группы по токену
|
|
parameters:
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.GetApplicationByTokenRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.GetApplicationByTokenResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить идентификатор приложения и группы по токену
|
|
tags:
|
|
- application
|
|
/application/get_applications:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает массив приложений с токенами по их идентификаторам
|
|
parameters:
|
|
- description: Массив идентификаторов приложений
|
|
in: body
|
|
name: body
|
|
schema:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.ApplicationWithTokens'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить список приложений
|
|
tags:
|
|
- application
|
|
/application/get_applications_by_service_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает список приложений по запрошенному идентификатору сервиса
|
|
parameters:
|
|
- description: Идентификатор сервиса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Identity'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.ApplicationWithTokens'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить список приложений по идентификатору сервиса
|
|
tags:
|
|
- application
|
|
/application/get_system_tree:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает описание взаимосвязей сервисов и приложений
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.DomainWithService'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Метод получения системного дерева
|
|
tags:
|
|
- application
|
|
/application/next_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает следующий идентификатор приложения
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
type: integer
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить следующий идентификатор приложения
|
|
tags:
|
|
- application
|
|
/application/update_application:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Если приложение с связкой `applicationGroupId`-`name` существует
|
|
или приложение не найдено, то возвращает ошибку
|
|
parameters:
|
|
- description: Объект приложения
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateApplicationRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ApplicationWithTokens'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"409":
|
|
description: Conflict
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Обновить приложение
|
|
tags:
|
|
- application
|
|
/application_group/create:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Если группа приложений таким именем существует, возвращает ошибку
|
|
parameters:
|
|
- description: Объект группы приложений
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateAppGroupRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.AppGroup'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"409":
|
|
description: Conflict
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Создать группу приложений
|
|
tags:
|
|
- application_group
|
|
/application_group/delete_list:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Удаляет группы приложений по списку их идентификаторов, возвращает
|
|
количество удаленных групп приложений
|
|
parameters:
|
|
- description: список идентификаторов групп приложений
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.IdListRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DeleteResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Удалить группы приложений
|
|
tags:
|
|
- application_group
|
|
/application_group/get_all:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает все группы приложений
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.AppGroup'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить группы приложений
|
|
tags:
|
|
- application_group
|
|
/application_group/get_by_id_list:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает группы приложений с указанными идентификаторами
|
|
parameters:
|
|
- description: список идентификаторов групп приложений
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.IdListRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.AppGroup'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить группы приложений по списку идентификаторов
|
|
tags:
|
|
- application_group
|
|
/application_group/update:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Если группа приложений таким именем существует или группы приложений
|
|
с указанным id не существует, возвращает ошибку
|
|
parameters:
|
|
- description: Объект группы приложений
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateAppGroupRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.AppGroup'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"409":
|
|
description: Conflict
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Обновить группу приложений
|
|
tags:
|
|
- application_group
|
|
/domain/create_update_domain:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Если домен с такими идентификатором существует, то обновляет данные,
|
|
если нет, то добавляет данные в базу
|
|
parameters:
|
|
- description: Объект домена
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.DomainCreateUpdateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Domain'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Создать/обновить домен
|
|
tags:
|
|
- domain
|
|
/domain/delete_domains:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Удаляет домены по списку их идентификаторов, возвращает количество
|
|
удаленных доменов
|
|
parameters:
|
|
- description: Массив идентификаторов доменов
|
|
in: body
|
|
name: body
|
|
schema:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DeleteResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Удаление доменов
|
|
tags:
|
|
- domain
|
|
/domain/get_domain_by_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает описание домена по его идентификатору
|
|
parameters:
|
|
- description: Идентификатор домена
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Identity'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Domain'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить домен по идентификатору
|
|
tags:
|
|
- domain
|
|
/domain/get_domains_by_system_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает список доменов по системному идентификатору
|
|
parameters:
|
|
- description: Идентификатор системы
|
|
in: body
|
|
name: body
|
|
schema:
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.Domain'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить домены по идентификатору системы
|
|
tags:
|
|
- domain
|
|
/secure/authenticate:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Проверяет наличие токена в системе,
|
|
parameters:
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.AuthenticateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.AuthenticateResponse'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Метод аутентификации токена
|
|
tags:
|
|
- secure
|
|
/secure/authorize:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Проверяет доступ приложения к запрашиваемому ендпоинту
|
|
parameters:
|
|
- description: Тело запрос
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.AuthorizeRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.AuthorizeResponse'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Метод авторизации приложения
|
|
tags:
|
|
- secure
|
|
/service/create_update_service:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Если сервис с такими идентификатором существует, то обновляет данные,
|
|
если нет, то добавляет данные в базу
|
|
parameters:
|
|
- description: Объект сервиса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.ServiceCreateUpdateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Service'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"409":
|
|
description: Conflict
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Создать/обновить сервис
|
|
tags:
|
|
- service
|
|
/service/delete_service:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Удаляет сервисов по списку их идентификаторов, возвращает количество
|
|
удаленных сервисов
|
|
parameters:
|
|
- description: Массив идентификаторов сервисов
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DeleteResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Удалить сервисы
|
|
tags:
|
|
- service
|
|
/service/get_service:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает список сервисов по их идентификаторам
|
|
parameters:
|
|
- description: Массив идентификаторов сервисов
|
|
in: body
|
|
name: body
|
|
schema:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.Service'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить список сервисов
|
|
tags:
|
|
- service
|
|
/service/get_service_by_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает описание сервиса по его идентификатору
|
|
parameters:
|
|
- description: Идентификатор сервиса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Identity'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Service'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить сервис по идентификатору
|
|
tags:
|
|
- service
|
|
/service/get_services_by_domain_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает список сервисов по идентификатору домена
|
|
parameters:
|
|
- description: Идентификатор домена
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Identity'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.Service'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить список сервисов по идентификатору домена
|
|
tags:
|
|
- service
|
|
/token/create_token:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Создает токен и привязывает его к приложению
|
|
parameters:
|
|
- description: Объект создания токена
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.TokenCreateRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ApplicationWithTokens'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Создать токен
|
|
tags:
|
|
- token
|
|
/token/get_tokens_by_app_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает список токенов, привязанных к приложению
|
|
parameters:
|
|
- description: Идентификатор приложения
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Identity'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/entity.Token'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Получить токены по идентификатору приложения
|
|
tags:
|
|
- token
|
|
/token/revoke_tokens:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Отвязывает токены от приложений и удаляет их
|
|
parameters:
|
|
- description: Объект отзыва токенов
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.TokenRevokeRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ApplicationWithTokens'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Отозвать токены
|
|
tags:
|
|
- token
|
|
/token/revoke_tokens_for_app:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Отвязывает токены от приложений и удаляет их по идентификатору
|
|
приложения
|
|
parameters:
|
|
- description: Идентификатор приложения
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Identity'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DeleteResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Отозвать токены для приложения
|
|
tags:
|
|
- token
|
|
swagger: "2.0"
|