javax.ws.rs.container.AsyncResponse Java Examples
The following examples show how to use
javax.ws.rs.container.AsyncResponse.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DynamicAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据工作任务列示工作动态信息,下一页.", action = ActionListNextWithTask.class) @PUT @Path("list/{id}/next/{count}/task/{taskId}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void listNextWithTask(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("最后一条信息数据的ID") @PathParam( "id" ) String id, @JaxrsParameterDescribe("每页显示的条目数量") @PathParam( "count" ) Integer count, @JaxrsParameterDescribe("工作任务ID") @PathParam( "taskId" ) String taskId, @JaxrsParameterDescribe("查询过滤条件") JsonElement jsonElement ) { ActionResult<List<ActionListNextWithTask.Wo>> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionListNextWithTask().execute(request, effectivePerson, id, count, taskId, jsonElement ); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #2
Source File: DocumentAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "分页查询符合过滤条件的已发布的信息内容.", action = ActionQueryListWithFilterPaging.class) @PUT @Path("filter/list/{page}/size/{size}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void query_listWithFilterPaging( @Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("分页") @PathParam("page") Integer page, @JaxrsParameterDescribe("数量") @PathParam("size") Integer size, JsonElement jsonElement) { EffectivePerson effectivePerson = this.effectivePerson( request ); ActionResult<List<ActionQueryListWithFilterPaging.Wo>> result = new ActionResult<>(); Boolean check = true; if( check ){ try { result = ((ActionQueryListWithFilterPaging)proxy.getProxy(ActionQueryListWithFilterPaging.class)).execute( request, page, size, jsonElement, effectivePerson ); } catch (Exception e) { result = new ActionResult<>(); result.error( e ); logger.error( e, effectivePerson, request, null); } } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #3
Source File: DocumentAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "取消文档点赞.", action = ActionPersistUnCommend.class) @GET @Path("{id}/uncommend") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void persist_unCommend( @Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("信息文档ID") @PathParam("id") String id ) { EffectivePerson effectivePerson = this.effectivePerson( request ); ActionResult<ActionPersistUnCommend.Wo> result = new ActionResult<>(); Boolean check = true; if( check ){ try { result = ((ActionPersistUnCommend)proxy.getProxy(ActionPersistUnCommend.class)).execute( request, id, effectivePerson ); } catch (Exception e) { result = new ActionResult<>(); result.error( e ); logger.error( e, effectivePerson, request, null); } } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #4
Source File: GroupAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "查询群组的直接下级群组对象.", action = ActionListWithGroupSubDirectObject.class) @POST @Path("list/group/sub/direct/object") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void listWithGroupSubDirectObject(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, JsonElement jsonElement) { ActionResult<List<ActionListWithGroupSubDirectObject.Wo>> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionListWithGroupSubDirectObject().execute(effectivePerson, jsonElement); } catch (Exception e) { logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #5
Source File: DraftAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "列示当前用户创建的草稿,分页.", action = ActionListMyPaging.class) @POST @Path("list/my/paging/{page}/size/{size}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void listMyPaging(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("分页") @PathParam("page") Integer page, @JaxrsParameterDescribe("数量") @PathParam("size") Integer size, JsonElement jsonElement) { ActionResult<List<ActionListMyPaging.Wo>> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionListMyPaging().execute(effectivePerson, page, size, jsonElement); } catch (Exception e) { logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #6
Source File: UnitAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "创建组织.", action = ActionCreate.class) @POST @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void create(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, JsonElement jsonElement) { ActionResult<ActionCreate.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionCreate().execute(effectivePerson, jsonElement); } catch (Exception e) { logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #7
Source File: CalendarAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "取消关注一个公开的日历信息", action = ActionFollowCalendarCancel.class) @GET @Path("follow/{id}/cancel") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void followCalendarCancel(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("日历信息ID") @PathParam("id") String id) { ActionResult<WrapOutBoolean> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); Boolean check = true; if (check) { try { result = ((ActionFollowCalendarCancel) proxy.getProxy(ActionFollowCalendarCancel.class)) .execute(request, effectivePerson, id); } catch (Exception e) { result = new ActionResult<>(); Exception exception = new ExceptionCalendarInfoProcess(e, "取消关注一个公开的日历信息时发生异常!"); result.error(exception); logger.error(e, effectivePerson, request, null); } } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #8
Source File: AppDictAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据字典ID和路径添加AppInfo下的新的局部数据.", action = ActionCreateDataPath3.class) @POST @Path("{appDictFlag}/appInfo/{appInfoFlag}/{path0}/{path1}/{path2}/{path3}/data") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void createDataPath3(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("数据字典标识") @PathParam("appDictFlag") String appDictFlag, @JaxrsParameterDescribe("栏目标识") @PathParam("appInfoFlag") String appInfoFlag, @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, JsonElement jsonElement) { ActionResult<WrapOutId> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionCreateDataPath3().execute(appDictFlag, appInfoFlag, path0, path1, path2, path3, jsonElement); } catch (Exception e) { logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #9
Source File: OfficeAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "转换成html.", action = ActionToHtml.class) @POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) public void input(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @FormDataParam(FILE_FIELD) final byte[] bytes, @JaxrsParameterDescribe("office文件") @FormDataParam(FILE_FIELD) final FormDataContentDisposition disposition) { ActionResult<ActionToHtml.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionToHtml().execute(effectivePerson, bytes, disposition); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #10
Source File: OkrConfigSecretaryAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据登录的用户姓名获取相应的秘书配置列表", action = ActionListMySercretary.class) @GET @Path("list/my") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void listMySercretary(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) { EffectivePerson effectivePerson = this.effectivePerson(request); ActionResult<List<ActionListMySercretary.Wo>> result = new ActionResult<>(); try { result = new ActionListMySercretary().execute(request, effectivePerson); } catch (Exception e) { result = new ActionResult<>(); logger.error(e, effectivePerson, request, null); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #11
Source File: OkrCenterWorkInfoAdminAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据ID获取中心工作数据对象", action = ActionGetAdmin.class) @GET @Path("{id}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("中心工作信息ID") @PathParam("id") String id) { EffectivePerson effectivePerson = this.effectivePerson( request ); ActionResult<ActionGetAdmin.Wo> result = new ActionResult<>(); try { result = new ActionGetAdmin().execute( request, effectivePerson, id ); } catch (Exception e) { result = new ActionResult<>(); logger.error( e, effectivePerson, request, null); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #12
Source File: DocumentVersionAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "创建版式文件版本.", action = ActionCreate.class) @POST @Path("work/{work}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void create(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("work") String work, JsonElement jsonElement) { ActionResult<ActionCreate.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionCreate().execute(effectivePerson, work, jsonElement); } catch (Exception e) { logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #13
Source File: View.java From linstor-server with GNU General Public License v3.0 | 6 votes |
@GET @Path("storage-pools") public void viewStoragePools( @Context Request request, @Suspended AsyncResponse asyncResponse, @QueryParam("nodes") List<String> nodes, @QueryParam("storage_pools") List<String> storagePools, @QueryParam("props") List<String> propFilters, @DefaultValue("0") @QueryParam("limit") int limit, @DefaultValue("0") @QueryParam("offset") int offset ) { List<String> nodesFilter = nodes != null ? nodes : Collections.emptyList(); List<String> storagePoolsFilter = storagePools != null ? storagePools : Collections.emptyList(); RequestHelper.safeAsyncResponse(asyncResponse, () -> { Flux<List<StorPoolApi>> flux = ctrlStorPoolListApiCallHandler .listStorPools(nodesFilter, storagePoolsFilter, propFilters) .subscriberContext(requestHelper.createContext(ApiConsts.API_LST_STOR_POOL, request)); requestHelper.doFlux(asyncResponse, storPoolListToResponse(flux, limit, offset)); }); }
Example #14
Source File: FormAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据工作或完成工作标识获取移动表单.", action = ActionGetWithWorkOrWorkCompletedMobile.class) @GET @Path("workorworkcompleted/{workOrWorkCompleted}/mobile") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void getWithWorkOrWorkCompletedMobile(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("工作或完成工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted) { ActionResult<JsonElement> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionGetWithWorkOrWorkCompletedMobile().execute(effectivePerson, workOrWorkCompleted); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } /* 修改过的方法 */ asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #15
Source File: ApplicationAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据应用分类获取应用,应用分类不为null.", action = ActionListWithApplicationCategory.class) @GET @Path("list/applicationcategory/{applicationCategory}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void listWithApplicationCategory(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("应用分类") @PathParam("applicationCategory") String applicationCategory) { ActionResult<List<ActionListWithApplicationCategory.Wo>> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionListWithApplicationCategory().execute(effectivePerson, applicationCategory); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #16
Source File: Namespaces.java From pulsar with Apache License 2.0 | 6 votes |
@DELETE @Path("/{property}/{cluster}/{namespace}") @ApiOperation(hidden = true, value = "Delete a namespace and all the topics under it.") @ApiResponses(value = { @ApiResponse(code = 307, message = "Current broker doesn't serve the namespace"), @ApiResponse(code = 403, message = "Don't have admin permission"), @ApiResponse(code = 404, message = "Property or cluster or namespace doesn't exist"), @ApiResponse(code = 409, message = "Namespace is not empty") }) public void deleteNamespace(@Suspended final AsyncResponse asyncResponse, @PathParam("property") String property, @PathParam("cluster") String cluster, @PathParam("namespace") String namespace, @QueryParam("authoritative") @DefaultValue("false") boolean authoritative) { try { validateNamespaceName(property, cluster, namespace); internalDeleteNamespace(asyncResponse, authoritative); } catch (WebApplicationException wae) { asyncResponse.resume(wae); } catch (Exception e) { asyncResponse.resume(new RestException(e)); } }
Example #17
Source File: Attachment2Action.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "获取图片设定宽高后的base64内容(png格式).width(0-5000)像素,0代表不限制,height(0-5000)像素,0代表不限制.", action = ActionGetImageWidthHeightBase64.class) @GET @Path("{id}/image/width/{width}/height/{height}/binary/base64") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void getImageWidthHeightBase64(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("附件标识") @PathParam("id") String id, @JaxrsParameterDescribe("宽度") @PathParam("width") Integer width, @JaxrsParameterDescribe("高度") @PathParam("height") Integer height) { ActionResult<ActionGetImageWidthHeightBase64.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionGetImageWidthHeightBase64().execute(effectivePerson, id, width, height); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #18
Source File: AttachmentAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "更新附件文本.", action = ActionEditText.class) @PUT @Path("edit/{id}/text") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void exitText(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("附件标识") @PathParam("id") String id, JsonElement jsonElement) { ActionResult<ActionEditText.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionEditText().execute(effectivePerson, id, jsonElement); } catch (Exception e) { logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #19
Source File: ScriptVersionAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据脚本id获取历史版本列表.", action = ActionListWithScript.class) @GET @Path("list/script/{scriptId}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void listWithForm(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("process标识") @PathParam("scriptId") String scriptId) { ActionResult<List<ActionListWithScript.Wo>> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionListWithScript().execute(effectivePerson, scriptId); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #20
Source File: DataAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据路径获取指定document的data数据.", action = ActionGetWithDocumentPath5.class) @GET @Path("document/{id}/{path0}/{path1}/{path2}/{path3}/{path4}/{path5}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void getWithDocumentWithPath5(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("文档ID") @PathParam("id") String id, @JaxrsParameterDescribe("0级路径") @PathParam("path0") String path0, @JaxrsParameterDescribe("1级路径") @PathParam("path1") String path1, @JaxrsParameterDescribe("2级路径") @PathParam("path2") String path2, @JaxrsParameterDescribe("3级路径") @PathParam("path3") String path3, @JaxrsParameterDescribe("4级路径") @PathParam("path4") String path4, @JaxrsParameterDescribe("5级路径") @PathParam("path5") String path5) { ActionResult<JsonElement> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionGetWithDocumentPath5().execute(effectivePerson, id, path0, path1, path2, path3, path4, path5); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #21
Source File: AttendanceWorkPlaceAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据ID删除指定工作区域信息", action = ActionDelete.class) @DELETE @Path("{id}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void delete(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("工作区域配置信息ID") @PathParam("id") String id) { ActionResult<ActionDelete.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); Boolean check = true; if (check) { try { result = new ActionDelete().execute(request, effectivePerson, id); } catch (Exception e) { result = new ActionResult<>(); Exception exception = new ExceptionAttendanceProcess(e, "根据ID删除指定工作区域信息时发生异常!"); result.error(exception); logger.error(e, effectivePerson, request, null); } } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #22
Source File: NeuralAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "删除项目.", action = ActionDeleteModel.class) @DELETE @Path("model/{modelFlag}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void deleteModel(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("模型标识") @PathParam("modelFlag") String modelFlag) { ActionResult<ActionDeleteModel.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionDeleteModel().execute(effectivePerson, modelFlag); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #23
Source File: GroupAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "判断群组是否拥有指定角色中的一个或者多个", action = ActionHasRole.class) @POST @Path("has/role") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void hasRole(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, JsonElement jsonElement) { ActionResult<ActionHasRole.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionHasRole().execute(effectivePerson, jsonElement); } catch (Exception e) { logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #24
Source File: AttendanceSelfHolidaySimpleAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "新建或者更新员工休假申请信息", action = ActionSave.class) @POST @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void post(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, JsonElement jsonElement) { ActionResult<ActionSave.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); Boolean check = true; if (check) { try { result = new ActionSave().execute(request, effectivePerson, jsonElement); } catch (Exception e) { result = new ActionResult<>(); Exception exception = new ExceptionAttendanceProcess(e, "新建或者更新员工休假申请信息时发生异常!"); result.error(exception); logger.error(e, effectivePerson, request, null); } } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #25
Source File: FormAnonymousAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据ID获取表单对象.", action = ActionGet.class) @GET @Path("{id}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void get( @Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("表单ID") @PathParam("id") String id) { EffectivePerson effectivePerson = this.effectivePerson( request ); ActionResult<ActionGet.Wo> result = new ActionResult<>(); try { result = new ActionGet().execute( request, effectivePerson, id ); } catch (Exception e) { result = new ActionResult<>(); Exception exception = new ExceptionServiceLogic( e, "系统在根据ID查询表单时发生异常。" ); result.error( exception ); logger.error( e, effectivePerson, request, null); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #26
Source File: OkrAttachmentFileInfoAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "根据工作汇报ID获取附件信息列表", action = ActionListWithReportId.class) @GET @Path("list/report/{id}") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void listByWorkReportId(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("工作汇报ID") @PathParam("id") String id) { EffectivePerson effectivePerson = this.effectivePerson(request); ActionResult<List<ActionListWithReportId.Wo>> result = new ActionResult<>(); try { result = new ActionListWithReportId().execute(request, effectivePerson, id); } catch (Exception e) { result = new ActionResult<>(); logger.warn("系统根据工作ID获取工作汇报所有附件信息过程发生异常。"); logger.error(e, effectivePerson, request, null); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #27
Source File: ViewAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "创建View.", action = ActionCreate.class) @POST @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void create(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, JsonElement jsonElement) { ActionResult<ActionCreate.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionCreate().execute(effectivePerson, jsonElement); } catch (Exception e) { logger.error(e, effectivePerson, request, jsonElement); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #28
Source File: ProjectAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "查询我的项目统计信息.", action = ActionStatisticMyProjects.class) @GET @Path("statitic/my") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void statiticMyProject(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request ) { ActionResult<ActionStatisticMyProjects.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionStatisticMyProjects().execute( request, effectivePerson ); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #29
Source File: PortalAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "列示当前用户可以管理的Portal的简要信息包含page.", action = ActionListSummary.class) @GET @Path("list/summary") @Produces(HttpMediaType.APPLICATION_JSON_UTF_8) @Consumes(MediaType.APPLICATION_JSON) public void listSummary(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) { ActionResult<List<ActionListSummary.Wo>> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionListSummary().execute(effectivePerson); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }
Example #30
Source File: FileImportExportAction.java From o2oa with GNU Affero General Public License v3.0 | 6 votes |
@JaxrsMethodDescribe(value = "按指定月份导出非正常打卡数据,设定是否使用stream输出", action = ActionExportAbnormalDetail.class) @GET @Path("export/abnormaldetails/year/{year}/month/{month}/stream/{stream}") @Consumes(MediaType.APPLICATION_JSON) public void abnormalDetailsExportStream(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request, @JaxrsParameterDescribe("年份") @PathParam("year") String year, @JaxrsParameterDescribe("月份") @PathParam("month") String month, @JaxrsParameterDescribe("用.APPLICATION_OCTET_STREAM头输出") @PathParam("stream") Boolean stream) { ActionResult<ActionExportAbnormalDetail.Wo> result = new ActionResult<>(); EffectivePerson effectivePerson = this.effectivePerson(request); try { result = new ActionExportAbnormalDetail().execute(request, effectivePerson, year, month, stream); } catch (Exception e) { logger.error(e, effectivePerson, request, null); result.error(e); } asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result)); }