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

Method searchMyApps

module/service/iml.go:1271–1292  ·  view source on GitHub ↗
(ctx context.Context, teamId string, keyword string)

Source from the content-addressed store, hash-verified

1269}
1270
1271func (i *imlAppModule) searchMyApps(ctx context.Context, teamId string, keyword string) ([]*service.Service, error) {
1272 userID := utils.UserId(ctx)
1273 condition := make(map[string]interface{})
1274 condition["as_app"] = true
1275 if teamId != "" {
1276 _, err := i.teamService.Get(ctx, teamId)
1277 if err != nil {
1278 return nil, err
1279 }
1280 condition["team"] = teamId
1281 return i.serviceService.Search(ctx, keyword, condition, "update_at desc")
1282 } else {
1283 membersForUser, err := i.teamMemberService.FilterMembersForUser(ctx, userID)
1284 if err != nil {
1285 return nil, err
1286 }
1287 teamIds := membersForUser[userID]
1288 condition["team"] = teamIds
1289
1290 return i.serviceService.Search(ctx, keyword, condition, "update_at desc")
1291 }
1292}
1293
1294func (i *imlAppModule) SearchMyApps(ctx context.Context, teamId string, keyword string) ([]*service_dto.AppItem, error) {
1295 services, err := i.searchMyApps(ctx, teamId, keyword)

Callers 3

SearchCanSubscribeMethod · 0.95
SearchMyAppsMethod · 0.95
MySimpleAppsMethod · 0.95

Calls 2

GetMethod · 0.65
SearchMethod · 0.65

Tested by

no test coverage detected