Files
Blog/api/Blog.api
2025-10-24 21:06:39 +08:00

40 lines
729 B
Plaintext

syntax = "v1"
info (
title: "Blog API"
desc: "API for blog application with file operations"
author: "user"
date: "2025-10-24"
version: "v1"
)
type UploadReq {
FileName string `json:"fileName"`
}
type UploadResp {
PresignedUrl string `json:"presignedUrl"`
}
type DownloadReq {
FileKey string `json:"fileKey"`
}
type DownloadResp {
PresignedUrl string `json:"presignedUrl"`
}
@server (
prefix: /api/v1
)
service Blog {
@handler uploadFile
post /files/upload (UploadReq) returns (UploadResp)
@handler downloadFile
get /files/download (DownloadReq) returns (DownloadResp)
@handler previewFile
get /files/preview (DownloadReq) returns (DownloadResp)
}