update api.go, docs.go, swagger.json, swagger.yaml
This commit is contained in:
1 parent
9c20b1c03d
commit
2873b269b9
4 files changed
+1756
No files matched your search
+530
@@ -0,0 +1,530 @@
|
||||
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||
package docs
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
|
||||
const docTemplate = `{
|
||||
"schemes": {{ marshal .Schemes }},
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"description": "{{escape .Description}}",
|
||||
"title": "{{.Title}}",
|
||||
"contact": {
|
||||
"name": "API Support",
|
||||
"email": "red.tea.dev@gmail.com"
|
||||
},
|
||||
"version": "{{.Version}}"
|
||||
},
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = &swag.Spec{
|
||||
Version: "1.0",
|
||||
Host: "project.easystartup.su",
|
||||
BasePath: "/api",
|
||||
Schemes: []string{},
|
||||
Title: "EasyStartup Project",
|
||||
Description: "Project service for EasyStartup.",
|
||||
InfoInstanceName: "swagger",
|
||||
SwaggerTemplate: docTemplate,
|
||||
LeftDelim: "{{",
|
||||
RightDelim: "}}",
|
||||
}
|
||||
|
||||
func init() {
|
||||
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
||||
}
|
||||
@@ -0,0 +1,506 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
basePath: /api
|
||||
definitions:
|
||||
esproject.Project:
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
members:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
name:
|
||||
type: string
|
||||
owner_id:
|
||||
type: integer
|
||||
tags:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
esproject.ProjectInvite:
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
project:
|
||||
type: integer
|
||||
user:
|
||||
type: integer
|
||||
type: object
|
||||
handler.countResponse:
|
||||
properties:
|
||||
count:
|
||||
type: integer
|
||||
type: object
|
||||
handler.memberRequest:
|
||||
properties:
|
||||
project:
|
||||
type: integer
|
||||
user:
|
||||
type: integer
|
||||
type: object
|
||||
handler.projectRequest:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
owner_id:
|
||||
type: integer
|
||||
tags:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
host: project.easystartup.su
|
||||
info:
|
||||
contact:
|
||||
email: red.tea.dev@gmail.com
|
||||
name: API Support
|
||||
description: Project service for EasyStartup.
|
||||
title: EasyStartup Project
|
||||
version: "1.0"
|
||||
paths:
|
||||
/api/member/invite/:
|
||||
post:
|
||||
parameters:
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: invite data in json format
|
||||
in: body
|
||||
name: project
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/handler.memberRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/esproject.ProjectInvite'
|
||||
summary: invite member (only for owner of project)
|
||||
tags:
|
||||
- member
|
||||
/api/member/invite/{id}:
|
||||
get:
|
||||
parameters:
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
summary: invite by id
|
||||
tags:
|
||||
- member
|
||||
/api/member/invite/accept/{id}:
|
||||
post:
|
||||
parameters:
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: id of invite
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
summary: accept invite
|
||||
tags:
|
||||
- member
|
||||
/api/member/invite/my:
|
||||
get:
|
||||
parameters:
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
summary: invites of current user
|
||||
tags:
|
||||
- member
|
||||
/api/member/kick/:
|
||||
post:
|
||||
parameters:
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: invite data in json format
|
||||
in: body
|
||||
name: project
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/handler.memberRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
summary: kick member (only for owner of project)
|
||||
tags:
|
||||
- member
|
||||
/api/project:
|
||||
post:
|
||||
parameters:
|
||||
- description: Project data in JSON
|
||||
in: body
|
||||
name: project
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/handler.projectRequest'
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: created project
|
||||
schema:
|
||||
$ref: '#/definitions/esproject.Project'
|
||||
summary: Create new project
|
||||
tags:
|
||||
- project
|
||||
/api/project/:
|
||||
post:
|
||||
parameters:
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: edited project
|
||||
in: body
|
||||
name: project
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/esproject.Project'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/esproject.Project'
|
||||
summary: Edit project (only for owner of project)
|
||||
tags:
|
||||
- project
|
||||
/api/project/{id}:
|
||||
delete:
|
||||
parameters:
|
||||
- description: id of project
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
summary: Delete project by id (only for owner of project)
|
||||
tags:
|
||||
- project
|
||||
get:
|
||||
parameters:
|
||||
- description: id of project
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
summary: Get project by id
|
||||
tags:
|
||||
- project
|
||||
/api/project/all:
|
||||
get:
|
||||
parameters:
|
||||
- description: limit of projects size
|
||||
in: query
|
||||
name: limit
|
||||
required: true
|
||||
type: integer
|
||||
- description: select offset
|
||||
in: query
|
||||
name: start
|
||||
required: true
|
||||
type: integer
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
summary: Get ids of projects
|
||||
tags:
|
||||
- project
|
||||
/api/project/count:
|
||||
get:
|
||||
parameters:
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/handler.countResponse'
|
||||
summary: Get count of projects
|
||||
tags:
|
||||
- project
|
||||
/api/project/my:
|
||||
get:
|
||||
parameters:
|
||||
- description: limit of projects size
|
||||
in: query
|
||||
name: limit
|
||||
required: true
|
||||
type: integer
|
||||
- description: JWT Bearer token (authorization)
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
summary: Get ids of projects when user is member
|
||||
tags:
|
||||
- project
|
||||
swagger: "2.0"
|
||||
Reference in new issue
Block a user