dao.go 603 B

1234567891011121314151617181920212223242526272829303132
  1. package account
  2. import (
  3. "context"
  4. "go-common/app/admin/main/feed/conf"
  5. account "go-common/app/service/main/account/model"
  6. accrpc "go-common/app/service/main/account/rpc/client"
  7. )
  8. // Dao is account dao.
  9. type Dao struct {
  10. // rpc
  11. accRPC *accrpc.Service3
  12. }
  13. // New account dao.
  14. func New(c *conf.Config) (d *Dao) {
  15. d = &Dao{
  16. accRPC: accrpc.New3(c.AccountRPC),
  17. }
  18. return
  19. }
  20. // Card3 get card info by mid
  21. func (d *Dao) Card3(c context.Context, mid int64) (res *account.Card, err error) {
  22. arg := &account.ArgMid{Mid: mid}
  23. if res, err = d.accRPC.Card3(c, arg); err != nil {
  24. return
  25. }
  26. return
  27. }