(ctx context.Context, keyword string)
| 69 | } |
| 70 | |
| 71 | func (m *imlTeamModule) Search(ctx context.Context, keyword string) ([]*team_dto.Item, error) { |
| 72 | list, err := m.service.Search(ctx, keyword, nil) |
| 73 | if err != nil { |
| 74 | return nil, err |
| 75 | } |
| 76 | |
| 77 | serviceCountMap, err := m.serviceService.ServiceCountByTeam(ctx) |
| 78 | if err != nil { |
| 79 | return nil, err |
| 80 | } |
| 81 | appCountMap, err := m.serviceService.AppCountByTeam(ctx) |
| 82 | if err != nil { |
| 83 | return nil, err |
| 84 | } |
| 85 | outList := make([]*team_dto.Item, 0, len(list)) |
| 86 | for _, v := range list { |
| 87 | outList = append(outList, team_dto.ToItem(v, serviceCountMap[v.Id], appCountMap[v.Id])) |
| 88 | } |
| 89 | return outList, nil |
| 90 | } |
| 91 | |
| 92 | func (m *imlTeamModule) Create(ctx context.Context, input *team_dto.CreateTeam) (*team_dto.Team, error) { |
| 93 | if input.Id == "" { |
nothing calls this directly
no test coverage detected