增加策略列表、绑定、解绑
This commit is contained in:
@@ -1,5 +1,23 @@
|
||||
package saashttp
|
||||
|
||||
const (
|
||||
baseUrl = "https://api.rta.qq.com"
|
||||
writePath = "/saas/write"
|
||||
readPath = "/saas/read"
|
||||
columnWritePath = "/saas/column_write"
|
||||
taskCreatePath = "/saas/task/create"
|
||||
taskListPath = "/saas/task/list"
|
||||
taskCancelPath = "/saas/task/delete"
|
||||
taskInfoPath = "/saas/task/info"
|
||||
taskUploadPath = "/saas/task/upload"
|
||||
taskDownloadPath = "/saas/task/download"
|
||||
taskDeletePath = "/saas/task/delete"
|
||||
taskRunPath = "/saas/task/run"
|
||||
targetListPath = "/saas/target/list"
|
||||
bindSetPath = "/saas/bind/set"
|
||||
bindDeletePath = "/saas/bind/delete"
|
||||
)
|
||||
|
||||
type ApiUrls struct {
|
||||
BaseUrl string
|
||||
WritePath string
|
||||
@@ -12,6 +30,98 @@ type ApiUrls struct {
|
||||
TaskRunPath string
|
||||
TaskUploadPath string
|
||||
TaskDownloadPath string
|
||||
TargetListPath string
|
||||
BindSetPath string
|
||||
BindDeletePath string
|
||||
}
|
||||
|
||||
func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
r := &ApiUrls{}
|
||||
if c.BaseUrl != "" {
|
||||
r.BaseUrl = c.BaseUrl
|
||||
} else {
|
||||
r.BaseUrl = baseUrl
|
||||
}
|
||||
|
||||
if c.WritePath != "" {
|
||||
r.WritePath = c.WritePath
|
||||
} else {
|
||||
r.WritePath = writePath
|
||||
}
|
||||
|
||||
if c.ReadPath != "" {
|
||||
r.ReadPath = c.ReadPath
|
||||
} else {
|
||||
r.ReadPath = readPath
|
||||
}
|
||||
|
||||
if c.ColumnWritePath != "" {
|
||||
r.ColumnWritePath = c.ColumnWritePath
|
||||
} else {
|
||||
r.ColumnWritePath = columnWritePath
|
||||
}
|
||||
|
||||
if c.TaskCreatePath != "" {
|
||||
r.TaskCreatePath = c.TaskCreatePath
|
||||
} else {
|
||||
r.TaskCreatePath = taskCreatePath
|
||||
}
|
||||
|
||||
if c.TaskListPath != "" {
|
||||
r.TaskListPath = c.TaskListPath
|
||||
} else {
|
||||
r.TaskListPath = taskListPath
|
||||
}
|
||||
|
||||
if c.TaskInfoPath != "" {
|
||||
r.TaskInfoPath = c.TaskInfoPath
|
||||
} else {
|
||||
r.TaskInfoPath = taskInfoPath
|
||||
}
|
||||
|
||||
if c.TaskDeletePath != "" {
|
||||
r.TaskDeletePath = c.TaskDeletePath
|
||||
} else {
|
||||
r.TaskDeletePath = taskDeletePath
|
||||
}
|
||||
|
||||
if c.TaskRunPath != "" {
|
||||
r.TaskRunPath = c.TaskRunPath
|
||||
} else {
|
||||
r.TaskRunPath = taskRunPath
|
||||
}
|
||||
|
||||
if c.TaskUploadPath != "" {
|
||||
r.TaskUploadPath = c.TaskUploadPath
|
||||
} else {
|
||||
r.TaskUploadPath = taskUploadPath
|
||||
}
|
||||
|
||||
if c.TaskDownloadPath != "" {
|
||||
r.TaskDownloadPath = c.TaskDownloadPath
|
||||
} else {
|
||||
r.TaskDownloadPath = taskDownloadPath
|
||||
}
|
||||
|
||||
if c.TargetListPath != "" {
|
||||
r.TargetListPath = c.TargetListPath
|
||||
} else {
|
||||
r.TargetListPath = targetListPath
|
||||
}
|
||||
|
||||
if c.BindSetPath != "" {
|
||||
r.BindSetPath = c.BindSetPath
|
||||
} else {
|
||||
r.BindSetPath = bindSetPath
|
||||
}
|
||||
|
||||
if c.BindDeletePath != "" {
|
||||
r.BindDeletePath = c.BindDeletePath
|
||||
} else {
|
||||
r.BindDeletePath = bindDeletePath
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
|
||||
Reference in New Issue
Block a user