databus.go 549 B

12345678910111213141516171819202122232425
  1. package dao
  2. import (
  3. "context"
  4. "strconv"
  5. "go-common/app/job/main/member/model"
  6. )
  7. // DatabusAddLog add exp log messager to databus
  8. func (d *Dao) DatabusAddLog(c context.Context, mid, exp, toExp, ts int64, oper, reason, ip string) (err error) {
  9. log := &model.UserLog{
  10. Mid: mid,
  11. TS: ts,
  12. IP: ip,
  13. Content: map[string]string{
  14. "from_exp": strconv.FormatInt(exp, 10),
  15. "to_exp": strconv.FormatInt(toExp, 10),
  16. "operater": oper,
  17. "reason": reason,
  18. },
  19. }
  20. err = d.plogDatabus.Send(c, strconv.FormatInt(mid, 10), log)
  21. return
  22. }