增加info获取接口
This commit is contained in:
@@ -2,6 +2,7 @@ package saashttp
|
||||
|
||||
const (
|
||||
baseUrl = "https://api.rta.qq.com"
|
||||
infoPath = "/saas/info"
|
||||
writePath = "/saas/write"
|
||||
readPath = "/saas/read"
|
||||
columnWritePath = "/saas/column_write"
|
||||
@@ -20,6 +21,7 @@ const (
|
||||
|
||||
type ApiUrls struct {
|
||||
BaseUrl string
|
||||
InfoPath string
|
||||
WritePath string
|
||||
ReadPath string
|
||||
ColumnWritePath string
|
||||
@@ -43,6 +45,12 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
r.BaseUrl = baseUrl
|
||||
}
|
||||
|
||||
if c.InfoPath != "" {
|
||||
r.InfoPath = c.InfoPath
|
||||
} else {
|
||||
r.InfoPath = infoPath
|
||||
}
|
||||
|
||||
if c.WritePath != "" {
|
||||
r.WritePath = c.WritePath
|
||||
} else {
|
||||
|
||||
@@ -33,6 +33,11 @@ type SaasClient struct {
|
||||
ResponseEncoder ResponseEncoder
|
||||
}
|
||||
|
||||
func (c *SaasClient) Info(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) {
|
||||
postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.InfoPath)
|
||||
return c.post(postUrl, saasReq)
|
||||
}
|
||||
|
||||
func (c *SaasClient) Write(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) {
|
||||
postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.WritePath)
|
||||
return c.post(postUrl, saasReq)
|
||||
|
||||
Reference in New Issue
Block a user