增加info获取接口

This commit is contained in:
algotao
2025-08-09 22:09:10 +08:00
parent edb12c3b1f
commit 80a758f1e3
7 changed files with 429 additions and 192 deletions

View File

@@ -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 {

View File

@@ -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)