You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

appdetaillogic.go 1.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package apps
  2. import (
  3. "context"
  4. "gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes/kubernetes"
  5. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  6. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type AppDetailLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewAppDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AppDetailLogic {
  15. return &AppDetailLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *AppDetailLogic) AppDetail(req *types.AppDetailReq) (resp *kubernetes.AppDetailResp, err error) {
  22. resp = &kubernetes.AppDetailResp{}
  23. //调用p端接口查询应用详情
  24. appDetail, err := l.svcCtx.K8sRpc.GetAppDetail(context.Background(), &kubernetes.AppDetailReq{
  25. Namespace: req.NsID,
  26. Name: req.Name,
  27. })
  28. if err != nil {
  29. logx.Errorf("调用p端接口查询应用详情失败,err:%v", err)
  30. resp.Code = "500"
  31. resp.Msg = err.Error()
  32. return resp, err
  33. }
  34. resp.Code = "200"
  35. return appDetail, err
  36. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.