subject.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package service
  2. import (
  3. "context"
  4. "encoding/json"
  5. actmdl "go-common/app/interface/main/activity/model/like"
  6. l "go-common/app/job/main/activity/model/like"
  7. "go-common/library/log"
  8. )
  9. // upSubject update act_subject cache .
  10. func (s *Service) upSubject(c context.Context, upMsg json.RawMessage) (err error) {
  11. var (
  12. subObj = new(l.ActSubject)
  13. )
  14. if err = json.Unmarshal(upMsg, subObj); err != nil {
  15. log.Error("upSubject json.Unmarshal(%s) error(%+v)", upMsg, err)
  16. return
  17. }
  18. if err = s.actRPC.SubjectUp(c, &actmdl.ArgSubjectUp{Sid: subObj.ID}); err != nil {
  19. log.Error("s.actRPC.SubjectUp(%d) error(%+v)", subObj.ID, err)
  20. return
  21. }
  22. log.Info("upSubject success s.actRPC.SubjectUp(%d)", subObj.ID)
  23. return
  24. }
  25. //func (s *Service) addElemeLottery(c context.Context, msg json.RawMessage) {
  26. // var (
  27. // vipContent = &l.VipActOrder{}
  28. // )
  29. // if err := json.Unmarshal(msg, vipContent); err != nil {
  30. // log.Error("addElemeLottery json.Unmarshal(%s) error(%v)", msg, err)
  31. // return
  32. // }
  33. // if vipContent.PanelType == "ele" {
  34. // if err := s.dao.AddLotteryTimes(c, s.c.Rule.EleLotteryID, vipContent.Mid); err != nil {
  35. // log.Error("s.dao.AddLotteryTimes(%d,%d) error(%v)", s.c.Rule.EleLotteryID, vipContent.Mid, err)
  36. // return
  37. // }
  38. // log.Info("addElemeLottery has AddLotteryTimes %d", vipContent.Mid)
  39. // }
  40. // log.Info("addElemeLottery success id:%d,panee:%s", vipContent.ID, vipContent.PanelType)
  41. //}