2024-11-06 10:47:56 +00:00
|
|
|
// 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": {
|
2024-11-07 10:09:13 +00:00
|
|
|
"/api/v1/application/{application_id}/tokens": {
|
2024-11-06 10:47:56 +00:00
|
|
|
"get": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiKeyAuth": []
|
|
|
|
}
|
|
|
|
],
|
2024-11-07 10:09:13 +00:00
|
|
|
"description": "获取应用程序的 Token 列表",
|
2024-11-06 10:47:56 +00:00
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
2024-11-07 10:09:13 +00:00
|
|
|
"applications"
|
|
|
|
],
|
|
|
|
"summary": "获取应用程序的 Token 列表",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "integer",
|
|
|
|
"name": "application_id",
|
|
|
|
"in": "path"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"data": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/entity.ApplicationToken"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"post": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiKeyAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"description": "获取应用程序的 Token 列表",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"applications"
|
|
|
|
],
|
|
|
|
"summary": "获取应用程序的 Token 列表",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "integer",
|
|
|
|
"name": "application_id",
|
|
|
|
"in": "path"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "创建应用程序的请求",
|
|
|
|
"name": "ApplicationCreateRequest",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ApplicationCreateRequest"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"data": {
|
|
|
|
"$ref": "#/definitions/entity.ApplicationToken"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/api/v1/applications": {
|
|
|
|
"get": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiKeyAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"description": "列出当前用户下的应用程序列表",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"applications"
|
|
|
|
],
|
|
|
|
"summary": "List Applications",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"data": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/entity.Application"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"post": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiKeyAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"description": "创建一个应用程序",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"applications"
|
|
|
|
],
|
|
|
|
"summary": "创建并保存一个应用程序",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "创建应用程序的请求",
|
|
|
|
"name": "ApplicationCreateRequest",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ApplicationCreateRequest"
|
|
|
|
}
|
|
|
|
}
|
2024-11-06 10:47:56 +00:00
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"data": {
|
2024-11-07 10:09:13 +00:00
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/entity.Application"
|
|
|
|
}
|
2024-11-06 10:47:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-11-07 12:00:06 +00:00
|
|
|
},
|
|
|
|
"/applications/v1/info": {
|
|
|
|
"get": {
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiKeyAuth": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"description": "当前的应用程序信息",
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"tags": [
|
|
|
|
"application_api"
|
|
|
|
],
|
|
|
|
"summary": "Current Application Info",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "OK",
|
|
|
|
"schema": {
|
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"data": {
|
|
|
|
"$ref": "#/definitions/entity.Application"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad Request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/schema.ResponseBody"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-11-06 10:47:56 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
2024-11-07 10:09:13 +00:00
|
|
|
"entity.Application": {
|
2024-11-06 10:47:56 +00:00
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2024-11-07 10:09:13 +00:00
|
|
|
"created_at": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"name": {
|
2024-11-06 10:47:56 +00:00
|
|
|
"type": "string"
|
|
|
|
},
|
2024-11-07 10:09:13 +00:00
|
|
|
"updated_at": {
|
2024-11-06 10:47:56 +00:00
|
|
|
"type": "string"
|
|
|
|
},
|
2024-11-07 10:09:13 +00:00
|
|
|
"user_id": {
|
2024-11-06 10:47:56 +00:00
|
|
|
"type": "string"
|
2024-11-07 10:09:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"entity.ApplicationToken": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"application": {
|
|
|
|
"$ref": "#/definitions/entity.Application"
|
|
|
|
},
|
|
|
|
"application_id": {
|
|
|
|
"type": "integer"
|
2024-11-06 10:47:56 +00:00
|
|
|
},
|
2024-11-07 10:09:13 +00:00
|
|
|
"created_at": {
|
2024-11-06 10:47:56 +00:00
|
|
|
"type": "string"
|
|
|
|
},
|
2024-11-07 10:09:13 +00:00
|
|
|
"id": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"token": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"updated_at": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.ApplicationCreateRequest": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
2024-11-06 10:47:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"schema.ResponseBody": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"data": {},
|
|
|
|
"error": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"message": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"success": {
|
|
|
|
"type": "boolean"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"securityDefinitions": {
|
|
|
|
"ApiKeyAuth": {
|
|
|
|
"type": "apiKey",
|
|
|
|
"name": "Authorization",
|
|
|
|
"in": "header"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
|
var SwaggerInfo = &swag.Spec{
|
|
|
|
Version: "1.0",
|
|
|
|
Host: "",
|
|
|
|
BasePath: "",
|
|
|
|
Schemes: []string{},
|
2024-11-07 10:09:13 +00:00
|
|
|
Title: "Recommender API",
|
2024-11-06 10:47:56 +00:00
|
|
|
Description: "",
|
|
|
|
InfoInstanceName: "swagger",
|
|
|
|
SwaggerTemplate: docTemplate,
|
|
|
|
LeftDelim: "{{",
|
|
|
|
RightDelim: "}}",
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
|
}
|