fansMedal.go 802 B

123456789101112131415161718192021222324252627282930
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/service/live/fans_medal/api/liverpc/v1"
  5. "go-common/library/log"
  6. )
  7. //OpenFansMealLevel 开启粉丝勋章的主播等级
  8. const OpenFansMealLevel = 10
  9. //GetFansMedalInfo 获取粉丝勋章信息
  10. func (d *Dao) GetFansMedalInfo(c context.Context, uid int64) (resp *v1.MedalQueryResp_Data, err error) {
  11. reply, err := d.FansMedalApi.V1Medal.Query(c, &v1.MedalQueryReq{Uid: uid, Source: 1})
  12. if err != nil {
  13. log.Error("fansMedal_getFansMedalInfo_error:%v", err)
  14. return
  15. }
  16. if reply.Code != 0 {
  17. log.Error("fansMedal_getFansMedalInfo_error:%d,%s,%v", reply.Code, reply.Msg, reply.Data)
  18. return
  19. }
  20. log.Info("fansMedal_getFansMedalInfo:%d,%s,$v", reply.Code, reply.Msg, reply.Data)
  21. if reply.Data.IsNull {
  22. resp = nil
  23. }
  24. resp = reply.Data
  25. return
  26. }