作者 唐旭辉

补充数据

... ... @@ -36,11 +36,12 @@ type RequestRoleList struct {
}
type RoleInfo struct {
Id int64 `json:"id" orm:"column(id)"`
Name string `json:"name" orm:"column(name)"`
IsDefault int8 `json:"is_default" orm:"column(is_default)"`
Pid int64 `json:"groupId" orm:"column(pid)"`
Types int8 `json:"types" orm:"column(types)"`
Id int64 `json:"id" orm:"column(id)"`
Name string `json:"name" orm:"column(name)"`
IsDefault int8 `json:"is_default" orm:"column(is_default)"`
Pid int64 `json:"groupId" orm:"column(pid)"`
Types int8 `json:"types" orm:"column(types)"`
InDefaultGroup int `json:"in_default_group"`
}
type RoleGroup struct {
... ...
... ... @@ -279,6 +279,12 @@ func GetRoleList(adminid int64, companyId int64) ([]protocol.RoleGroup, error) {
log.Error("getRoleInfoByPid err:%s", err)
return roleGroups, protocol.NewErrWithMessage("1")
}
if v.IsDefault == models.ROLE_DEFAULR {
for i := range roles {
roles[i].InDefaultGroup = 1
}
groups[k].InDefaultGroup = 1
}
rolegroup := protocol.RoleGroup{
RoleInfo: groups[k],
Roles: roles,
... ... @@ -294,7 +300,7 @@ func getRoleInfoByPid(companyid int64, pid int64) ([]protocol.RoleInfo, error) {
)
var (
err error
roles []protocol.RoleInfo
roles = make([]protocol.RoleInfo, 0)
)
err = utils.ExecuteQueryAll(&roles, dataSql, companyid, pid)
return roles, err
... ...