dao.go 559 B

1234567891011121314151617181920212223242526272829303132
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/interface/main/ugcpay-rank/internal/conf"
  5. ugcpay_rank "go-common/app/service/main/ugcpay-rank/api/v1"
  6. )
  7. // Dao dao
  8. type Dao struct {
  9. ugcPayRankAPI ugcpay_rank.UGCPayRankClient
  10. }
  11. // New init mysql db
  12. func New() (dao *Dao) {
  13. dao = &Dao{}
  14. var err error
  15. if dao.ugcPayRankAPI, err = ugcpay_rank.NewClient(conf.Conf.UGCPayRankGRPC); err != nil {
  16. panic(err)
  17. }
  18. return
  19. }
  20. // Close close the resource.
  21. func (d *Dao) Close() {
  22. }
  23. // Ping dao ping
  24. func (d *Dao) Ping(ctx context.Context) error {
  25. return nil
  26. }