dao.go 488 B

1234567891011121314151617181920212223242526
  1. package util
  2. import (
  3. "time"
  4. "go-common/library/queue/databus/report"
  5. )
  6. //AddLogs add action logs
  7. func AddLogs(logtype int, uname string, uid int64, oid int64, action string, obj interface{}) (err error) {
  8. report.Manager(&report.ManagerInfo{
  9. Uname: uname,
  10. UID: uid,
  11. Business: 1,
  12. Type: logtype,
  13. Oid: oid,
  14. Action: action,
  15. Ctime: time.Now(),
  16. // extra
  17. Index: []interface{}{},
  18. Content: map[string]interface{}{
  19. "json": obj,
  20. },
  21. })
  22. return
  23. }