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

Method Reject

module/subscribe/iml.go:464–484  ·  view source on GitHub ↗
(ctx context.Context, pid string, id string, approveInfo *subscribe_dto.Approve)

Source from the content-addressed store, hash-verified

462 return client.Subscribe().Online(ctx, sub)
463}
464func (i *imlSubscribeApprovalModule) Reject(ctx context.Context, pid string, id string, approveInfo *subscribe_dto.Approve) error {
465 _, err := i.subscribeApplyService.Get(ctx, id)
466 if err != nil {
467 return err
468 }
469
470 return i.transaction.Transaction(ctx, func(ctx context.Context) error {
471 userID := utils.UserId(ctx)
472 status := subscribe.ApplyStatusRefuse
473 err = i.subscribeApplyService.Save(ctx, id, &subscribe.EditApply{
474 Opinion: &approveInfo.Opinion,
475 Status: &status,
476 Approver: &userID,
477 })
478 if err != nil {
479 return err
480 }
481 return nil
482 //return i.subscribeService.UpdateSubscribeStatus(ctx, applyInfo.Application, applyInfo.Service, status)
483 })
484}
485
486func (i *imlSubscribeApprovalModule) GetApprovalList(ctx context.Context, pid string, status int) ([]*subscribe_dto.ApprovalItem, error) {
487 applyStatus := make([]int, 0, 2)

Callers

nothing calls this directly

Calls 2

GetMethod · 0.65
SaveMethod · 0.65

Tested by

no test coverage detected