dept.go 891 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package dept_service
  2. import (
  3. "database/sql"
  4. "gfast/app/model/admin/role_dept"
  5. "gfast/app/model/admin/sys_dept"
  6. )
  7. /**
  8. 获取列表数据
  9. */
  10. func GetList(searchParams *sys_dept.SearchParams) ([]*sys_dept.Dept, error) {
  11. if list, err := sys_dept.GetList(searchParams); err != nil {
  12. return nil, err
  13. } else {
  14. return list, nil
  15. }
  16. }
  17. func GetRoleDepts(roleId int64) ([]int64, error) {
  18. return role_dept.GetRoleDepts(roleId)
  19. }
  20. func AddDept(data *sys_dept.AddParams) (sql.Result, error) {
  21. return sys_dept.AddDept(data)
  22. }
  23. func EditDept(data *sys_dept.EditParams) error {
  24. return sys_dept.EditDept(data)
  25. }
  26. func GetDeptById(id uint64) (*sys_dept.Dept, error) {
  27. return sys_dept.GetDeptById(id)
  28. }
  29. /**
  30. 查询部门排除节点
  31. */
  32. func Exclude(id int64) ([]*sys_dept.Dept, error) {
  33. return sys_dept.Exclude(id)
  34. }
  35. /**
  36. 删除
  37. */
  38. func DelDept(id int64) error {
  39. return sys_dept.DelDept(id)
  40. }