cluster.go 612 B

12345678910111213141516171819202122232425262728
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/admin/ep/melloi/model"
  5. "go-common/library/ecode"
  6. )
  7. //RmToken Get PaaS token
  8. func (s *Service) RmToken(c context.Context) (token string, err error) {
  9. return s.dao.RmToken(c)
  10. }
  11. //ClusterInfo get melloi server use
  12. func (s *Service) ClusterInfo(c context.Context) (firstRetMap []*model.ClusterResponseItemsSon, err error) {
  13. var token string
  14. if token, err = s.RmToken(c); err != nil {
  15. //err = ecode.MelloiGetTreeTokenErr
  16. return
  17. }
  18. if firstRetMap, err = s.dao.NetInfo(c, token); err != nil {
  19. err = ecode.MerlinGetUserTreeFailed
  20. return
  21. }
  22. return
  23. }