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.

deleteclusterlogic.go 935 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package cloud
  2. import (
  3. "context"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types"
  6. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type DeleteClusterLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewDeleteClusterLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteClusterLogic {
  15. return &DeleteClusterLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *DeleteClusterLogic) DeleteCluster(req *types.DeleteClusterReq) (*types.CloudResp, error) {
  22. // 删除集群信息
  23. var resp types.CloudResp
  24. tx := l.svcCtx.DbEngin.Where("name = ?", req.Name).Delete(&models.ScParticipantPhyInfo{})
  25. if tx.Error != nil {
  26. return nil, tx.Error
  27. }
  28. resp.Code = string(200)
  29. resp.Msg = "success"
  30. resp.Data = ""
  31. return &resp, nil
  32. }

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.