mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
organization
This commit is contained in:
parent
9d999c4067
commit
06fe1f5b5a
@ -433,7 +433,7 @@ func DeleteUserInDepartment(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
apiResp := api.GetDepartmentMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
|
apiResp := api.DeleteUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
|
||||||
c.JSON(http.StatusOK, apiResp)
|
c.JSON(http.StatusOK, apiResp)
|
||||||
}
|
}
|
||||||
|
@ -220,10 +220,17 @@ func (s *organizationServer) CreateDepartmentMember(ctx context.Context, req *rp
|
|||||||
return &rpc.CreateDepartmentMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil
|
return &rpc.CreateDepartmentMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err, _ := imdb.GetOrganizationUser(req.DepartmentMember.UserID)
|
||||||
|
if err != nil {
|
||||||
|
errMsg := req.OperationID + "" + req.DepartmentMember.UserID + " is not exist"
|
||||||
|
log.Error(req.OperationID, errMsg)
|
||||||
|
return &rpc.CreateDepartmentMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil
|
||||||
|
}
|
||||||
|
|
||||||
departmentMember := db.DepartmentMember{}
|
departmentMember := db.DepartmentMember{}
|
||||||
utils.CopyStructFields(&departmentMember, req.DepartmentMember)
|
utils.CopyStructFields(&departmentMember, req.DepartmentMember)
|
||||||
log.Debug(req.OperationID, "src ", *req.DepartmentMember, "dst ", departmentMember)
|
log.Debug(req.OperationID, "src ", *req.DepartmentMember, "dst ", departmentMember)
|
||||||
err := imdb.CreateDepartmentMember(&departmentMember)
|
err = imdb.CreateDepartmentMember(&departmentMember)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errMsg := req.OperationID + " " + "CreateDepartmentMember failed " + err.Error()
|
errMsg := req.OperationID + " " + "CreateDepartmentMember failed " + err.Error()
|
||||||
log.Error(req.OperationID, errMsg, departmentMember)
|
log.Error(req.OperationID, errMsg, departmentMember)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user