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

Method DeleteServiceStrategy

module/strategy/iml.go:121–131  ·  view source on GitHub ↗
(ctx context.Context, serviceId string, id string)

Source from the content-addressed store, hash-verified

119}
120
121func (i *imlStrategyModule) DeleteServiceStrategy(ctx context.Context, serviceId string, id string) error {
122 _, err := i.strategyService.LatestStrategyCommit(ctx, strategy_dto.ScopeService, serviceId, id)
123 if err != nil {
124 // 判断是否已经发布,如果未发布则直接删除
125 if !errors.Is(err, gorm.ErrRecordNotFound) {
126 return err
127 }
128 return i.strategyService.Delete(ctx, id)
129 }
130 return i.strategyService.SortDelete(ctx, id)
131}
132
133func (i *imlStrategyModule) ToPublish(ctx context.Context, driver string) ([]*strategy_dto.ToPublishItem, error) {
134 scope := strategy_dto.ToScope(strategy_dto.ScopeGlobal)

Callers

nothing calls this directly

Calls 3

LatestStrategyCommitMethod · 0.65
DeleteMethod · 0.65
SortDeleteMethod · 0.65

Tested by

no test coverage detected