MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / Stop

Method Stop

module/publish/iml.go:479–500  ·  view source on GitHub ↗
(ctx context.Context, serviceId string, id string)

Source from the content-addressed store, hash-verified

477}
478
479func (i *imlPublishModule) Stop(ctx context.Context, serviceId string, id string) error {
480 _, err := i.serviceService.Check(ctx, serviceId, asServer)
481 if err != nil {
482 return err
483 }
484 flow, err := i.publishService.Get(ctx, id)
485 if err != nil {
486 return err
487 }
488 if flow.Service != serviceId {
489 return errors.New("项目不一致")
490 }
491
492 if flow.Status != publish.StatusApply && flow.Status != publish.StatusAccept {
493 return errors.New("只有发布中状态才能停止")
494 }
495 status := publish.StatusStop
496 if flow.Status == publish.StatusApply {
497 status = publish.StatusClose
498 }
499 return i.publishService.SetStatus(ctx, serviceId, id, status)
500}
501
502func (i *imlPublishModule) Refuse(ctx context.Context, serviceId string, id string, commits string) error {
503 _, err := i.serviceService.Check(ctx, serviceId, asServer)

Callers

nothing calls this directly

Calls 3

CheckMethod · 0.65
GetMethod · 0.65
SetStatusMethod · 0.65

Tested by

no test coverage detected