(ctx context.Context, pid string, status int)
| 484 | } |
| 485 | |
| 486 | func (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 | |
| 515 | func (i *imlSubscribeApprovalModule) GetApprovalDetail(ctx context.Context, pid string, id string) (*subscribe_dto.Approval, error) { |
| 516 | _, err := i.projectService.Get(ctx, pid) |
nothing calls this directly
no test coverage detected