mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: creat uri aria2 download task
This commit is contained in:
17
routers/controllers/aria2.go
Normal file
17
routers/controllers/aria2.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/HFO4/cloudreve/service/aria2"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// AddAria2URL 添加离线下载URL
|
||||
func AddAria2URL(c *gin.Context) {
|
||||
var addService aria2.AddURLService
|
||||
if err := c.ShouldBindJSON(&addService); err == nil {
|
||||
res := addService.Add(c)
|
||||
c.JSON(200, res)
|
||||
} else {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ func ParamErrorMsg(filed string, tag string) string {
|
||||
"Password": "密码",
|
||||
"Path": "路径",
|
||||
"SourceID": "原始资源",
|
||||
"URL": "链接",
|
||||
}
|
||||
// 未通过的规则与中文对应
|
||||
tagMap := map[string]string{
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
// SiteConfig 获取站点全局配置
|
||||
func SiteConfig(c *gin.Context) {
|
||||
siteConfig := model.GetSettingByNames([]string{
|
||||
siteConfig := model.GetSettingByNames(
|
||||
"siteName",
|
||||
"login_captcha",
|
||||
"qq_login",
|
||||
@@ -25,7 +25,7 @@ func SiteConfig(c *gin.Context) {
|
||||
"share_score_rate",
|
||||
"home_view_method",
|
||||
"share_view_method",
|
||||
})
|
||||
)
|
||||
|
||||
// 如果已登录,则同时返回用户信息
|
||||
user, _ := c.Get("user")
|
||||
|
||||
Reference in New Issue
Block a user