实验报表授权、GEO支持
This commit is contained in:
@@ -1,34 +1,37 @@
|
||||
package saashttp
|
||||
|
||||
const (
|
||||
baseUrl = "https://api.rta.qq.com"
|
||||
infoPath = "/saas/info"
|
||||
writePath = "/saas/write"
|
||||
readPath = "/saas/read"
|
||||
columnWritePath = "/saas/column_write"
|
||||
taskCreatePath = "/saas/task/create"
|
||||
taskListPath = "/saas/task/list"
|
||||
taskInfoPath = "/saas/task/info"
|
||||
taskUploadPath = "/saas/task/upload"
|
||||
taskDownloadPath = "/saas/task/download"
|
||||
taskDeletePath = "/saas/task/delete"
|
||||
taskRunPath = "/saas/task/run"
|
||||
targetListPath = "/saas/target/list"
|
||||
targetCreatePath = "/saas/target/create"
|
||||
targetDeletePath = "/saas/target/delete"
|
||||
bindSetPath = "/saas/bind/set"
|
||||
bindDeletePath = "/saas/bind/delete"
|
||||
scriptRunPath = "/saas/script/run"
|
||||
scriptCreatePath = "/saas/script/create"
|
||||
scriptListPath = "/saas/script/list"
|
||||
scriptDeletePath = "/saas/script/delete"
|
||||
scriptGetPath = "/saas/script/get"
|
||||
scriptUsePath = "/saas/script/use"
|
||||
expListPath = "/saas/exp/list"
|
||||
expGetPath = "/saas/exp/get"
|
||||
grantListPath = "/saas/grant/list"
|
||||
grantAddPath = "/saas/grant/add"
|
||||
grantDeletePath = "/saas/grant/delete"
|
||||
baseUrl = "https://api.rta.qq.com"
|
||||
infoPath = "/saas/info"
|
||||
writePath = "/saas/write"
|
||||
readPath = "/saas/read"
|
||||
columnWritePath = "/saas/column_write"
|
||||
taskCreatePath = "/saas/task/create"
|
||||
taskListPath = "/saas/task/list"
|
||||
taskInfoPath = "/saas/task/info"
|
||||
taskUploadPath = "/saas/task/upload"
|
||||
taskDownloadPath = "/saas/task/download"
|
||||
taskDeletePath = "/saas/task/delete"
|
||||
taskRunPath = "/saas/task/run"
|
||||
targetListPath = "/saas/target/list"
|
||||
targetCreatePath = "/saas/target/create"
|
||||
targetDeletePath = "/saas/target/delete"
|
||||
bindSetPath = "/saas/bind/set"
|
||||
bindDeletePath = "/saas/bind/delete"
|
||||
scriptRunPath = "/saas/script/run"
|
||||
scriptCreatePath = "/saas/script/create"
|
||||
scriptListPath = "/saas/script/list"
|
||||
scriptDeletePath = "/saas/script/delete"
|
||||
scriptGetPath = "/saas/script/get"
|
||||
scriptUsePath = "/saas/script/use"
|
||||
expListPath = "/saas/exp/list"
|
||||
expGetPath = "/saas/exp/get"
|
||||
expGrantListPath = "/saas/exp/grant/list"
|
||||
expGrantAddPath = "/saas/exp/grant/add"
|
||||
expGrantDeletePath = "/saas/exp/grant/delete"
|
||||
grantListPath = "/saas/grant/list"
|
||||
grantAddPath = "/saas/grant/add"
|
||||
grantDeletePath = "/saas/grant/delete"
|
||||
)
|
||||
|
||||
type Auth struct {
|
||||
@@ -37,34 +40,37 @@ type Auth struct {
|
||||
}
|
||||
|
||||
type ApiUrls struct {
|
||||
BaseUrl string
|
||||
InfoPath string
|
||||
WritePath string
|
||||
ReadPath string
|
||||
ColumnWritePath string
|
||||
TaskCreatePath string
|
||||
TaskListPath string
|
||||
TaskInfoPath string
|
||||
TaskDeletePath string
|
||||
TaskRunPath string
|
||||
TaskUploadPath string
|
||||
TaskDownloadPath string
|
||||
TargetListPath string
|
||||
TargetCreatePath string
|
||||
TargetDeletePath string
|
||||
BindSetPath string
|
||||
BindDeletePath string
|
||||
ScriptRunPath string
|
||||
ScriptCreatePath string
|
||||
ScriptListPath string
|
||||
ScriptDeletePath string
|
||||
ScriptGetPath string
|
||||
ScriptUsePath string
|
||||
ExpListPath string
|
||||
ExpGetPath string
|
||||
GrantListPath string
|
||||
GrantAddPath string
|
||||
GrantDeletePath string
|
||||
BaseUrl string
|
||||
InfoPath string
|
||||
WritePath string
|
||||
ReadPath string
|
||||
ColumnWritePath string
|
||||
TaskCreatePath string
|
||||
TaskListPath string
|
||||
TaskInfoPath string
|
||||
TaskDeletePath string
|
||||
TaskRunPath string
|
||||
TaskUploadPath string
|
||||
TaskDownloadPath string
|
||||
TargetListPath string
|
||||
TargetCreatePath string
|
||||
TargetDeletePath string
|
||||
BindSetPath string
|
||||
BindDeletePath string
|
||||
ScriptRunPath string
|
||||
ScriptCreatePath string
|
||||
ScriptListPath string
|
||||
ScriptDeletePath string
|
||||
ScriptGetPath string
|
||||
ScriptUsePath string
|
||||
ExpListPath string
|
||||
ExpGetPath string
|
||||
ExpGrantListPath string
|
||||
ExpGrantAddPath string
|
||||
ExpGrantDeletePath string
|
||||
GrantListPath string
|
||||
GrantAddPath string
|
||||
GrantDeletePath string
|
||||
}
|
||||
|
||||
func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
@@ -204,6 +210,24 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
r.ExpGetPath = expGetPath
|
||||
}
|
||||
|
||||
if c.ExpGrantListPath != "" {
|
||||
r.ExpGrantListPath = c.ExpGrantListPath
|
||||
} else {
|
||||
r.ExpGrantListPath = expGrantListPath
|
||||
}
|
||||
|
||||
if c.ExpGrantAddPath != "" {
|
||||
r.ExpGrantAddPath = c.ExpGrantAddPath
|
||||
} else {
|
||||
r.ExpGrantAddPath = expGrantAddPath
|
||||
}
|
||||
|
||||
if c.ExpGrantDeletePath != "" {
|
||||
r.ExpGrantDeletePath = c.ExpGrantDeletePath
|
||||
} else {
|
||||
r.ExpGrantDeletePath = expGrantDeletePath
|
||||
}
|
||||
|
||||
if c.GrantListPath != "" {
|
||||
r.GrantListPath = c.GrantListPath
|
||||
} else {
|
||||
|
||||
@@ -143,6 +143,21 @@ func (c *SaasClient) GrantDelete(saasReq *saasapi.SaasReq) (saasRes *saasapi.Saa
|
||||
return c.post(postUrl, saasReq)
|
||||
}
|
||||
|
||||
func (c *SaasClient) ExpGrantList(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) {
|
||||
postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.ExpGrantListPath)
|
||||
return c.post(postUrl, saasReq)
|
||||
}
|
||||
|
||||
func (c *SaasClient) ExpGrantAdd(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) {
|
||||
postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.ExpGrantAddPath)
|
||||
return c.post(postUrl, saasReq)
|
||||
}
|
||||
|
||||
func (c *SaasClient) ExpGrantDelete(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) {
|
||||
postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.ExpGrantDeletePath)
|
||||
return c.post(postUrl, saasReq)
|
||||
}
|
||||
|
||||
func (c *SaasClient) makeUrl(baseUrl, path string, params ...string) string {
|
||||
url, err := url.Parse(baseUrl)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user