215 lines
5.8 KiB
JSON
215 lines
5.8 KiB
JSON
{
|
|
"openapi": "3.0.1",
|
|
"info": {
|
|
"title": "默认模块",
|
|
"description": "",
|
|
"version": "1.0.0"
|
|
},
|
|
"tags": [],
|
|
"paths": {
|
|
"/watermark/encode": {
|
|
"post": {
|
|
"summary": "encode",
|
|
"deprecated": false,
|
|
"description": "添加图片水印",
|
|
"tags": [],
|
|
"parameters": [
|
|
{
|
|
"name": "payload",
|
|
"in": "query",
|
|
"description": "",
|
|
"required": false,
|
|
"example": "hello",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "strength",
|
|
"in": "query",
|
|
"description": "",
|
|
"required": false,
|
|
"example": "0.5",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"encoding": {
|
|
"image": {
|
|
"contentType": "form"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"image": {
|
|
"format": "binary",
|
|
"type": "string",
|
|
"description": "图片大小必须<=10MB,仅支持jpeg和png格式",
|
|
"example": "file:///Users/cancerai/Pictures/Screenshot 2026-10-06 at 23.04.54.png"
|
|
},
|
|
"payload": {
|
|
"description": "必须是长度<=8的字母大小写或数字组合",
|
|
"example": "secret",
|
|
"type": "string"
|
|
},
|
|
"strength": {
|
|
"type": "number",
|
|
"description": "取值0~100,一般取值0~1.5",
|
|
"example": 1
|
|
},
|
|
"outputType": {
|
|
"description": "只接收 \"jpeg\" 或 \"png\"",
|
|
"example": "png",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"image",
|
|
"payload",
|
|
"strength",
|
|
"outputType"
|
|
]
|
|
},
|
|
"example": {
|
|
"image": "file:///Users/cancerai/Pictures/Screenshot 2026-10-06 at 23.04.54.png",
|
|
"payload": "secret",
|
|
"strength": 1,
|
|
"outputType": "png"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"image/png": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {}
|
|
}
|
|
}
|
|
},
|
|
"headers": {}
|
|
}
|
|
},
|
|
"security": []
|
|
}
|
|
},
|
|
"/watermark/decode": {
|
|
"post": {
|
|
"summary": "decode",
|
|
"deprecated": false,
|
|
"description": "",
|
|
"tags": [],
|
|
"parameters": [
|
|
{
|
|
"name": "payload",
|
|
"in": "query",
|
|
"description": "",
|
|
"required": false,
|
|
"example": "hello",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "strength",
|
|
"in": "query",
|
|
"description": "",
|
|
"required": false,
|
|
"example": "0.5",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"multipart/form-data": {
|
|
"encoding": {
|
|
"image": {
|
|
"contentType": "form"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"image": {
|
|
"format": "binary",
|
|
"type": "string",
|
|
"description": "需要提取水印的图片,图片大小必须<=10MB,仅支持jpeg和png格式",
|
|
"example": "file:///Users/cancerai/response.jpeg"
|
|
}
|
|
},
|
|
"required": [
|
|
"image"
|
|
]
|
|
},
|
|
"example": {
|
|
"image": "file:///Users/cancerai/response.jpeg"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"hasWatermark": {
|
|
"type": "string",
|
|
"description": "是否存在水印"
|
|
},
|
|
"payload": {
|
|
"type": "string",
|
|
"description": "水印内容"
|
|
},
|
|
"schema": {
|
|
"type": "string",
|
|
"description": "payload元信息"
|
|
}
|
|
},
|
|
"required": [
|
|
"hasWatermark",
|
|
"payload",
|
|
"schema"
|
|
]
|
|
},
|
|
"example": {
|
|
"hasWatermark": true,
|
|
"payload": "secret",
|
|
"schema": 1
|
|
}
|
|
}
|
|
},
|
|
"headers": {}
|
|
}
|
|
},
|
|
"security": []
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {},
|
|
"responses": {},
|
|
"securitySchemes": {}
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "http://localhost:8080",
|
|
"description": "encode env"
|
|
}
|
|
],
|
|
"security": []
|
|
} |