Files
isp-admin-service/docs/docs.go
T

556 lines
18 KiB
Go

// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2021-02-10 16:44:23.355615962 +0300 MSK m=+107.224783060
package docs
import (
"github.com/integration-system/isp-lib/v2/docs"
)
var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"title": "{{.Title}}",
"contact": {},
"license": {
"name": "GNU GPL v3.0"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/auth/login": {
"post": {
"description": "Авторизация с получением токена администратора",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Авторизация",
"parameters": [
{
"description": "Тело запроса",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/structure.AuthRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/structure.Auth"
}
},
"400": {
"description": "Данные для авторизации не верны",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"404": {
"description": "Пользователь не найден",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
}
}
}
},
"/auth/logout": {
"post": {
"description": "Выход из авторизованной сессии администрирования",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Выход из авторизованной сессии",
"parameters": [
{
"type": "string",
"description": "Токен администратора",
"name": "X-AUTH-ADMIN",
"in": "header",
"required": true
}
],
"responses": {
"200": {},
"400": {
"description": "Невалидный токен",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
}
}
}
},
"/user/create_update_user": {
"post": {
"description": "Создать пользователя или обновить данные существующего",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Создать/Обновить пользователя",
"parameters": [
{
"type": "string",
"description": "Токен администратора",
"name": "X-AUTH-ADMIN",
"in": "header",
"required": true
},
{
"description": "Тело запроса",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/entity.AdminUser"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/entity.AdminUser"
}
},
"400": {
"description": "Невалидное тело запроса",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
}
}
}
},
"/user/delete_user": {
"post": {
"description": "Удалить существующего пользователя",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Удалить пользователя",
"parameters": [
{
"type": "string",
"description": "Токен администратора",
"name": "X-AUTH-ADMIN",
"in": "header",
"required": true
},
{
"description": "Тело запроса",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/structure.IdentitiesRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/structure.DeleteResponse"
}
},
"400": {
"description": "Невалидное тело запроса",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
}
}
}
},
"/user/get_design": {
"post": {
"description": "Получение внешнего вида (палитра и наименование) админ-интерфейса",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Получение внешнего вида",
"parameters": [
{
"type": "string",
"description": "Токен администратора",
"name": "X-AUTH-ADMIN",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/conf.UIDesign"
}
},
"400": {
"description": "Невалидный токен",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
}
}
}
},
"/user/get_profile": {
"post": {
"description": "Получить данные профиля",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Получить профиль",
"parameters": [
{
"type": "string",
"description": "Токен администратора",
"name": "X-AUTH-ADMIN",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/structure.AdminUserShort"
}
},
"400": {
"description": "Невалидный токен",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"401": {
"description": "Токен не соответствует ни одному пользователю",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
}
}
}
},
"/user/get_users": {
"post": {
"description": "Получить список пользователей",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Список пользователей",
"parameters": [
{
"type": "string",
"description": "Токен администратора",
"name": "X-AUTH-ADMIN",
"in": "header",
"required": true
},
{
"description": "Тело запроса",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/structure.UsersRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/structure.UsersResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/structure.GrpcError"
}
}
}
}
}
},
"definitions": {
"conf.UIDesign": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"primaryColor": {
"type": "string"
}
}
},
"entity.AdminUser": {
"type": "object",
"required": [
"email"
],
"properties": {
"createdAt": {
"type": "string"
},
"email": {
"type": "string"
},
"firstName": {
"type": "string"
},
"id": {
"type": "integer"
},
"image": {
"type": "string"
},
"lastName": {
"type": "string"
},
"password": {
"type": "string"
},
"phone": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"structure.AdminUserShort": {
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string"
},
"firstName": {
"type": "string"
},
"image": {
"type": "string"
},
"lastName": {
"type": "string"
},
"phone": {
"type": "string"
}
}
},
"structure.Auth": {
"type": "object",
"properties": {
"expired": {
"type": "string"
},
"headerName": {
"type": "string"
},
"token": {
"type": "string"
}
}
},
"structure.AuthRequest": {
"type": "object",
"required": [
"email",
"password"
],
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"structure.DeleteResponse": {
"type": "object",
"properties": {
"deleted": {
"type": "integer"
}
}
},
"structure.GrpcError": {
"type": "object",
"properties": {
"details": {
"type": "array",
"items": {
"type": "object"
}
},
"errorCode": {
"type": "string"
},
"errorMessage": {
"type": "string"
}
}
},
"structure.IdentitiesRequest": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"structure.UsersRequest": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"ids": {
"type": "array",
"items": {
"type": "integer"
}
},
"limit": {
"type": "integer"
},
"offset": {
"type": "integer"
},
"phone": {
"type": "string"
}
}
},
"structure.UsersResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/entity.AdminUser"
}
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = docs.SwaggerInfo{
Version: "1.0.0",
Host: "localhost:9000",
BasePath: "/api/admin",
Schemes: []string{},
Title: "msp-admin-service",
Description: "сервис администрирования",
}
func init() {
docs.InitSwagger(SwaggerInfo, doc)
}