Commit 2caf26b3 authored by ibuler's avatar ibuler

Merge branch 'master' of github.com:LeeEirc/cocogo

parents 297a5451 466fa48a
......@@ -51,37 +51,35 @@ func (c *WrapperClient) Get(url string, res interface{}, needAuth bool) error {
}
func (c *WrapperClient) Post(url string, data interface{}, res interface{}, needAuth bool) error {
//if needAuth {
// c.Http.SetAuth(c.Auth.Sign())
//} else {
// c.Http.SetAuth("")
//}
return c.Http.Post(url, data, res)
if needAuth {
return c.AuthClient.Post(url, data, res)
} else {
return c.Http.Post(url, data, res)
}
}
func (c *WrapperClient) Delete(url string, res interface{}, needAuth bool) error {
//if needAuth {
// c.Http.SetAuth(c.Auth.Sign())
//} else {
// c.Http.SetAuth("")
//}
return c.Http.Delete(url, res)
if needAuth {
return c.AuthClient.Delete(url, res)
} else {
return c.Http.Delete(url, res)
}
}
func (c *WrapperClient) Put(url string, data interface{}, res interface{}, needAuth bool) error {
//if needAuth {
// c.Http.SetAuth(c.Auth.Sign())
//} else {
// c.Http.SetAuth("")
//}
return c.Http.Put(url, data, res)
if needAuth {
return c.AuthClient.Put(url, data, res)
} else {
return c.Http.Put(url, data, res)
}
}
func (c *WrapperClient) Patch(url string, data interface{}, res interface{}, needAuth bool) error {
//if needAuth {
// c.Http.SetAuth(c.Auth.Sign())
//} else {
// c.Http.SetAuth("")
//}
return c.Http.Patch(url, data, res)
if needAuth {
return c.AuthClient.Patch(url, data, res)
} else {
return c.Http.Patch(url, data, res)
}
}
package service
import (
"cocogo/pkg/logger"
"cocogo/pkg/sdk"
"fmt"
)
func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info sdk.SystemUserAuthInfo) {
......@@ -9,5 +11,11 @@ func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info sdk.SystemUs
}
func GetSystemUserAuthInfo(systemUserID string) (info sdk.SystemUserAuthInfo) {
Url := fmt.Sprintf(sdk.SystemUserAuthInfoURL, systemUserID)
err := client.Get(Url, &info, true)
if err != nil {
logger.Error("Get system user auth info failed")
}
return
}
package service
import "cocogo/pkg/sdk"
var client = sdk.WrapperClient{}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment