506 lines
16 KiB
JSON
506 lines
16 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "Project service for EasyStartup.",
|
|
"title": "EasyStartup Project",
|
|
"contact": {
|
|
"name": "API Support",
|
|
"email": "red.tea.dev@gmail.com"
|
|
},
|
|
"version": "1.0"
|
|
},
|
|
"host": "project.easystartup.su",
|
|
"basePath": "/api",
|
|
"paths": {
|
|
"/api/member/invite/": {
|
|
"post": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"member"
|
|
],
|
|
"summary": "invite member (only for owner of project)",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "invite data in json format",
|
|
"name": "project",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.memberRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/esproject.ProjectInvite"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/member/invite/accept/{id}": {
|
|
"post": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"member"
|
|
],
|
|
"summary": "accept invite",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "id of invite",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/member/invite/my": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"member"
|
|
],
|
|
"summary": "invites of current user",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/member/invite/{id}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"member"
|
|
],
|
|
"summary": "invite by id",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/member/kick/": {
|
|
"post": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"member"
|
|
],
|
|
"summary": "kick member (only for owner of project)",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "invite data in json format",
|
|
"name": "project",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.memberRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/project": {
|
|
"post": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"project"
|
|
],
|
|
"summary": "Create new project",
|
|
"parameters": [
|
|
{
|
|
"description": "Project data in JSON",
|
|
"name": "project",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.projectRequest"
|
|
}
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "created project",
|
|
"schema": {
|
|
"$ref": "#/definitions/esproject.Project"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/project/": {
|
|
"post": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"project"
|
|
],
|
|
"summary": "Edit project (only for owner of project)",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "edited project",
|
|
"name": "project",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/esproject.Project"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/esproject.Project"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/project/all": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"project"
|
|
],
|
|
"summary": "Get ids of projects",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "limit of projects size",
|
|
"name": "limit",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "select offset",
|
|
"name": "start",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/project/count": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"project"
|
|
],
|
|
"summary": "Get count of projects",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/handler.countResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/project/my": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"project"
|
|
],
|
|
"summary": "Get ids of projects when user is member",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "limit of projects size",
|
|
"name": "limit",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/project/{id}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"project"
|
|
],
|
|
"summary": "Get project by id",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "id of project",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"project"
|
|
],
|
|
"summary": "Delete project by id (only for owner of project)",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "id of project",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "JWT Bearer token (authorization)",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"esproject.Project": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"members": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"owner_id": {
|
|
"type": "integer"
|
|
},
|
|
"tags": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"esproject.ProjectInvite": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"project": {
|
|
"type": "integer"
|
|
},
|
|
"user": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.countResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"count": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.memberRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"project": {
|
|
"type": "integer"
|
|
},
|
|
"user": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"handler.projectRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"owner_id": {
|
|
"type": "integer"
|
|
},
|
|
"tags": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |