@POST
@Path("update/batch")
@RolesAllowed({UserRoleConstants.ALL})
@ApiOperation(value = "批量修改预警信息", tags = {ApiConstants.WARNING_DATA}, response = WarningData.class,responseContainer = "LIST")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response updateWarningDataBatch(
@FormDataParam("handleResult") String handleResult,
@FormDataParam("ids") String ids,
@Context SecurityContext securityContext) {
UserRolePrincipal userRolePrincipal = (UserRolePrincipal) securityContext.getUserPrincipal();
String userName = userRolePrincipal.getUserName();
Long customerId = userRolePrincipal.getUsId();
warningDataService.updateWarningDataBatch(ids,userName,customerId,handleResult);
return ok();
}
@FormParam
用于获取POST请求且以form(MIME类型为application/x-www-form-urlencoded)方式提交的表单的参数
@FormDataParam
用于获取POST请求且以form(MIME类型为multipart/form-data)方式提交的表单的参数, 通常是在上传文件的时候
接口测试时需要添加
Content-Type:application/x-www-form-urlencoded; charset=UTF-8;