...
|
...
|
@@ -430,3 +430,68 @@ func (gateway HttplibAlliedCreationUser) UserAccessMenus(param ReqUserAccessMenu |
|
|
err = gateway.GetResponseData(result, &data)
|
|
|
return &data, err
|
|
|
}
|
|
|
|
|
|
//UserSearch 搜索用户列表
|
|
|
func (gateway HttplibAlliedCreationUser) UserBaseSearch(param ReqUserBaseSearch) (*DataUserBaseSearch, error) {
|
|
|
url := gateway.baseUrL + "/user-base/search"
|
|
|
method := "post"
|
|
|
req := gateway.CreateRequest(url, method)
|
|
|
//TODO traceID
|
|
|
log.Logger.Debug("向用户模块请求数据:搜索用户列表。", map[string]interface{}{
|
|
|
"api": method + ":" + url,
|
|
|
"param": param,
|
|
|
})
|
|
|
req, err := req.JSONBody(param)
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("搜索用户列表失败:%w", err)
|
|
|
}
|
|
|
|
|
|
byteResult, err := req.Bytes()
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("获取搜索用户列表失败:%w", err)
|
|
|
}
|
|
|
if param.Limit > 50 {
|
|
|
//太多就不打印了
|
|
|
log.Logger.Debug("获取用户模块请求数据:搜索用户列表。", map[string]interface{}{
|
|
|
"result": string(byteResult),
|
|
|
})
|
|
|
}
|
|
|
|
|
|
var result service_gateway.GatewayResponse
|
|
|
err = json.Unmarshal(byteResult, &result)
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("解析搜索用户列表:%w", err)
|
|
|
}
|
|
|
var data DataUserBaseSearch
|
|
|
err = gateway.GetResponseData(result, &data)
|
|
|
return &data, err
|
|
|
}
|
|
|
|
|
|
func (gateway HttplibAlliedCreationUser) EnableUserBase(param ReqEnableUserBase) (interface{}, error) {
|
|
|
url := gateway.baseUrL + "/user-base/batch-enable"
|
|
|
method := "post"
|
|
|
req := gateway.CreateRequest(url, method)
|
|
|
//TODO traceID
|
|
|
log.Logger.Debug("向用户模块请求数据:搜索用户列表。", map[string]interface{}{
|
|
|
"api": method + ":" + url,
|
|
|
"param": param,
|
|
|
})
|
|
|
req, err := req.JSONBody(param)
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("搜索用户列表失败:%w", err)
|
|
|
}
|
|
|
|
|
|
byteResult, err := req.Bytes()
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("获取搜索用户列表失败:%w", err)
|
|
|
}
|
|
|
|
|
|
var result service_gateway.GatewayResponse
|
|
|
err = json.Unmarshal(byteResult, &result)
|
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("解析搜索用户列表:%w", err)
|
|
|
}
|
|
|
//var data DataCompanyEnable
|
|
|
//err = gateway.GetResponseData(result, &data)
|
|
|
return nil, err
|
|
|
} |
...
|
...
|
|