...
|
...
|
@@ -10,22 +10,23 @@ type HttplibUserServiceGateway struct { |
|
|
httplibBaseServiceGateway
|
|
|
}
|
|
|
|
|
|
// GetUser 获取用户
|
|
|
func (serviceGateway *HttplibUserServiceGateway) GetUser(uid int64) (map[string]interface{}, error) {
|
|
|
url := strings.Join([]string{serviceGateway.baseURL, ""}, "/")
|
|
|
request := serviceGateway.createRequest(url, "post")
|
|
|
url := strings.Join([]string{serviceGateway.baseURL, "users/get-user"}, "/")
|
|
|
request := serviceGateway.createRequest(url, "get")
|
|
|
options := make(map[string]interface{})
|
|
|
options["uid"] = uid
|
|
|
request.JSONBody(options)
|
|
|
response := make(map[string]interface{})
|
|
|
request.ToJSON(&response)
|
|
|
data, err := serviceGateway.responseHandle(response)
|
|
|
|
|
|
return data, err
|
|
|
}
|
|
|
|
|
|
// GetCompany 获取公司
|
|
|
func (serviceGateway *HttplibUserServiceGateway) GetCompany(companyId int64) (map[string]interface{}, error) {
|
|
|
url := strings.Join([]string{serviceGateway.baseURL, ""}, "/")
|
|
|
request := serviceGateway.createRequest(url, "post")
|
|
|
url := strings.Join([]string{serviceGateway.baseURL, "companies/ge-company"}, "/")
|
|
|
request := serviceGateway.createRequest(url, "get")
|
|
|
options := make(map[string]interface{})
|
|
|
options["companyId"] = companyId
|
|
|
request.JSONBody(options)
|
...
|
...
|
@@ -35,9 +36,10 @@ func (serviceGateway *HttplibUserServiceGateway) GetCompany(companyId int64) (ma |
|
|
return data, err
|
|
|
}
|
|
|
|
|
|
// GetOrganization 获取组织信息
|
|
|
func (serviceGateway *HttplibUserServiceGateway) GetOrganization(organizationId int64) (map[string]interface{}, error) {
|
|
|
url := strings.Join([]string{serviceGateway.baseURL, ""}, "/")
|
|
|
request := serviceGateway.createRequest(url, "post")
|
|
|
url := strings.Join([]string{serviceGateway.baseURL, "orgs/get-org"}, "/")
|
|
|
request := serviceGateway.createRequest(url, "get")
|
|
|
options := make(map[string]interface{})
|
|
|
options["orgId"] = organizationId
|
|
|
request.JSONBody(options)
|
...
|
...
|
@@ -47,6 +49,19 @@ func (serviceGateway *HttplibUserServiceGateway) GetOrganization(organizationId |
|
|
return data, err
|
|
|
}
|
|
|
|
|
|
// UserInMenu 获取用户菜单模块权限
|
|
|
func (serviceGateway *HttplibUserServiceGateway) UserInMenu(menuCode string) (map[string]interface{}, error) {
|
|
|
url := strings.Join([]string{serviceGateway.baseURL, "users/menu"}, "/")
|
|
|
request := serviceGateway.createRequest(url, "get")
|
|
|
options := make(map[string]interface{})
|
|
|
options["code"] = menuCode
|
|
|
request.JSONBody(options)
|
|
|
response := make(map[string]interface{})
|
|
|
request.ToJSON(&response)
|
|
|
data, err := serviceGateway.responseHandle(response)
|
|
|
return data, err
|
|
|
}
|
|
|
|
|
|
func NewHttplibUserServiceGateway() *HttplibUserServiceGateway {
|
|
|
return &HttplibUserServiceGateway{
|
|
|
httplibBaseServiceGateway: httplibBaseServiceGateway{
|
...
|
...
|
|