sys_dept.go 788 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * @desc:部门管理
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu<yxh669@qq.com>
  5. * @Date: 2022/4/6 15:15
  6. */
  7. package controller
  8. import (
  9. "context"
  10. "github.com/tiger1103/gfast/v3/api/v1/system"
  11. "github.com/tiger1103/gfast/v3/internal/app/system/service"
  12. )
  13. var Dept = sysDeptController{}
  14. type sysDeptController struct {
  15. BaseController
  16. }
  17. // List 部门列表
  18. func (c *sysDeptController) List(ctx context.Context, req *system.DeptSearchReq) (res *system.DeptSearchRes, err error) {
  19. res = new(system.DeptSearchRes)
  20. res.DeptList, err = service.Dept().GetList(ctx, req)
  21. return
  22. }
  23. // Add 添加部门
  24. func (c *sysDeptController) Add(ctx context.Context, req *system.DeptAddReq) (res *system.DeptAddRes, err error) {
  25. err = service.Dept().Add(ctx, req)
  26. return
  27. }