mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-11-25 03:15:19 +08:00
* fix(driver/123): initialization the Platform field Signed-off-by: MoYan <1561515308@qq.com> * Fix formatting of Platform field in Pan123 Signed-off-by: MoYan <1561515308@qq.com> --------- Signed-off-by: MoYan <1561515308@qq.com>
36 lines
1.1 KiB
Go
36 lines
1.1 KiB
Go
package _123
|
|
|
|
import (
|
|
"github.com/OpenListTeam/OpenList/v4/internal/driver"
|
|
"github.com/OpenListTeam/OpenList/v4/internal/op"
|
|
)
|
|
|
|
type Addition struct {
|
|
Username string `json:"username" required:"true"`
|
|
Password string `json:"password" required:"true"`
|
|
driver.RootID
|
|
//OrderBy string `json:"order_by" type:"select" options:"file_id,file_name,size,update_at" default:"file_name"`
|
|
//OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
|
|
AccessToken string
|
|
UploadThread int `json:"UploadThread" type:"number" default:"3" help:"the threads of upload"`
|
|
Platform string `json:"platform" type:"string" default:"web" help:"the platform header value, sent with API requests"`
|
|
}
|
|
|
|
var config = driver.Config{
|
|
Name: "123Pan",
|
|
DefaultRoot: "0",
|
|
LocalSort: true,
|
|
}
|
|
|
|
func init() {
|
|
op.RegisterDriver(func() driver.Driver {
|
|
// 新增默认选项 要在RegisterDriver初始化设置 才会对正在使用的用户生效
|
|
return &Pan123{
|
|
Addition: Addition{
|
|
UploadThread: 3,
|
|
Platform: "web",
|
|
},
|
|
}
|
|
})
|
|
}
|