作者 tangxuhui
... ... @@ -657,10 +657,9 @@ loopUser1:
//GetCompanyOrgsByUser 获取登录用户的公司组织列表
func (svr AuthService) GetCompanyOrgsByUser(queryParam *query.GetCompanyOrgsByUserQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(queryParam.Operator)
result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
UserBaseId: queryParam.Operator.UserBaseId,
Phone: queryParam.Operator.Phone,
UserType: domain.UserTypeEmployee,
PullRealTime: true,
})
... ...
... ... @@ -247,3 +247,26 @@ func (srv UserService) UpdateMenuFavorite(menuFavoriteCommand *command.MenuFavor
}
return result, nil
}
// 共创组织列表
func (srv UserService) CooperationOrg(operator domain.Operator) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(operator)
orgs, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
IsOrg: domain.IsOrgFlag,
Limit: 50,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
var ret = make([]interface{}, 0)
for i := range orgs.Orgs {
item := orgs.Orgs[i]
ret = append(ret, map[string]interface{}{
"orgId": item.OrgID,
"orgName": item.OrgName,
})
}
return map[string]interface{}{
"orgs": ret,
}, nil
}
... ...
... ... @@ -138,3 +138,10 @@ func (controller *UserController) UpdateMenuFavorite() {
data, err := svr.UpdateMenuFavorite(cmd)
controller.Response(data, err)
}
func (controller *UserController) CooperationOrg() {
svr := service.UserService{}
operator := controller.GetOperator()
data, err := svr.CooperationOrg(operator)
controller.Response(data, err)
}
... ...
... ... @@ -113,6 +113,7 @@ func CheckAccessToken2() web.FilterFunc {
"/v1/app/cooperation-projects/person/search": "",
"/v1/common/dictionary/search": "",
"/v1/common/app-sharing": "",
"/v1/user/cooperation-org": "",
}
var err error
if filterUrl, err := url.Parse(ctx.Request.RequestURI); err == nil {
... ...
... ... @@ -24,6 +24,8 @@ func init() {
web.Router("/v1/user/msgs", &mobile_client.UserController{}, "Post:Messages")
web.Router("/v1/user/msgs/mark-read", &mobile_client.UserController{}, "Post:MessagesMarkRead")
web.Router("/v1/user/cooperation-org", &mobile_client.UserController{}, "Post:CooperationOrg")
// 特殊处理
web.Router("/v1/app/orgs/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers")
web.Router("/v1/web/orgs/department-users", &web_client.OrgController{}, "Post:DepartmentUsers")
... ...