feat: add toolbox query, upload module, update config and gitignore
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
44
app/main/api/desc/front/upload.api
Normal file
44
app/main/api/desc/front/upload.api
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "上传服务"
|
||||
desc: "图片 Base64 上传与文件访问"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
//============================> upload v1 <============================
|
||||
// 访问已上传图片(直接输出二进制,无 JSON 包装)
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: upload
|
||||
)
|
||||
service main {
|
||||
@doc "访问已上传图片"
|
||||
@handler serveUpload
|
||||
get /upload/file/:name (ServeUploadFileReq)
|
||||
}
|
||||
|
||||
type ServeUploadFileReq {
|
||||
Name string `path:"name"`
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: upload
|
||||
jwt: JwtAuth
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "图片 Base64 上传"
|
||||
@handler uploadImage
|
||||
post /upload/image (UploadImageReq) returns (UploadImageResp)
|
||||
}
|
||||
|
||||
type (
|
||||
UploadImageReq {
|
||||
ImageBase64 string `json:"image_base64"`
|
||||
}
|
||||
UploadImageResp {
|
||||
Url string `json:"url"`
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user