coin.go 611 B

12345678910111213141516171819202122
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/interface/openplatform/article/dao"
  5. coin "go-common/app/service/main/coin/model"
  6. "go-common/library/log"
  7. )
  8. // Coin get user coin number
  9. func (s *Service) Coin(c context.Context, mid, aid int64, ip string) (res int64, err error) {
  10. var coins *coin.ArchiveUserCoins
  11. arg := coin.ArgCoinInfo{Mid: mid, Aid: aid, RealIP: ip, AvType: 2}
  12. if coins, err = s.coinRPC.ArchiveUserCoins(c, &arg); err != nil {
  13. dao.PromError("coin:获取投币数量")
  14. log.Error("s.coinRPC.ArchiveUserCoins(%+v) error(%+v)", arg, err)
  15. return
  16. }
  17. res = coins.Multiply
  18. return
  19. }