Search in sources :

Example 11 with ReadContext

use of one.kii.summer.io.context.ReadContext in project kiimate by SINeWang.

the class SearchSubjectsCtl method search.

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<List<SearchSubjectsApi.Subjects>> search(@RequestHeader(value = ErestHeaders.REQUEST_ID, required = false) String requestId, @RequestHeader(ErestHeaders.VISITOR_ID) String visitorId, @PathVariable(OBJECT_TYPE) String objectType, @PathVariable(ACCESS_TYPE) String accessType, @RequestParam("q") String q) {
    ReadContext context = buildContext(requestId, null, visitorId);
    SearchSubjectsApi.Form form = new SearchSubjectsApi.Form();
    form.setGroup(q);
    form.setAccessType(SearchSubjectsApi.AccessType.valueOf(accessType.toUpperCase()));
    form.setObjectType(SearchSubjectsApi.ObjectType.valueOf(objectType.toUpperCase()));
    return ErestResponse.ok(requestId, api.search(context, form));
}
Also used : ReadContext(one.kii.summer.io.context.ReadContext) SearchSubjectsApi(one.kii.kiimate.subject.core.api.SearchSubjectsApi)

Aggregations

ReadContext (one.kii.summer.io.context.ReadContext)11 BadRequest (one.kii.summer.io.exception.BadRequest)2 Panic (one.kii.summer.io.exception.Panic)2 SearchExtensionsApi (one.kii.kiimate.model.core.api.SearchExtensionsApi)1 SearchModelsApi (one.kii.kiimate.model.core.api.SearchModelsApi)1 SearchSubscriptionsApi (one.kii.kiimate.model.core.api.SearchSubscriptionsApi)1 VisitExtensionApi (one.kii.kiimate.model.core.api.VisitExtensionApi)1 VisitIntensionsApi (one.kii.kiimate.model.core.api.VisitIntensionsApi)1 VisitModelApi (one.kii.kiimate.model.core.api.VisitModelApi)1 SearchStatusesApi (one.kii.kiimate.status.core.api.SearchStatusesApi)1 VisitFatAssetApi (one.kii.kiimate.status.core.api.VisitFatAssetApi)1 VisitFatStatusApi (one.kii.kiimate.status.core.api.VisitFatStatusApi)1 VisitRawAssetApi (one.kii.kiimate.status.core.api.VisitRawAssetApi)1 SearchSubjectsApi (one.kii.kiimate.subject.core.api.SearchSubjectsApi)1 NotFound (one.kii.summer.io.exception.NotFound)1 DumperOptions (org.yaml.snakeyaml.DumperOptions)1 Yaml (org.yaml.snakeyaml.Yaml)1