sys_operation_record.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package system
  2. import (
  3. "server/dao"
  4. "server/model/common/request"
  5. systemReq "server/model/system/request"
  6. )
  7. //@author: [granty1](https://github.com/granty1)
  8. //@function: CreateSysOperationRecord
  9. //@description: 创建记录
  10. //@param: sysOperationRecord model.SysOperationRecord
  11. //@return: err error
  12. type OperationRecordService struct{}
  13. func (operationRecordService *OperationRecordService) CreateSysOperationRecord(sysOperationRecord dao.SysOperationRecord) (err error) {
  14. return sysOperationRecord.CreateSysOperationRecord()
  15. }
  16. //@author: [granty1](https://github.com/granty1)
  17. //@author: [piexlmax](https://github.com/piexlmax)
  18. //@function: DeleteSysOperationRecordByIds
  19. //@description: 批量删除记录
  20. //@param: ids request.IdsReq
  21. //@return: err error
  22. func (operationRecordService *OperationRecordService) DeleteSysOperationRecordByIds(ids request.IdsReq) error {
  23. return dao.DeleteSysOperationRecordByIds(ids.Ids)
  24. }
  25. //@author: [granty1](https://github.com/granty1)
  26. //@function: DeleteSysOperationRecord
  27. //@description: 删除操作记录
  28. //@param: sysOperationRecord model.SysOperationRecord
  29. //@return: err error
  30. func (operationRecordService *OperationRecordService) DeleteSysOperationRecord(sysOperationRecord dao.SysOperationRecord) error {
  31. return sysOperationRecord.DeleteSysOperationRecord()
  32. }
  33. //@author: [granty1](https://github.com/granty1)
  34. //@function: DeleteSysOperationRecord
  35. //@description: 根据id获取单条操作记录
  36. //@param: id uint
  37. //@return: sysOperationRecord system.SysOperationRecord, err error
  38. func (operationRecordService *OperationRecordService) GetSysOperationRecord(id uint) (dao.SysOperationRecord, error) {
  39. return dao.GetSysOperationRecord(id)
  40. }
  41. //@author: [granty1](https://github.com/granty1)
  42. //@author: [piexlmax](https://github.com/piexlmax)
  43. //@function: GetSysOperationRecordInfoList
  44. //@description: 分页获取操作记录列表
  45. //@param: info systemReq.SysOperationRecordSearch
  46. //@return: list interface{}, total int64, err error
  47. func (operationRecordService *OperationRecordService) GetSysOperationRecordInfoList(info systemReq.SysOperationRecordSearch) (list interface{}, total int64, err error) {
  48. limit := info.PageSize
  49. offset := info.PageSize * (info.Page - 1)
  50. return info.SysOperationRecord.GetSysOperationRecordInfoList(limit, offset)
  51. }