dao.go 395 B

123456789101112131415161718192021222324
  1. package coin
  2. import (
  3. "go-common/app/interface/main/creative/conf"
  4. coinclient "go-common/app/service/main/coin/api"
  5. )
  6. // Dao str
  7. type Dao struct {
  8. c *conf.Config
  9. coinClient coinclient.CoinClient
  10. }
  11. // New fn
  12. func New(c *conf.Config) (d *Dao) {
  13. d = &Dao{
  14. c: c,
  15. }
  16. var err error
  17. if d.coinClient, err = coinclient.NewClient(c.CoinClient); err != nil {
  18. panic(err)
  19. }
  20. return
  21. }