2024-12-14 08:40:45 +00:00
|
|
|
{
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
|
|
|
"contact": {}
|
|
|
|
},
|
|
|
|
"paths": {
|
|
|
|
"/tasks": {
|
|
|
|
"post": {
|
|
|
|
"description": "Create a new task for a specific repository",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"Tasks"
|
|
|
|
],
|
|
|
|
"summary": "Create a new task",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Request body to create a task",
|
|
|
|
"name": "body",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/taskcontroller.CreateTaskDTO"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"201": {
|
|
|
|
"description": "Created",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/taskcontroller.CreateTaskResponse"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Invalid JSON or missing required fields",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/errors.ErrResponse"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Internal server error",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/errors.ErrResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-12-15 08:39:18 +00:00
|
|
|
},
|
|
|
|
"/tasks/{taskID}/upload": {
|
|
|
|
"post": {
|
|
|
|
"description": "Upload multiple files associated with a specific task ID. Each file must be less than 10MB.",
|
|
|
|
"consumes": [
|
|
|
|
"multipart/form-data"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"tasks"
|
|
|
|
],
|
|
|
|
"summary": "Upload files to a task",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Task ID",
|
|
|
|
"name": "taskID",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"description": "Files to upload",
|
|
|
|
"name": "files",
|
|
|
|
"in": "formData",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Successful file upload",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/taskcontroller.TaskUploadResponse"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request or File too large",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/errors.ErrResponse"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/errors.ErrResponse"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-12-14 08:40:45 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
|
|
|
"errors.ErrResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"code": {
|
|
|
|
"description": "application-specific error code",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"error": {
|
|
|
|
"description": "application-level error message, for debugging",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"status": {
|
|
|
|
"description": "user-level status message",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"models.TaskStatus": {
|
|
|
|
"type": "integer",
|
|
|
|
"enum": [
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3,
|
|
|
|
4
|
|
|
|
],
|
|
|
|
"x-enum-comments": {
|
|
|
|
"StatusCancelled": "4",
|
|
|
|
"StatusCompleted": "2",
|
|
|
|
"StatusFailed": "3",
|
|
|
|
"StatusInProgress": "1",
|
|
|
|
"StatusPending": "0"
|
|
|
|
},
|
|
|
|
"x-enum-varnames": [
|
|
|
|
"StatusPending",
|
|
|
|
"StatusInProgress",
|
|
|
|
"StatusCompleted",
|
|
|
|
"StatusFailed",
|
|
|
|
"StatusCancelled"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"taskcontroller.CreateTaskDTO": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"repo": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"taskcontroller.CreateTaskResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"status": {
|
|
|
|
"$ref": "#/definitions/models.TaskStatus"
|
|
|
|
},
|
|
|
|
"taskID": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
|
|
|
}
|
2024-12-15 08:39:18 +00:00
|
|
|
},
|
|
|
|
"taskcontroller.TaskUploadResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"status": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"taskID": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
2024-12-14 08:40:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|