dao.go 708 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/interface/main/ugcpay/conf"
  5. archive "go-common/app/service/main/archive/api"
  6. ugcpay "go-common/app/service/main/ugcpay/api/grpc/v1"
  7. )
  8. // Dao dao
  9. type Dao struct {
  10. c *conf.Config
  11. ugcpayAPI ugcpay.UGCPayClient
  12. archiveAPI archive.ArchiveClient
  13. }
  14. // New init mysql db
  15. func New(c *conf.Config) (dao *Dao) {
  16. dao = &Dao{
  17. c: c,
  18. }
  19. var err error
  20. if dao.ugcpayAPI, err = ugcpay.NewClient(nil); err != nil {
  21. panic(err)
  22. }
  23. if dao.archiveAPI, err = archive.NewClient(nil); err != nil {
  24. panic(err)
  25. }
  26. return
  27. }
  28. // Close close the resource.
  29. func (d *Dao) Close() {
  30. }
  31. // Ping dao ping
  32. func (d *Dao) Ping(c context.Context) error {
  33. return nil
  34. }