MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / GetApprovalList

Method GetApprovalList

module/subscribe/iml.go:486–513  ·  view source on GitHub ↗
(ctx context.Context, pid string, status int)

Source from the content-addressed store, hash-verified

484}
485
486func (i *imlSubscribeApprovalModule) GetApprovalList(ctx context.Context, pid string, status int) ([]*subscribe_dto.ApprovalItem, error) {
487 applyStatus := make([]int, 0, 2)
488 if status == 0 {
489 // 获取待审核列表
490 applyStatus = append(applyStatus, subscribe.ApplyStatusReview)
491 } else {
492 // 获取已审核列表
493 applyStatus = append(applyStatus, subscribe.ApplyStatusRefuse, subscribe.ApplyStatusSubscribe)
494 }
495 items, err := i.subscribeApplyService.ListByStatus(ctx, pid, applyStatus...)
496 if err != nil {
497 return nil, err
498 }
499 return utils.SliceToSlice(items, func(s *subscribe.Apply) *subscribe_dto.ApprovalItem {
500 return &subscribe_dto.ApprovalItem{
501 Id: s.Id,
502 Service: auto.UUID(s.Service),
503 Team: auto.UUID(s.Team),
504 Application: auto.UUID(s.Application),
505 ApplyTeam: auto.UUID(s.ApplyTeam),
506 ApplyTime: auto.TimeLabel(s.ApplyAt),
507 Applier: auto.UUID(s.Applier),
508 Approver: auto.UUID(s.Approver),
509 ApprovalTime: auto.TimeLabel(s.ApproveAt),
510 Status: s.Status,
511 }
512 }), nil
513}
514
515func (i *imlSubscribeApprovalModule) GetApprovalDetail(ctx context.Context, pid string, id string) (*subscribe_dto.Approval, error) {
516 _, err := i.projectService.Get(ctx, pid)

Callers

nothing calls this directly

Calls 1

ListByStatusMethod · 0.65

Tested by

no test coverage detected