426 lines
14 KiB
Go
426 lines
14 KiB
Go
// 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": {},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/api/v1/archive": {
|
|
"post": {
|
|
"description": "Move one or many IDs from ` + "`" + `current` + "`" + ` to ` + "`" + `current_archive` + "`" + `.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"archive"
|
|
],
|
|
"summary": "Move shows to archive",
|
|
"parameters": [
|
|
{
|
|
"description": "IDs to move",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.MoveReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.MoveRes"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "empty ids",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "move failed",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/current": {
|
|
"get": {
|
|
"description": "Returns the current row from ` + "`" + `current` + "`" + ` table.",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"current"
|
|
],
|
|
"summary": "Get current show",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.CurrentResponse"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "no current row found",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "query failed",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Set the current show ID and start time.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"current"
|
|
],
|
|
"summary": "Set current show",
|
|
"parameters": [
|
|
{
|
|
"description": "Current show payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.SetCurrentReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.CurrentResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "invalid payload or invalid time",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "id not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "update failed",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/shows": {
|
|
"get": {
|
|
"description": "List all rows from ` + "`" + `current` + "`" + ` table.",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"shows"
|
|
],
|
|
"summary": "List current shows",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/httpapi.CurrentResponse"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "list failed",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Insert a new show into ` + "`" + `current` + "`" + `.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"shows"
|
|
],
|
|
"summary": "Create show",
|
|
"parameters": [
|
|
{
|
|
"description": "New show payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.CreateShowReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.CurrentResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "invalid payload or invalid time/duration",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "create failed",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Delete a row from ` + "`" + `current` + "`" + ` by ID.",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"shows"
|
|
],
|
|
"summary": "Delete show",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "Show ID",
|
|
"name": "id",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content"
|
|
},
|
|
"400": {
|
|
"description": "invalid id",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "id not found",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "delete failed",
|
|
"schema": {
|
|
"$ref": "#/definitions/httpapi.HTTPError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"httpapi.CreateShowReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"ep_num",
|
|
"ep_title",
|
|
"playback_length",
|
|
"season_name"
|
|
],
|
|
"properties": {
|
|
"ep_num": {
|
|
"type": "integer",
|
|
"example": 1
|
|
},
|
|
"ep_title": {
|
|
"type": "string",
|
|
"example": "Pilot"
|
|
},
|
|
"playback_length": {
|
|
"type": "string",
|
|
"example": "00:24:00"
|
|
},
|
|
"season_name": {
|
|
"type": "string",
|
|
"example": "Season 1"
|
|
},
|
|
"start_time": {
|
|
"description": "optional; defaults to 22:00:00",
|
|
"type": "string",
|
|
"example": "10:00:00"
|
|
}
|
|
}
|
|
},
|
|
"httpapi.CurrentResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"current_ep": {
|
|
"type": "boolean",
|
|
"example": false
|
|
},
|
|
"date_created": {
|
|
"type": "string",
|
|
"example": "2024-02-01T15:04:05Z"
|
|
},
|
|
"ep_num": {
|
|
"type": "integer",
|
|
"example": 1
|
|
},
|
|
"ep_title": {
|
|
"type": "string",
|
|
"example": "Pilot"
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"example": 123
|
|
},
|
|
"playback_length": {
|
|
"type": "string",
|
|
"example": "00:24:00"
|
|
},
|
|
"season_name": {
|
|
"type": "string",
|
|
"example": "Season 1"
|
|
},
|
|
"start_time": {
|
|
"type": "string",
|
|
"example": "10:00:00"
|
|
}
|
|
}
|
|
},
|
|
"httpapi.HTTPError": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"type": "string",
|
|
"example": "invalid payload"
|
|
}
|
|
}
|
|
},
|
|
"httpapi.MoveReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer",
|
|
"example": 123
|
|
},
|
|
"ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"httpapi.MoveRes": {
|
|
"type": "object",
|
|
"properties": {
|
|
"deleted": {
|
|
"type": "integer"
|
|
},
|
|
"deleted_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"inserted": {
|
|
"type": "integer"
|
|
},
|
|
"moved_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"skipped": {
|
|
"type": "integer"
|
|
},
|
|
"skipped_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"httpapi.SetCurrentReq": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"start_time"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer",
|
|
"example": 123
|
|
},
|
|
"start_time": {
|
|
"type": "string",
|
|
"example": "21:00:00"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "1.0",
|
|
Host: "localhost:8082",
|
|
BasePath: "/",
|
|
Schemes: []string{"http", "https"},
|
|
Title: "Watch Party Backend API",
|
|
Description: "Backend API for watch-party app.",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
LeftDelim: "{{",
|
|
RightDelim: "}}",
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|