Files
backend/docs/docs.go
Yi-Ting Shih 47f09b733a
All checks were successful
Go test / run-go-vet (push) Successful in 20s
Go test / check-swagger-up-to-date (push) Successful in 9s
Go test / run-go-test (push) Successful in 47s
Go test / cleanup-go-test (push) Successful in 4s
Go test / release-image (push) Successful in 3m35s
Refactor: migrate discordbot
2025-12-13 04:58:12 +08:00

356 lines
11 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}}",
"termsOfService": "http://swagger.io/terms",
"contact": {},
"license": {
"name": "0BSD"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/alias/{id}": {
"delete": {
"description": "delete alias along with the links",
"summary": "Delete alias",
"parameters": [
{
"type": "integer",
"description": "Alias Id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found"
}
}
}
},
"/api/aliases": {
"get": {
"description": "get alias ids and names",
"summary": "Get aliases",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/api.GetAliasesOutputAlias"
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/api/image": {
"post": {
"consumes": [
"image/png",
"image/jpeg",
"image/gif"
],
"parameters": [
{
"type": "string",
"description": "userinfo from /auth/gen-login-url",
"name": "userinfo",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.postImageOutput"
}
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/api/image/{id}": {
"delete": {
"description": "delete image along with the links",
"summary": "Delete image",
"parameters": [
{
"type": "integer",
"description": "Image Id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found"
}
}
}
},
"/api/image/{id}/aliases": {
"put": {
"parameters": [
{
"type": "integer",
"description": "Image Id",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.putImageAliasesInput"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
},
"404": {
"description": "Not Found"
}
}
}
},
"/api/images": {
"get": {
"parameters": [
{
"type": "array",
"items": {
"type": "integer"
},
"collectionFormat": "csv",
"description": "Image Ids",
"name": "images",
"in": "query"
},
{
"type": "array",
"items": {
"type": "integer"
},
"collectionFormat": "csv",
"description": "Alias Ids",
"name": "aliases",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/api.GetImagesOutputImage"
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/auth/gen-login-url": {
"post": {
"parameters": [
{
"description": "Payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.PostGenLoginUrlInput"
}
}
],
"responses": {
"200": {
"description": "Payload",
"schema": {
"$ref": "#/definitions/auth.PostGenLoginUrlOutput"
}
},
"400": {
"description": "Bad Request"
}
}
}
},
"/auth/login": {
"post": {
"parameters": [
{
"description": "payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.postLoginInput"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
},
"definitions": {
"api.GetAliasesOutputAlias": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"api.GetImagesOutputImage": {
"type": "object",
"properties": {
"aliasesIds": {
"type": "array",
"items": {
"type": "integer"
}
},
"extension": {
"type": "string"
},
"id": {
"type": "integer"
},
"uploadedAt": {
"type": "integer"
},
"uploadedUserId": {
"type": "string"
}
}
},
"api.postImageOutput": {
"type": "object",
"properties": {
"extension": {
"type": "string"
},
"id": {
"type": "integer"
},
"uploadedAt": {
"type": "string"
},
"uploadedUserId": {
"type": "string"
}
}
},
"api.putImageAliasesInput": {
"type": "object",
"properties": {
"aliases": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"auth.PostGenLoginUrlInput": {
"type": "object",
"properties": {
"userId": {
"type": "string"
}
}
},
"auth.PostGenLoginUrlOutput": {
"type": "object",
"properties": {
"loginUrl": {
"type": "string"
}
}
},
"auth.postLoginInput": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "0.0.1",
Host: "",
BasePath: "/",
Schemes: []string{},
Title: "Golang 2025 Final Project",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}