You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
48 lines
1.1 KiB
syntax = "v1"
|
|
|
|
info(
|
|
title: "HD4K漫画下载服务"
|
|
desc: "下载HD4K漫画图片的API服务"
|
|
author: "hd4k-downloader"
|
|
version: "v1.0.0"
|
|
)
|
|
|
|
type (
|
|
// 下载请求
|
|
DownloadRequest {
|
|
Title string `json:"title"`
|
|
Imgs map[string]string `json:"imgs"`
|
|
}
|
|
|
|
// 下载进度详情
|
|
ProgressDetail {
|
|
Key string `json:"key"`
|
|
URL string `json:"url"`
|
|
Status string `json:"status"`
|
|
Message string `json:"message"`
|
|
SavedAs string `json:"saved_as,optional"`
|
|
}
|
|
|
|
// 下载响应
|
|
DownloadResponse {
|
|
Success bool `json:"success"`
|
|
Message string `json:"message"`
|
|
Title string `json:"title"`
|
|
Folder string `json:"folder"`
|
|
JsonPath string `json:"json_path"`
|
|
Total int `json:"total"`
|
|
Saved int `json:"saved"`
|
|
Skipped int `json:"skipped"`
|
|
Failed int `json:"failed"`
|
|
Details []ProgressDetail `json:"details"`
|
|
}
|
|
)
|
|
|
|
@server(
|
|
middleware: Cors
|
|
timeout: 300000ms # 添加时间单位ms
|
|
)
|
|
service hd4k_downloader {
|
|
@handler SaveImages
|
|
post /api/save_imgs (DownloadRequest) returns (DownloadResponse)
|
|
} |