作者 唐旭辉

数据 输出格式修改

... ... @@ -21,7 +21,7 @@ type ResponseListData struct {
type DepartmentBase struct {
Id int64 `json:"id" orm:"column(id)"`
Name string `json:"name" orm:"column(name)"`
ParentId int64 `json:"parent_id" orm:"column(parent_id)"`
ParentId int64 `json:"parentId" orm:"column(parent_id)"`
}
//RoleBase 下拉选择列表-角色
... ...
... ... @@ -45,7 +45,7 @@ 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:"parentId" orm:"column(pid)"`
Pid int64 `json:"groupId" orm:"column(pid)"`
}
type RoleGroup struct {
... ...
... ... @@ -181,31 +181,29 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error {
return nil
}
func GetRoleList(companyId int64) ([]protocol.RoleGroup, error) {
func GetRoleList(companyId int64) ([]protocol.RoleInfo, error) {
var (
roleGroups []protocol.RoleGroup
err error
groups []protocol.RoleInfo
roleGroups []protocol.RoleInfo
err error
rolesReturn []protocol.RoleInfo
)
groups, err = getRoleGroupByCompany(companyId)
roleGroups, err = getRoleGroupByCompany(companyId)
if err != nil {
log.Error("getRoleGroupByCompany err:%s", err)
return roleGroups, protocol.NewErrWithMessage("1")
return rolesReturn, protocol.NewErrWithMessage("1")
}
for k, v := range groups {
for _, v := range roleGroups {
var roles []protocol.RoleInfo
roles, err = getRoleInfoByPid(companyId, v.Id)
if err != nil {
log.Error("getRoleInfoByPid err:%s", err)
return roleGroups, protocol.NewErrWithMessage("1")
continue
}
rolegroup := protocol.RoleGroup{
RoleInfo: groups[k],
Roles: roles,
}
roleGroups = append(roleGroups, rolegroup)
rolesReturn = append(rolesReturn, roles...)
}
return roleGroups, nil
rolesReturn = append(rolesReturn, roleGroups...)
return rolesReturn, nil
}
func getRoleInfoByPid(companyid int64, pid int64) ([]protocol.RoleInfo, error) {
... ...
package sms
type ISmsService interface {
Send(phone string, conternt string) error
GetSmsTpl(code string, param ...interface{}) (string, error)
}
type YunPianSmsService struct {
}
... ...