|
|
|
|
|
package docs |
|
|
|
import "github.com/swaggo/swag" |
|
|
|
const docTemplate = `{ |
|
"schemes": {{ marshal .Schemes }}, |
|
"swagger": "2.0", |
|
"info": { |
|
"description": "{{escape .Description}}", |
|
"title": "{{.Title}}", |
|
"termsOfService": "https://t.me/NovelAIDraw_bot", |
|
"contact": { |
|
"name": "honeyxybb", |
|
"url": "https://t.me/honeyxybb", |
|
"email": "pyh1670605849@gmail.com" |
|
}, |
|
"version": "{{.Version}}" |
|
}, |
|
"host": "{{.Host}}", |
|
"basePath": "{{.BasePath}}", |
|
"paths": { |
|
"/control-preprocess": { |
|
"get": { |
|
"description": "Get All Control PreProcess", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Models" |
|
], |
|
"summary": "Get All Control PreProcess", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/control-process": { |
|
"get": { |
|
"description": "Get All Control Process", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Models" |
|
], |
|
"summary": "Get All Control Process", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/detect-ctrl-photo": { |
|
"get": { |
|
"description": "Detect to Ctrl Photo", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Image Handler" |
|
], |
|
"summary": "Detect to Ctrl Photo", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
}, |
|
"post": { |
|
"description": "Detect to Ctrl Photo", |
|
"consumes": [ |
|
"application/json" |
|
], |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Image Handler" |
|
], |
|
"summary": "Detect to Ctrl Photo", |
|
"parameters": [ |
|
{ |
|
"description": "Ctrl Photo Config", |
|
"name": "config", |
|
"in": "body", |
|
"required": true, |
|
"schema": { |
|
"$ref": "#/definitions/router.CtrlPhotoCfg" |
|
} |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/draw": { |
|
"get": { |
|
"description": "Any to Img", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Image Handler" |
|
], |
|
"summary": "Draw Img", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
}, |
|
"post": { |
|
"description": "Any to Img", |
|
"consumes": [ |
|
"application/json" |
|
], |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Image Handler" |
|
], |
|
"summary": "Draw Img", |
|
"parameters": [ |
|
{ |
|
"description": "Draw Config", |
|
"name": "config", |
|
"in": "body", |
|
"required": true, |
|
"schema": { |
|
"$ref": "#/definitions/router.Any2Img" |
|
} |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/extra-model-groups": { |
|
"get": { |
|
"description": "Get Extra Model Group", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Models" |
|
], |
|
"summary": "Get Extra Model Group", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/extra-model-groups/{group}": { |
|
"get": { |
|
"description": "Get Extra Model With Group", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Models" |
|
], |
|
"summary": "Get Extra Model With Group", |
|
"parameters": [ |
|
{ |
|
"type": "string", |
|
"description": "Group Name", |
|
"name": "group", |
|
"in": "path", |
|
"required": true |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/extra-models": { |
|
"get": { |
|
"description": "Get All Extra Model", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Models" |
|
], |
|
"summary": "Get All Extra Model", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/i18n-json/{code}": { |
|
"get": { |
|
"description": "Get i18n language by lang code, eg: /i18n-json/zh_cn", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"I18N" |
|
], |
|
"summary": "Get i18n language", |
|
"parameters": [ |
|
{ |
|
"type": "string", |
|
"description": "Language code", |
|
"name": "code", |
|
"in": "path", |
|
"required": true |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"type": "body" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/i18n/{code}": { |
|
"get": { |
|
"description": "Get i18n language by lang code, eg: /i18n/zh_cn", |
|
"produces": [ |
|
"text/plain" |
|
], |
|
"tags": [ |
|
"I18N" |
|
], |
|
"summary": "Get i18n language", |
|
"parameters": [ |
|
{ |
|
"type": "string", |
|
"description": "Language code", |
|
"name": "code", |
|
"in": "path", |
|
"required": true |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"type": "array", |
|
"items": { |
|
"$ref": "#/definitions/router.I18N" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/images/{filename}": { |
|
"get": { |
|
"description": "Images", |
|
"tags": [ |
|
"Images" |
|
], |
|
"summary": "Images", |
|
"parameters": [ |
|
{ |
|
"type": "string", |
|
"description": "filename", |
|
"name": "filename", |
|
"in": "path", |
|
"required": true |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/interrupt": { |
|
"get": { |
|
"description": "Interrupt Draw Task", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Image Handler" |
|
], |
|
"summary": "Interrupt Draw Task", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/models": { |
|
"get": { |
|
"description": "Get All Models", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Models" |
|
], |
|
"summary": "Get All Models", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/modes": { |
|
"get": { |
|
"description": "Get All Models", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Models" |
|
], |
|
"summary": "Get All Models", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/search-images": { |
|
"get": { |
|
"description": "search Images", |
|
"tags": [ |
|
"Images" |
|
], |
|
"summary": "search Images", |
|
"parameters": [ |
|
{ |
|
"type": "string", |
|
"description": "keywords", |
|
"name": "keywords", |
|
"in": "query", |
|
"required": true |
|
}, |
|
{ |
|
"type": "boolean", |
|
"description": "maxcount", |
|
"name": "maxcount", |
|
"in": "query" |
|
}, |
|
{ |
|
"type": "string", |
|
"description": "order type: latest | random", |
|
"name": "order_type", |
|
"in": "query" |
|
}, |
|
{ |
|
"type": "string", |
|
"description": "page", |
|
"name": "page", |
|
"in": "query" |
|
}, |
|
{ |
|
"type": "string", |
|
"description": "time", |
|
"name": "time", |
|
"in": "query" |
|
}, |
|
{ |
|
"type": "string", |
|
"description": "cfg type: json | yaml", |
|
"name": "cfg_type", |
|
"in": "query" |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/search-user-images": { |
|
"get": { |
|
"description": "search User Images", |
|
"tags": [ |
|
"Images" |
|
], |
|
"summary": "search User Images", |
|
"parameters": [ |
|
{ |
|
"type": "string", |
|
"description": "keywords", |
|
"name": "keywords", |
|
"in": "query", |
|
"required": true |
|
}, |
|
{ |
|
"type": "boolean", |
|
"description": "maxcount", |
|
"name": "maxcount", |
|
"in": "query" |
|
}, |
|
{ |
|
"type": "string", |
|
"description": "order type: latest | random", |
|
"name": "order_type", |
|
"in": "query" |
|
}, |
|
{ |
|
"type": "string", |
|
"description": "page", |
|
"name": "page", |
|
"in": "query" |
|
}, |
|
{ |
|
"type": "string", |
|
"description": "time", |
|
"name": "time", |
|
"in": "query" |
|
}, |
|
{ |
|
"type": "string", |
|
"description": "cfg type: json | yaml", |
|
"name": "cfg_type", |
|
"in": "query" |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/super-resolution": { |
|
"get": { |
|
"description": "SuperResolution", |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Image Handler" |
|
], |
|
"summary": "SuperResolution", |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
}, |
|
"post": { |
|
"description": "SuperResolution", |
|
"consumes": [ |
|
"application/json" |
|
], |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Image Handler" |
|
], |
|
"summary": "SuperResolution", |
|
"parameters": [ |
|
{ |
|
"description": "SuperResolution Config", |
|
"name": "config", |
|
"in": "body", |
|
"required": true, |
|
"schema": { |
|
"$ref": "#/definitions/router.SuperResolutionCfg" |
|
} |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/test-draw-config": { |
|
"post": { |
|
"description": "Test Draw Config", |
|
"consumes": [ |
|
"application/json" |
|
], |
|
"produces": [ |
|
"application/json" |
|
], |
|
"tags": [ |
|
"Image Handler" |
|
], |
|
"summary": "Test Draw Config", |
|
"parameters": [ |
|
{ |
|
"description": "Draw Config", |
|
"name": "config", |
|
"in": "body", |
|
"required": true, |
|
"schema": { |
|
"$ref": "#/definitions/router.Any2Img" |
|
} |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "OK", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
}, |
|
"500": { |
|
"description": "Internal Server Error", |
|
"schema": { |
|
"$ref": "#/definitions/router.Resp" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"definitions": { |
|
"router.Any2Img": { |
|
"type": "object", |
|
"properties": { |
|
"control_photo": { |
|
"type": "string" |
|
}, |
|
"control_preprocess": { |
|
"type": "string" |
|
}, |
|
"control_process": { |
|
"type": "string" |
|
}, |
|
"height": { |
|
"type": "integer" |
|
}, |
|
"mode": { |
|
"type": "string" |
|
}, |
|
"model": { |
|
"type": "string" |
|
}, |
|
"num": { |
|
"type": "integer" |
|
}, |
|
"pre_photo": { |
|
"type": "string" |
|
}, |
|
"scale": { |
|
"type": "integer" |
|
}, |
|
"seed": { |
|
"type": "integer" |
|
}, |
|
"steps": { |
|
"type": "integer" |
|
}, |
|
"strength": { |
|
"type": "number" |
|
}, |
|
"tag": { |
|
"type": "string" |
|
}, |
|
"uc": { |
|
"type": "string" |
|
}, |
|
"width": { |
|
"type": "integer" |
|
} |
|
} |
|
}, |
|
"router.CtrlPhotoCfg": { |
|
"type": "object", |
|
"properties": { |
|
"control_photo": { |
|
"type": "array", |
|
"items": { |
|
"type": "string" |
|
} |
|
}, |
|
"control_preprocess": { |
|
"type": "string" |
|
}, |
|
"res_size": { |
|
"type": "integer" |
|
} |
|
} |
|
}, |
|
"router.I18N": { |
|
"type": "object", |
|
"properties": { |
|
"groups": { |
|
"type": "string" |
|
}, |
|
"key": { |
|
"type": "string" |
|
}, |
|
"value": { |
|
"type": "string" |
|
} |
|
} |
|
}, |
|
"router.Resp": { |
|
"type": "object", |
|
"properties": { |
|
"data": {}, |
|
"err": { |
|
"type": "string" |
|
}, |
|
"time": { |
|
"type": "integer" |
|
} |
|
} |
|
}, |
|
"router.SuperResolutionCfg": { |
|
"type": "object", |
|
"properties": { |
|
"multiplier": { |
|
"type": "integer" |
|
}, |
|
"photo": { |
|
"type": "array", |
|
"items": { |
|
"type": "string" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}` |
|
|
|
|
|
var SwaggerInfo = &swag.Spec{ |
|
Version: "1.0", |
|
Host: "creation.pyhdxy.top", |
|
BasePath: "/api", |
|
Schemes: []string{}, |
|
Title: "Creation AI API", |
|
Description: "Easy API", |
|
InfoInstanceName: "swagger", |
|
SwaggerTemplate: docTemplate, |
|
} |
|
|
|
func init() { |
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) |
|
} |
|
|