loginLog.go 855 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package handler
  2. import (
  3. "context"
  4. "dashoo.cn/common_definition/comm_def"
  5. "github.com/gogf/gf/frame/g"
  6. "dashoo.cn/micro/app/model"
  7. "dashoo.cn/micro/app/service"
  8. )
  9. type LoginLogHandler struct{}
  10. // GetList 获取列表
  11. func (h *LoginLogHandler) GetList(ctx context.Context, req *model.SysLoginLogSearchReq, rsp *comm_def.CommonMsg) error {
  12. logService, err := service.NewLoginLogService(ctx)
  13. if err != nil {
  14. return err
  15. }
  16. total, list, err := logService.GetList(req)
  17. if err != nil {
  18. return err
  19. }
  20. rsp.Data = g.Map{"list": list, "total": total}
  21. return nil
  22. }
  23. // DeleteByIds 删除菜单
  24. func (h *LoginLogHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
  25. logService, err := service.NewLoginLogService(ctx)
  26. if err != nil {
  27. return err
  28. }
  29. err = logService.DeleteByIds(req.Ids)
  30. return err
  31. }