++
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package config
|
||||
|
||||
import "github.com/zeromicro/go-zero/rest"
|
||||
|
||||
type Config struct {
|
||||
rest.RestConf
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package svc
|
||||
|
||||
import (
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
"hd4k-downloader/internal/config"
|
||||
"hd4k-downloader/internal/middleware"
|
||||
)
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
Cors rest.Middleware
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
Cors: middleware.NewCorsMiddleware().Handle,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
|
||||
package types
|
||||
|
||||
type DownloadRequest struct {
|
||||
Title string `json:"title"`
|
||||
Imgs map[string]string `json:"imgs"`
|
||||
}
|
||||
|
||||
type DownloadResponse struct {
|
||||
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"`
|
||||
}
|
||||
|
||||
type ProgressDetail struct {
|
||||
Key string `json:"key"`
|
||||
URL string `json:"url"`
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
SavedAs string `json:"saved_as,optional"`
|
||||
}
|
||||
Reference in New Issue
Block a user