package inference import ( "context" "errors" "github.com/zeromicro/go-zero/core/logx" "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc" "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types" ) type StartDeployInstanceListLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewStartDeployInstanceListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StartDeployInstanceListLogic { return &StartDeployInstanceListLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *StartDeployInstanceListLogic) StartDeployInstanceList(req *types.StartDeployInstanceReq) (resp *types.StartDeployInstanceResp, err error) { resp = &types.StartDeployInstanceResp{} success := l.svcCtx.Scheduler.AiService.InferenceAdapterMap[req.AdapterId][req.ClusterId].StartInferDeployInstance(l.ctx, req.InstanceId) if !success { return nil, errors.New("start instance failed") } return resp, nil }