admin_logs.gen.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Code generated by gorm.io/gen. DO NOT EDIT.
  2. // Code generated by gorm.io/gen. DO NOT EDIT.
  3. // Code generated by gorm.io/gen. DO NOT EDIT.
  4. package model
  5. import (
  6. "time"
  7. )
  8. const TableNameAdminLog = "admin_logs"
  9. // AdminLog mapped from table <admin_logs>
  10. type AdminLog struct {
  11. ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true" json:"id"`
  12. Environment string `gorm:"column:environment;type:varchar(64);not null;index:environment,priority:1" json:"environment"` // 所在环境
  13. AdminID int64 `gorm:"column:admin_id;type:bigint(20);index:admin_id,priority:1" json:"admin_id"` // 管理员ID
  14. AppID string `gorm:"column:app_id;type:varchar(128);index:app_id,priority:1" json:"app_id"` // 所属应用
  15. UserAgent string `gorm:"column:user_agent;type:varchar(512);not null" json:"user_agent"` // 访问代理
  16. Method string `gorm:"column:method;type:varchar(64);not null" json:"method"` // 请求方式
  17. URL string `gorm:"column:url;type:text;not null" json:"url"` // 访问地址
  18. Host string `gorm:"column:host;type:text;not null" json:"host"` // 服务域
  19. Path string `gorm:"column:path;type:text;not null" json:"path"` // 访问路径
  20. GetData string `gorm:"column:get_data;type:json" json:"get_data"`
  21. PostData string `gorm:"column:post_data;type:mediumtext" json:"post_data"`
  22. HeaderData string `gorm:"column:header_data;type:json" json:"header_data"`
  23. AccessIP string `gorm:"column:access_ip;type:varchar(20);not null" json:"access_ip"` // 访问IP
  24. StatusCode int32 `gorm:"column:status_code;type:int(11);not null" json:"status_code"` // 响应状态码
  25. ErrorMessage string `gorm:"column:error_message;type:varchar(255)" json:"error_message"` // 错误消息
  26. Data string `gorm:"column:data;type:mediumtext;not null" json:"data"` // 响应数据
  27. Latency int32 `gorm:"column:latency;type:int(11)" json:"latency"` // 耗时
  28. Timestamp time.Time `gorm:"column:timestamp;type:datetime;not null" json:"timestamp"` // 请求时间
  29. CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null" json:"created_at"` // 创建时间
  30. Name string `gorm:"column:name;type:varchar(255)" json:"name"`
  31. Remark string `gorm:"column:remark;type:text" json:"remark"`
  32. }
  33. // TableName AdminLog's table name
  34. func (*AdminLog) TableName() string {
  35. return TableNameAdminLog
  36. }