| 196 | } |
| 197 | |
| 198 | func (i *imlSubscribeModule) RevokeApply(ctx context.Context, app string, uuid string) error { |
| 199 | _, err := i.serviceService.Get(ctx, app) |
| 200 | if err != nil { |
| 201 | return fmt.Errorf("get app error: %w", err) |
| 202 | } |
| 203 | subscription, err := i.subscribeService.Get(ctx, uuid) |
| 204 | if err != nil { |
| 205 | return err |
| 206 | } |
| 207 | if subscription.ApplyStatus != subscribe.ApplyStatusReview { |
| 208 | return fmt.Errorf("apply can not be revoked") |
| 209 | } |
| 210 | applyStatus := subscribe.ApplyStatusCancel |
| 211 | return i.subscribeService.Save(ctx, uuid, &subscribe.UpdateSubscribe{ |
| 212 | ApplyStatus: &applyStatus, |
| 213 | }) |
| 214 | } |
| 215 | |
| 216 | func (i *imlSubscribeModule) AddSubscriber(ctx context.Context, serviceId string, input *subscribe_dto.AddSubscriber) error { |
| 217 | _, err := i.serviceService.Get(ctx, serviceId) |