| 68 | } |
| 69 | |
| 70 | func (i *imlStrategyService) CommitStrategy(ctx context.Context, scope string, target string, strategyId string, data *Strategy) error { |
| 71 | key := scope |
| 72 | if target != "" { |
| 73 | key = fmt.Sprintf("%s-%s", scope, target) |
| 74 | } |
| 75 | |
| 76 | return i.commitService.Save(ctx, strategyId, key, &Commit{ |
| 77 | Id: data.Id, |
| 78 | Name: data.Name, |
| 79 | Priority: data.Priority, |
| 80 | Filters: data.Filters, |
| 81 | Config: data.Config, |
| 82 | Driver: data.Driver, |
| 83 | IsDelete: data.IsDelete, |
| 84 | IsStop: data.IsStop, |
| 85 | Version: data.UpdateAt.Format("20060102150405"), |
| 86 | }) |
| 87 | } |
| 88 | |
| 89 | func (i *imlStrategyService) GetStrategyCommit(ctx context.Context, commitId string) (*commit.Commit[Commit], error) { |
| 90 | return i.commitService.Get(ctx, commitId) |