正在显示
7 个修改的文件
包含
15 行增加
和
9 行删除
@@ -525,13 +525,14 @@ func (c *CompanyController) DepartmentUser() { | @@ -525,13 +525,14 @@ func (c *CompanyController) DepartmentUser() { | ||
525 | } | 525 | } |
526 | 526 | ||
527 | //CurrentCompanyEdit 编辑当前公司 | 527 | //CurrentCompanyEdit 编辑当前公司 |
528 | +//@router /company/current/edit | ||
528 | func (c *CompanyController) CurrentCompanyEdit() { | 529 | func (c *CompanyController) CurrentCompanyEdit() { |
529 | var msg *protocol.ResponseMessage | 530 | var msg *protocol.ResponseMessage |
530 | defer func() { | 531 | defer func() { |
531 | c.ResposeJson(msg) | 532 | c.ResposeJson(msg) |
532 | }() | 533 | }() |
533 | type Parameter struct { | 534 | type Parameter struct { |
534 | - Logo string `json:"string"` | 535 | + Logo string `json:"logo"` |
535 | } | 536 | } |
536 | var param Parameter | 537 | var param Parameter |
537 | if err := json.Unmarshal(c.Ctx.Input.RequestBody, ¶m); err != nil { | 538 | if err := json.Unmarshal(c.Ctx.Input.RequestBody, ¶m); err != nil { |
@@ -171,8 +171,8 @@ func (c *RbacController) RoleGroupDelete() { | @@ -171,8 +171,8 @@ func (c *RbacController) RoleGroupDelete() { | ||
171 | return | 171 | return |
172 | } | 172 | } |
173 | 173 | ||
174 | -// RoleList | ||
175 | -// @router /role [get] | 174 | +// RoleList ... |
175 | +// @router /rbac/role/list [post] | ||
176 | func (c *RbacController) RoleList() { | 176 | func (c *RbacController) RoleList() { |
177 | var msg *protocol.ResponseMessage | 177 | var msg *protocol.ResponseMessage |
178 | defer func() { | 178 | defer func() { |
@@ -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:"parant_id"` //父级部门Id | 43 | + ParantID int64 `json:"parantId"` //父级部门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"` //成员数 |
@@ -42,9 +42,10 @@ type RequestRoleList struct { | @@ -42,9 +42,10 @@ type RequestRoleList struct { | ||
42 | } | 42 | } |
43 | 43 | ||
44 | type RoleInfo struct { | 44 | type RoleInfo struct { |
45 | - Id int64 `json:"id"` | ||
46 | - Name string `json:"name"` | ||
47 | - IsDefault int8 `json:"is_default"` | 45 | + Id int64 `json:"id" orm:"column(id)"` |
46 | + Name string `json:"name" orm:"column(name)"` | ||
47 | + IsDefault int8 `json:"is_default" orm:"column(is_default)"` | ||
48 | + Pid int64 `json:"parentId" orm:"column(pid)"` | ||
48 | } | 49 | } |
49 | 50 | ||
50 | type RoleGroup struct { | 51 | type RoleGroup struct { |
@@ -22,6 +22,10 @@ func init() { | @@ -22,6 +22,10 @@ func init() { | ||
22 | beego.NSRouter("/delete", &controllers.CompanyController{}, "post:DepartmentDelete"), | 22 | beego.NSRouter("/delete", &controllers.CompanyController{}, "post:DepartmentDelete"), |
23 | beego.NSRouter("/user", &controllers.CompanyController{}, "post:DepartmentUser"), | 23 | beego.NSRouter("/user", &controllers.CompanyController{}, "post:DepartmentUser"), |
24 | ), | 24 | ), |
25 | + beego.NSNamespace("/company", | ||
26 | + beego.NSRouter("/current/edit", &controllers.CompanyController{}, "post:CurrentCompanyEdit"), | ||
27 | + beego.NSRouter("/current/info", &controllers.CompanyController{}, "post:CurrentCompanyInfo"), | ||
28 | + ), | ||
25 | beego.NSNamespace("position", | 29 | beego.NSNamespace("position", |
26 | beego.NSRouter("/list", &controllers.CompanyController{}, "post:PositionList"), | 30 | beego.NSRouter("/list", &controllers.CompanyController{}, "post:PositionList"), |
27 | beego.NSRouter("/add", &controllers.CompanyController{}, "post:PositionAdd"), | 31 | beego.NSRouter("/add", &controllers.CompanyController{}, "post:PositionAdd"), |
@@ -187,7 +187,7 @@ func GetRoleList(companyId int64) ([]protocol.RoleGroup, error) { | @@ -187,7 +187,7 @@ func GetRoleList(companyId int64) ([]protocol.RoleGroup, error) { | ||
187 | 187 | ||
188 | func getRoleInfoByPid(companyid int64, pid int64) ([]protocol.RoleInfo, error) { | 188 | func getRoleInfoByPid(companyid int64, pid int64) ([]protocol.RoleInfo, error) { |
189 | const ( | 189 | const ( |
190 | - dataSql string = `SELECT id,name,is_default FROM role WHERE company_id=? AND pid=? and delete_at=0 ` | 190 | + dataSql string = `SELECT id,name,is_default,pid FROM role WHERE company_id=? AND pid=? and delete_at=0 ` |
191 | ) | 191 | ) |
192 | var ( | 192 | var ( |
193 | err error | 193 | err error |
@@ -33,7 +33,7 @@ func ArrayIntDiff(arr1 []int, arr2 []int) []int { | @@ -33,7 +33,7 @@ func ArrayIntDiff(arr1 []int, arr2 []int) []int { | ||
33 | } | 33 | } |
34 | setmap := make(map[int]bool) | 34 | setmap := make(map[int]bool) |
35 | for i := range arr2 { | 35 | for i := range arr2 { |
36 | - setmap[arr1[i]] = true | 36 | + setmap[arr2[i]] = true |
37 | } | 37 | } |
38 | var result []int | 38 | var result []int |
39 | for i := range arr1 { | 39 | for i := range arr1 { |
-
请 注册 或 登录 后发表评论