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

Method Search

module/team/iml.go:71–90  ·  view source on GitHub ↗
(ctx context.Context, keyword string)

Source from the content-addressed store, hash-verified

69}
70
71func (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
92func (m *imlTeamModule) Create(ctx context.Context, input *team_dto.CreateTeam) (*team_dto.Team, error) {
93 if input.Id == "" {

Callers

nothing calls this directly

Calls 3

SearchMethod · 0.65
ServiceCountByTeamMethod · 0.65
AppCountByTeamMethod · 0.65

Tested by

no test coverage detected