service.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package usersuit
  2. import (
  3. "context"
  4. "go-common/app/interface/main/account/conf"
  5. "go-common/app/interface/main/account/dao/usersuit"
  6. "go-common/app/interface/main/account/dao/vip"
  7. accrpc "go-common/app/service/main/account/rpc/client"
  8. coinrpc "go-common/app/service/main/coin/api/gorpc"
  9. memrpc "go-common/app/service/main/member/api/gorpc"
  10. usrpc "go-common/app/service/main/usersuit/rpc/client"
  11. )
  12. // Service struct.
  13. type Service struct {
  14. c *conf.Config
  15. dao *usersuit.Dao
  16. vipDao *vip.Dao
  17. usRPC *usrpc.Service2
  18. accRPC *accrpc.Service3
  19. coinRPC *coinrpc.Service
  20. memRPC *memrpc.Service
  21. }
  22. // New a pendant service
  23. func New(c *conf.Config) (s *Service) {
  24. s = &Service{
  25. c: c,
  26. dao: usersuit.New(c),
  27. vipDao: vip.New(c),
  28. usRPC: usrpc.New(c.RPCClient2.Usersuit),
  29. memRPC: memrpc.New(c.RPCClient2.Member),
  30. accRPC: accrpc.New3(c.RPCClient2.Account),
  31. coinRPC: coinrpc.New(c.RPCClient2.Coin),
  32. }
  33. return
  34. }
  35. // Ping check server ok.
  36. func (s *Service) Ping(c context.Context) (err error) {
  37. return
  38. }
  39. // Close dao.
  40. func (s *Service) Close() {}