SysLoginLogController.java 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package com.bizmatics.controller.web;
  2. import com.bizmatics.common.core.bean.ApiResult;
  3. import com.bizmatics.common.core.bean.CommonPage;
  4. import com.bizmatics.model.vo.SysLoginLogVo;
  5. import com.bizmatics.service.SysLoginLogService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RequestParam;
  10. import org.springframework.web.bind.annotation.RestController;
  11. /**
  12. * 统计管理-用户登录记录
  13. *
  14. * @author ya
  15. * @since 2022-06-02
  16. */
  17. @RestController
  18. @RequestMapping("/sysLoginLog")
  19. public class SysLoginLogController {
  20. @Autowired
  21. private SysLoginLogService sysLoginLogService;
  22. /**
  23. * 统计管理-用户登录记录-列表查询
  24. *
  25. * @param ipaddr 登录地址
  26. * @param userName 账号
  27. * @param nickName 用户名称
  28. * @param status 登录状态(0成功 1失败)
  29. * @param startTime 开始时间 2021-01-01 15:15:15
  30. * @param endTime 结束时间 2021-01-01 15:15:15
  31. * @param page 当前页
  32. * @param size 条数
  33. * @return
  34. */
  35. @GetMapping("/getLoginLogList")
  36. public ApiResult<CommonPage<SysLoginLogVo>> getLoginLogList(@RequestParam(value = "ipaddr", required = false) String ipaddr,
  37. @RequestParam(value = "userName", required = false) String userName,
  38. @RequestParam(value = "nickName", required = false) String nickName,
  39. @RequestParam(value = "status", required = false, defaultValue = "2") Integer status,
  40. @RequestParam(value = "startTime", required = false) String startTime,
  41. @RequestParam(value = "endTime", required = false) String endTime,
  42. @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
  43. @RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
  44. return ApiResult.success(sysLoginLogService.getLoginLogList(ipaddr, userName, nickName, status, startTime, endTime, page, size));
  45. }
  46. }