|
123456789101112131415161718192021222324252627282930313233 |
- package cloud
-
- import (
- "context"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/models"
-
- "github.com/zeromicro/go-zero/core/logx"
- )
-
- type DeleteClusterLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
-
- func NewDeleteClusterLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteClusterLogic {
- return &DeleteClusterLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
-
- func (l *DeleteClusterLogic) DeleteCluster(req *types.DeleteClusterReq) (resp *types.CloudResp, err error) {
- // 删除集群信息
- tx := l.svcCtx.DbEngin.Where("name = ?", req.Name).Delete(&models.ScParticipantPhyInfo{})
- if tx.Error != nil {
- return nil, tx.Error
- }
- return
- }
|