sys_oper_log.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * @desc:操作日志模型对象
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu<yxh669@qq.com>
  5. * @Date: 2022/9/21 16:34
  6. */
  7. package model
  8. import (
  9. "github.com/gogf/gf/v2/frame/g"
  10. "github.com/gogf/gf/v2/os/gtime"
  11. "github.com/gogf/gf/v2/util/gmeta"
  12. "net/url"
  13. )
  14. // SysOperLogAdd 添加操作日志参数
  15. type SysOperLogAdd struct {
  16. User *ContextUser
  17. Menu *SysAuthRuleInfoRes
  18. Url *url.URL
  19. Params g.Map
  20. Method string
  21. ClientIp string
  22. OperatorType int
  23. }
  24. // SysOperLogInfoRes is the golang structure for table sys_oper_log.
  25. type SysOperLogInfoRes struct {
  26. gmeta.Meta `orm:"table:sys_oper_log"`
  27. OperId uint64 `orm:"oper_id,primary" json:"operId"` // 日志编号
  28. Title string `orm:"title" json:"title"` // 系统模块
  29. BusinessType int `orm:"business_type" json:"businessType"` // 操作类型
  30. Method string `orm:"method" json:"method"` // 操作方法
  31. RequestMethod string `orm:"request_method" json:"requestMethod"` // 请求方式
  32. OperatorType int `orm:"operator_type" json:"operatorType"` // 操作类别
  33. OperName string `orm:"oper_name" json:"operName"` // 操作人员
  34. DeptName string `orm:"dept_name" json:"deptName"` // 部门名称
  35. LinkedDeptName *LinkedSysOperLogSysDept `orm:"with:dept_id=dept_name" json:"linkedDeptName"`
  36. OperUrl string `orm:"oper_url" json:"operUrl"` // 请求URL
  37. OperIp string `orm:"oper_ip" json:"operIp"` // 主机地址
  38. OperLocation string `orm:"oper_location" json:"operLocation"` // 操作地点
  39. OperParam string `orm:"oper_param" json:"operParam"` // 请求参数
  40. ErrorMsg string `orm:"error_msg" json:"errorMsg"` // 错误消息
  41. OperTime *gtime.Time `orm:"oper_time" json:"operTime"` // 操作时间
  42. }
  43. type LinkedSysOperLogSysDept struct {
  44. gmeta.Meta `orm:"table:sys_dept"`
  45. DeptId int64 `orm:"dept_id" json:"deptId"` // 部门id
  46. DeptName string `orm:"dept_name" json:"deptName"` // 部门名称
  47. }
  48. type SysOperLogListRes struct {
  49. OperId uint64 `json:"operId"`
  50. Title string `json:"title"`
  51. RequestMethod string `json:"requestMethod"`
  52. OperName string `json:"operName"`
  53. DeptName string `json:"deptName"`
  54. LinkedDeptName *LinkedSysOperLogSysDept `orm:"with:dept_id=dept_name" json:"linkedDeptName"`
  55. OperUrl string `json:"operUrl"`
  56. OperIp string `json:"operIp"`
  57. OperLocation string `json:"operLocation"`
  58. OperParam string `json:"operParam"`
  59. OperTime *gtime.Time `json:"operTime"`
  60. }