resource.go 781 B

1234567891011121314151617181920212223242526272829303132
  1. package dao
  2. import (
  3. "context"
  4. "encoding/json"
  5. "go-common/app/service/live/resource/api/grpc/v1"
  6. "go-common/library/log"
  7. )
  8. //TitansTeam 话题team值
  9. const TitansTeam = 40
  10. //TitansKeyword 话题标签值
  11. const TitansKeyword = "topic"
  12. //GetTopicList 获取话题列表
  13. func (d *Dao) GetTopicList(c context.Context) (resp []string, err error) {
  14. reply, err := d.titansCli.GetConfigByKeyword(c, &v1.GetConfigReq{Team: TitansTeam, Keyword: TitansKeyword})
  15. if err != nil {
  16. log.Error("main_member_GetIdentityStatus_error:%v", err)
  17. return
  18. }
  19. log.Info("main_member_GetIdentityStatus:%v", reply)
  20. resp = make([]string, 0)
  21. e := json.Unmarshal([]byte(reply.Value), &resp)
  22. if e != nil {
  23. log.Error("GetTopicList_json_error:%v,res=%v,", e, reply.Value)
  24. return
  25. }
  26. return
  27. }