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

Method RevokeApply

module/subscribe/iml.go:198–214  ·  view source on GitHub ↗
(ctx context.Context, app string, uuid string)

Source from the content-addressed store, hash-verified

196}
197
198func (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
216func (i *imlSubscribeModule) AddSubscriber(ctx context.Context, serviceId string, input *subscribe_dto.AddSubscriber) error {
217 _, err := i.serviceService.Get(ctx, serviceId)

Callers

nothing calls this directly

Calls 2

GetMethod · 0.65
SaveMethod · 0.65

Tested by

no test coverage detected