作者 唐旭辉

数据 输出格式修改

@@ -21,7 +21,7 @@ type ResponseListData struct { @@ -21,7 +21,7 @@ type ResponseListData struct {
21 type DepartmentBase struct { 21 type DepartmentBase struct {
22 Id int64 `json:"id" orm:"column(id)"` 22 Id int64 `json:"id" orm:"column(id)"`
23 Name string `json:"name" orm:"column(name)"` 23 Name string `json:"name" orm:"column(name)"`
24 - ParentId int64 `json:"parent_id" orm:"column(parent_id)"` 24 + ParentId int64 `json:"parentId" orm:"column(parent_id)"`
25 } 25 }
26 26
27 //RoleBase 下拉选择列表-角色 27 //RoleBase 下拉选择列表-角色
@@ -45,7 +45,7 @@ type RoleInfo struct { @@ -45,7 +45,7 @@ type RoleInfo struct {
45 Id int64 `json:"id" orm:"column(id)"` 45 Id int64 `json:"id" orm:"column(id)"`
46 Name string `json:"name" orm:"column(name)"` 46 Name string `json:"name" orm:"column(name)"`
47 IsDefault int8 `json:"is_default" orm:"column(is_default)"` 47 IsDefault int8 `json:"is_default" orm:"column(is_default)"`
48 - Pid int64 `json:"parentId" orm:"column(pid)"` 48 + Pid int64 `json:"groupId" orm:"column(pid)"`
49 } 49 }
50 50
51 type RoleGroup struct { 51 type RoleGroup struct {
@@ -181,31 +181,29 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error { @@ -181,31 +181,29 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error {
181 return nil 181 return nil
182 } 182 }
183 183
184 -func GetRoleList(companyId int64) ([]protocol.RoleGroup, error) { 184 +func GetRoleList(companyId int64) ([]protocol.RoleInfo, error) {
185 var ( 185 var (
186 - roleGroups []protocol.RoleGroup  
187 - err error  
188 - groups []protocol.RoleInfo 186 + roleGroups []protocol.RoleInfo
  187 + err error
  188 + rolesReturn []protocol.RoleInfo
189 ) 189 )
190 - groups, err = getRoleGroupByCompany(companyId) 190 + roleGroups, 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 roleGroups, protocol.NewErrWithMessage("1") 193 + return rolesReturn, protocol.NewErrWithMessage("1")
194 } 194 }
195 - for k, v := range groups { 195 + for _, v := range roleGroups {
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 - return roleGroups, protocol.NewErrWithMessage("1") 200 + continue
201 } 201 }
202 - rolegroup := protocol.RoleGroup{  
203 - RoleInfo: groups[k],  
204 - Roles: roles,  
205 - }  
206 - roleGroups = append(roleGroups, rolegroup) 202 +
  203 + rolesReturn = append(rolesReturn, roles...)
207 } 204 }
208 - return roleGroups, nil 205 + rolesReturn = append(rolesReturn, roleGroups...)
  206 + return rolesReturn, nil
209 } 207 }
210 208
211 func getRoleInfoByPid(companyid int64, pid int64) ([]protocol.RoleInfo, error) { 209 func getRoleInfoByPid(companyid int64, pid int64) ([]protocol.RoleInfo, error) {
1 package sms 1 package sms
  2 +
  3 +type ISmsService interface {
  4 + Send(phone string, conternt string) error
  5 + GetSmsTpl(code string, param ...interface{}) (string, error)
  6 +}
  7 +
  8 +type YunPianSmsService struct {
  9 +}