sys_post.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * @desc:岗位管理
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu
  5. * @Date: 2022/4/7 23:12
  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 Post = postController{}
  14. type postController struct {
  15. BaseController
  16. }
  17. // List 岗位列表
  18. func (c *postController) List(ctx context.Context, req *system.PostSearchReq) (res *system.PostSearchRes, err error) {
  19. res, err = service.SysPost().List(ctx, req)
  20. return
  21. }
  22. // Add 添加岗位
  23. func (c *postController) Add(ctx context.Context, req *system.PostAddReq) (res *system.PostAddRes, err error) {
  24. err = service.SysPost().Add(ctx, req)
  25. return
  26. }
  27. // Edit 修改岗位
  28. func (c *postController) Edit(ctx context.Context, req *system.PostEditReq) (res *system.PostEditRes, err error) {
  29. err = service.SysPost().Edit(ctx, req)
  30. return
  31. }
  32. // Delete 删除岗位
  33. func (c *postController) Delete(ctx context.Context, req *system.PostDeleteReq) (res *system.PostDeleteRes, err error) {
  34. err = service.SysPost().Delete(ctx, req.Ids)
  35. return
  36. }