thread-master/apps/backend/generate/api/media.api

26 lines
497 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "v1"
type (
MediaUploadReq {
// content: data URL (data:image/jpeg;base64,...) 或純 base64
Content string `json:"content"`
// kind: avatar | other決定 object path 前綴)
Kind string `json:"kind,optional"`
}
MediaUploadData {
Url string `json:"url"`
Key string `json:"key,optional"`
}
)
@server (
group: media
prefix: /api/v1/media
middleware: AuthJWT
)
service gateway {
@handler Upload
post /upload (MediaUploadReq) returns (MediaUploadData)
}