正在显示
11 个修改的文件
包含
15 行增加
和
13 行删除
@@ -40,7 +40,7 @@ type ResponseDepartmentInfo struct { | @@ -40,7 +40,7 @@ type ResponseDepartmentInfo struct { | ||
40 | ID int64 `json:"id"` | 40 | ID int64 `json:"id"` |
41 | CompanyID int64 `json:"company_id"` //公司 | 41 | CompanyID int64 `json:"company_id"` //公司 |
42 | Name string `json:"name"` //部门名字 | 42 | Name string `json:"name"` //部门名字 |
43 | - ParantID int64 `json:"parentId"` //父级部门Id | 43 | + ParantID int64 `json:"parent_id"` //父级部门Id |
44 | Manages []DepartmentManager `json:"manages"` //部门管理员 | 44 | Manages []DepartmentManager `json:"manages"` //部门管理员 |
45 | Members []DepartmentMember `json:"members"` //部门成员 | 45 | Members []DepartmentMember `json:"members"` //部门成员 |
46 | Member int64 `json:"member"` //成员数 | 46 | Member int64 `json:"member"` //成员数 |
@@ -181,29 +181,31 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error { | @@ -181,29 +181,31 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error { | ||
181 | return nil | 181 | return nil |
182 | } | 182 | } |
183 | 183 | ||
184 | -func GetRoleList(companyId int64) ([]protocol.RoleInfo, error) { | 184 | +func GetRoleList(companyId int64) ([]protocol.RoleGroup, error) { |
185 | var ( | 185 | var ( |
186 | - roleGroups []protocol.RoleInfo | ||
187 | - err error | ||
188 | - rolesReturn []protocol.RoleInfo | 186 | + roleGroups []protocol.RoleGroup |
187 | + err error | ||
188 | + groups []protocol.RoleInfo | ||
189 | ) | 189 | ) |
190 | - roleGroups, err = getRoleGroupByCompany(companyId) | 190 | + groups, err = getRoleGroupByCompany(companyId) |
191 | if err != nil { | 191 | if err != nil { |
192 | log.Error("getRoleGroupByCompany err:%s", err) | 192 | log.Error("getRoleGroupByCompany err:%s", err) |
193 | - return rolesReturn, protocol.NewErrWithMessage("1") | 193 | + return roleGroups, protocol.NewErrWithMessage("1") |
194 | } | 194 | } |
195 | - for _, v := range roleGroups { | 195 | + for k, v := range groups { |
196 | var roles []protocol.RoleInfo | 196 | var roles []protocol.RoleInfo |
197 | roles, err = getRoleInfoByPid(companyId, v.Id) | 197 | roles, err = getRoleInfoByPid(companyId, v.Id) |
198 | if err != nil { | 198 | if err != nil { |
199 | log.Error("getRoleInfoByPid err:%s", err) | 199 | log.Error("getRoleInfoByPid err:%s", err) |
200 | - continue | 200 | + return roleGroups, protocol.NewErrWithMessage("1") |
201 | } | 201 | } |
202 | - | ||
203 | - rolesReturn = append(rolesReturn, roles...) | 202 | + rolegroup := protocol.RoleGroup{ |
203 | + RoleInfo: groups[k], | ||
204 | + Roles: roles, | ||
205 | + } | ||
206 | + roleGroups = append(roleGroups, rolegroup) | ||
204 | } | 207 | } |
205 | - rolesReturn = append(rolesReturn, roleGroups...) | ||
206 | - return rolesReturn, nil | 208 | + return roleGroups, nil |
207 | } | 209 | } |
208 | 210 | ||
209 | func getRoleInfoByPid(companyid int64, pid int64) ([]protocol.RoleInfo, error) { | 211 | func getRoleInfoByPid(companyid int64, pid int64) ([]protocol.RoleInfo, error) { |
12.1 KB
12.1 KB
12.1 KB
10.9 KB
12.1 KB
3.6 KB
3.1 KB
3.7 KB
4.6 KB
-
请 注册 或 登录 后发表评论