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 { ...@@ -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 { func (c *WrapperClient) Post(url string, data interface{}, res interface{}, needAuth bool) error {
//if needAuth { if needAuth {
// c.Http.SetAuth(c.Auth.Sign()) return c.AuthClient.Post(url, data, res)
//} else { } else {
// c.Http.SetAuth("") return c.Http.Post(url, data, res)
//} }
return c.Http.Post(url, data, res)
} }
func (c *WrapperClient) Delete(url string, res interface{}, needAuth bool) error { func (c *WrapperClient) Delete(url string, res interface{}, needAuth bool) error {
//if needAuth { if needAuth {
// c.Http.SetAuth(c.Auth.Sign()) return c.AuthClient.Delete(url, res)
//} else { } else {
// c.Http.SetAuth("") return c.Http.Delete(url, res)
//} }
return c.Http.Delete(url, res)
} }
func (c *WrapperClient) Put(url string, data interface{}, res interface{}, needAuth bool) error { func (c *WrapperClient) Put(url string, data interface{}, res interface{}, needAuth bool) error {
//if needAuth { if needAuth {
// c.Http.SetAuth(c.Auth.Sign()) return c.AuthClient.Put(url, data, res)
//} else { } else {
// c.Http.SetAuth("") return c.Http.Put(url, data, res)
//} }
return c.Http.Put(url, data, res)
} }
func (c *WrapperClient) Patch(url string, data interface{}, res interface{}, needAuth bool) error { func (c *WrapperClient) Patch(url string, data interface{}, res interface{}, needAuth bool) error {
//if needAuth { if needAuth {
// c.Http.SetAuth(c.Auth.Sign()) return c.AuthClient.Patch(url, data, res)
//} else { } else {
// c.Http.SetAuth("") return c.Http.Patch(url, data, res)
//} }
return c.Http.Patch(url, data, res)
} }
package service package service
import ( import (
"cocogo/pkg/logger"
"cocogo/pkg/sdk" "cocogo/pkg/sdk"
"fmt"
) )
func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info sdk.SystemUserAuthInfo) { func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info sdk.SystemUserAuthInfo) {
...@@ -9,5 +11,11 @@ func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info sdk.SystemUs ...@@ -9,5 +11,11 @@ func GetSystemUserAssetAuthInfo(systemUserID, assetID string) (info sdk.SystemUs
} }
func GetSystemUserAuthInfo(systemUserID string) (info sdk.SystemUserAuthInfo) { 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 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