Search in sources :

Example 6 with ReadContext

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

the class VisitExtensionCtl method visit.

@RequestMapping(value = "/{group}/{name:.+}", method = RequestMethod.GET)
public ResponseEntity<VisitExtensionApi.Receipt> visit(@RequestHeader(value = ErestHeaders.REQUEST_ID, required = false) String requestId, @RequestHeader(ErestHeaders.VISITOR_ID) String visitorId, @PathVariable(OWNER_ID) String ownerId, @PathVariable("group") String group, @PathVariable("name") String name) {
    ReadContext context = buildContext(requestId, visitorId, ownerId);
    VisitExtensionApi.Form form = new VisitExtensionApi.Form();
    form.setGroup(group);
    form.setName(name);
    return VisitApiCaller.sync(api, context, form);
}
Also used : VisitExtensionApi(one.kii.kiimate.model.core.api.VisitExtensionApi) ReadContext(one.kii.summer.io.context.ReadContext)

Example 7 with ReadContext

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

the class VisitModelCtl method exploreModels.

@RequestMapping(value = "/{" + PUB_SET + ":.+}")
public ResponseEntity<VisitModelApi.Model> exploreModels(@RequestHeader(value = ErestHeaders.REQUEST_ID, required = false) String requestId, @RequestHeader(ErestHeaders.VISITOR_ID) String visitorId, @PathVariable(PUB_SET) Long pubSet) {
    ReadContext context = buildContext(requestId, null, visitorId);
    VisitModelApi.VisitModelForm form = new VisitModelApi.VisitModelForm();
    form.setPubSet(pubSet);
    return VisitApiCaller.sync(api, context, form);
}
Also used : ReadContext(one.kii.summer.io.context.ReadContext) VisitModelApi(one.kii.kiimate.model.core.api.VisitModelApi)

Example 8 with ReadContext

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

the class SearchStatusesCtl method exploreModels.

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<List<SearchStatusesApi.Statuses>> exploreModels(@RequestHeader(value = ErestHeaders.REQUEST_ID, required = false) String requestId, @RequestHeader(ErestHeaders.VISITOR_ID) String visitorId, @RequestParam("q") String query, @RequestParam("ownerId") String ownerId) {
    ReadContext context = buildContext(requestId, ownerId, visitorId);
    SearchStatusesApi.QueryForm form = new SearchStatusesApi.QueryForm();
    form.setQuery(query);
    List<SearchStatusesApi.Statuses> models = api.search(context, form);
    return ErestResponse.ok(requestId, models);
}
Also used : ReadContext(one.kii.summer.io.context.ReadContext) SearchStatusesApi(one.kii.kiimate.status.core.api.SearchStatusesApi)

Example 9 with ReadContext

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

the class VisitAssetCtl method visit.

@RequestMapping(value = "/{" + GROUP + "}/{" + NAME + "}/{" + STABILITY + "}/{" + VERSION + ":.+}")
public ResponseEntity<VisitFatAssetApi.Asset> visit(@RequestHeader(value = ErestHeaders.REQUEST_ID, required = false) String requestId, @RequestHeader(ErestHeaders.VISITOR_ID) String visitorId, @PathVariable(OWNER_ID) String ownerId, @PathVariable(GROUP) String group, @PathVariable(NAME) String name, @PathVariable(STABILITY) String stability, @PathVariable(VERSION) String version) {
    ReadContext context = buildContext(requestId, ownerId, visitorId);
    VisitFatAssetApi.GroupNameForm form = new VisitFatAssetApi.GroupNameForm();
    form.setGroup(group);
    form.setName(name);
    if (null != stability) {
        form.setStability(stability);
    }
    if (null != version) {
        form.setVersion(version);
    }
    return VisitApiCaller.sync(api, context, form);
}
Also used : ReadContext(one.kii.summer.io.context.ReadContext) VisitFatAssetApi(one.kii.kiimate.status.core.api.VisitFatAssetApi)

Example 10 with ReadContext

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

the class VisitStatusCtl method visit.

@RequestMapping(value = "/{" + SUB_ID + "}")
public ResponseEntity<?> visit(@RequestHeader(value = ErestHeaders.REQUEST_ID, required = false) String requestId, @RequestHeader(ErestHeaders.VISITOR_ID) String visitorId, @PathVariable(OWNER_ID) String ownerId, @PathVariable(SUB_ID) String subId) {
    ReadContext context = buildContext(requestId, ownerId, visitorId);
    VisitFatStatusApi.StatusIdForm form = new VisitFatStatusApi.StatusIdForm();
    form.setId(subId);
    return VisitApiCaller.sync(fatStatusApi, context, form);
}
Also used : VisitFatStatusApi(one.kii.kiimate.status.core.api.VisitFatStatusApi) ReadContext(one.kii.summer.io.context.ReadContext)

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