IMAGE TRANSLATIONS
This commit is contained in:
parent
7bb5a81b8d
commit
3b74e6cd97
7 changed files with 241 additions and 75 deletions
76
docs/docs.go
76
docs/docs.go
|
@ -1,5 +1,4 @@
|
|||
// Code generated by swaggo/swag. DO NOT EDIT.
|
||||
|
||||
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||
package docs
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
|
@ -33,6 +32,50 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/image": {
|
||||
"post": {
|
||||
"description": "When engine is set to all, it will return an array of libmozhi.LangOut.",
|
||||
"summary": "Translate an image",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Engine name",
|
||||
"name": "engine",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Source language",
|
||||
"name": "from",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Target language",
|
||||
"name": "to",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "PNG image in base64 format",
|
||||
"name": "image",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/libmozhi.ImgOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/source_languages": {
|
||||
"get": {
|
||||
"summary": "Show list of available source languages for engine",
|
||||
|
@ -152,6 +195,29 @@ const docTemplate = `{
|
|||
}
|
||||
},
|
||||
"definitions": {
|
||||
"libmozhi.ImgOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sourceB64": {
|
||||
"type": "string"
|
||||
},
|
||||
"sourceLang": {
|
||||
"type": "string"
|
||||
},
|
||||
"sourceTextParsed": {
|
||||
"type": "string"
|
||||
},
|
||||
"targetLang": {
|
||||
"type": "string"
|
||||
},
|
||||
"translatedImgB64": {
|
||||
"type": "string"
|
||||
},
|
||||
"translatedTextParsed": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"libmozhi.LangOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -164,9 +230,15 @@ const docTemplate = `{
|
|||
"source_language": {
|
||||
"type": "string"
|
||||
},
|
||||
"source_transliteration": {
|
||||
"type": "string"
|
||||
},
|
||||
"target_language": {
|
||||
"type": "string"
|
||||
},
|
||||
"target_transliteration": {
|
||||
"type": "string"
|
||||
},
|
||||
"translated-text": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue