(ctx context.Context, serviceId string, id string)
| 119 | } |
| 120 | |
| 121 | func (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 | |
| 133 | func (i *imlStrategyModule) ToPublish(ctx context.Context, driver string) ([]*strategy_dto.ToPublishItem, error) { |
| 134 | scope := strategy_dto.ToScope(strategy_dto.ScopeGlobal) |
nothing calls this directly
no test coverage detected