dynamic.go 820 B

123456789101112131415161718192021222324252627282930313233
  1. package dao
  2. import (
  3. "context"
  4. "strconv"
  5. "go-common/app/job/openplatform/article/model"
  6. "go-common/library/log"
  7. )
  8. const _dynamicArt = 64
  9. // PubDynamic pub dynamic
  10. func (d *Dao) PubDynamic(c context.Context, mid int64, aid int64, show bool, comment string, ts int64, dynamicIntro string) (err error) {
  11. msg := &model.DynamicMsg{}
  12. msg.Card.Type = _dynamicArt
  13. msg.Card.Rid = aid
  14. msg.Card.OwnerID = mid
  15. if show {
  16. msg.Card.Show = 1
  17. }
  18. msg.Card.Comment = comment
  19. msg.Card.Ts = ts
  20. msg.Card.Dynamic = dynamicIntro
  21. if err = d.dynamicDbus.Send(c, strconv.FormatInt(aid, 10), msg); err != nil {
  22. PromError("dynamic:发送动态消息")
  23. log.Error("dynamic: d.SendPubDynamic(%+v) error(%+v)", msg, err)
  24. return
  25. }
  26. PromInfo("databus:发送动态消息")
  27. log.Info("dynamic: dao.PubDynamic(%+v)", msg)
  28. return
  29. }