dao.go 584 B

1234567891011121314151617181920212223242526272829303132
  1. package resource
  2. import (
  3. "context"
  4. "go-common/app/interface/main/app-player/conf"
  5. resrpc "go-common/app/service/main/resource/rpc/client"
  6. "go-common/library/log"
  7. )
  8. type Dao struct {
  9. c *conf.Config
  10. // rpc
  11. resRPC *resrpc.Service
  12. }
  13. func New(c *conf.Config) (d *Dao) {
  14. d = &Dao{
  15. c: c,
  16. // rpc
  17. resRPC: resrpc.New(c.ResourceRPC),
  18. }
  19. return
  20. }
  21. // PasterCID get all paster cid.
  22. func (d *Dao) PasterCID(c context.Context) (cids map[int64]int64, err error) {
  23. if cids, err = d.resRPC.PasterCID(c); err != nil {
  24. log.Error("d.resRPC.PasterCID() error(%v)", err)
  25. }
  26. return
  27. }