123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- package service
- import (
- "context"
- "go-common/app/interface/main/mcn/model"
- "go-common/app/interface/main/mcn/model/datamodel"
- "go-common/app/interface/main/mcn/model/mcnmodel"
- "go-common/library/ecode"
- "go-common/library/log"
- )
- //GetMcnGetIndexInc .
- func (s *Service) GetMcnGetIndexInc(c context.Context, arg *mcnmodel.McnGetIndexIncReq) (res *mcnmodel.McnGetIndexIncReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetIndexIncCache(c, mcnSign.ID, datamodel.GetLastDay(), arg.Type); err != nil {
- log.Error("get data fail, err=%v", err)
- return
- }
- return
- }
- // GetMcnGetIndexSource .
- func (s *Service) GetMcnGetIndexSource(c context.Context, arg *mcnmodel.McnGetIndexSourceReq) (res *mcnmodel.McnGetIndexSourceReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetIndexSourceCache(c, mcnSign.ID, datamodel.GetLastDay(), arg.Type); err != nil {
- log.Error("get data fail, err=%v", err)
- return
- }
- return
- }
- // GetPlaySource .
- func (s *Service) GetPlaySource(c context.Context, arg *mcnmodel.McnGetPlaySourceReq) (res *mcnmodel.McnGetPlaySourceReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetPlaySourceCache(c, mcnSign.ID, datamodel.GetLastDay()); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
- // GetMcnFans .
- func (s *Service) GetMcnFans(c context.Context, arg *mcnmodel.McnGetMcnFansReq) (res *mcnmodel.McnGetMcnFansReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetMcnFansCache(c, mcnSign.ID, datamodel.GetLastDay()); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
- // GetMcnFansInc .
- func (s *Service) GetMcnFansInc(c context.Context, arg *mcnmodel.McnGetMcnFansIncReq) (res *mcnmodel.McnGetMcnFansIncReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetMcnFansIncCache(c, mcnSign.ID, datamodel.GetLastDay()); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
- // GetMcnFansDec .
- func (s *Service) GetMcnFansDec(c context.Context, arg *mcnmodel.McnGetMcnFansDecReq) (res *mcnmodel.McnGetMcnFansDecReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetMcnFansDecCache(c, mcnSign.ID, datamodel.GetLastDay()); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
- // GetMcnFansAttentionWay .
- func (s *Service) GetMcnFansAttentionWay(c context.Context, arg *mcnmodel.McnGetMcnFansAttentionWayReq) (res *mcnmodel.McnGetMcnFansAttentionWayReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetMcnFansAttentionWayCache(c, mcnSign.ID, datamodel.GetLastDay()); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
- // GetBaseFansAttrReq .
- func (s *Service) GetBaseFansAttrReq(c context.Context, arg *mcnmodel.McnGetBaseFansAttrReq) (res *mcnmodel.McnGetBaseFansAttrReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetFansBaseFansAttrCache(c, mcnSign.ID, datamodel.GetLastWeek(), arg.UserType); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
- // GetFansArea .
- func (s *Service) GetFansArea(c context.Context, arg *mcnmodel.McnGetFansAreaReq) (res *mcnmodel.McnGetFansAreaReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetFansAreaCache(c, mcnSign.ID, datamodel.GetLastWeek(), arg.UserType); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
- // GetFansType .
- func (s *Service) GetFansType(c context.Context, arg *mcnmodel.McnGetFansTypeReq) (res *mcnmodel.McnGetFansTypeReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetFansTypeCache(c, mcnSign.ID, datamodel.GetLastWeek(), arg.UserType); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
- // GetFansTag .
- func (s *Service) GetFansTag(c context.Context, arg *mcnmodel.McnGetFansTagReq) (res *mcnmodel.McnGetFansTagReply, err error) {
- mcnSign, err := s.getMcnWithState(c, arg.McnMid, model.MCNSignStateOnSign)
- if err != nil {
- if err != ecode.NothingFound {
- log.Error("error get state, err=%s", err)
- }
- return
- }
- if res, err = s.datadao.GetFansTagCache(c, mcnSign.ID, datamodel.GetLastWeek(), arg.UserType); err != nil {
- log.Error("get data fail, err=%v", err)
- }
- return
- }
|