sys_oper_log.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # -*- coding: utf-8 -*-
  2. # @Author : YY
  3. from typing import List, Optional
  4. from ruoyi_system.domain.entity import SysOperLog
  5. from ruoyi_system.mapper import SysOperLogMapper
  6. class SysOperLogService:
  7. @classmethod
  8. def insert_operlog(cls, body: SysOperLog) -> int:
  9. '''
  10. 新增操作日志
  11. Args:
  12. body (SysOperLog): 操作日志对象
  13. Returns:
  14. int: 操作日志id
  15. '''
  16. return SysOperLogMapper.insert_operlog(body)
  17. @classmethod
  18. def select_operlog_list(cls, query: Optional[SysOperLog])-> List[SysOperLog]:
  19. '''
  20. 查询系统操作日志列表
  21. Args:
  22. query (SysOperLog|NoneType): 包含查询条件的传输对象
  23. Returns:
  24. List[SysOperLog]: 操作日志列表
  25. '''
  26. return SysOperLogMapper.select_operlog_list(query)
  27. @classmethod
  28. def delete_operlog_by_ids(cls, ids: list[int]) -> int:
  29. '''
  30. 批量删除系统操作日志
  31. Args:
  32. ids (list[int]): 操作日志id列表
  33. Returns:
  34. int: 删除的行数
  35. '''
  36. return SysOperLogMapper.delete_operlog_by_ids(ids)
  37. @classmethod
  38. def clean_operlog(cls) -> int:
  39. '''
  40. 清空操作日志
  41. Returns:
  42. int: 清空的行数
  43. '''
  44. return SysOperLogMapper.clean_operlog()
  45. @classmethod
  46. def select_operlog_by_id(cls, id:int) -> Optional[SysOperLog]:
  47. '''
  48. 查询操作日志详细信息
  49. Args:
  50. id (int): 操作日志id
  51. Returns:
  52. Optional[SysOperLog]: 操作日志信息
  53. '''
  54. return SysOperLogMapper.select_operlog_by_id(id)