io.swagger.annotations.ApiOperation Java Examples

The following examples show how to use io.swagger.annotations.ApiOperation. 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 Project: dependency-track   Author: DependencyTrack   File: UserResource.java    License: Apache License 2.0 7 votes vote down vote up
/**
 * @since 3.9.0
 */
@GET
@Path("oidc")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(
        value = "Returns a list of all OIDC users",
        response = OidcUser.class,
        responseContainer = "List",
        responseHeaders = @ResponseHeader(name = TOTAL_COUNT_HEADER, response = Long.class, description = "The total number of OIDC users")
)
@ApiResponses(value = {
        @ApiResponse(code = 401, message = "Unauthorized")
})
@PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT)
public Response getOidcUsers() {
    try (QueryManager qm = new QueryManager(getAlpineRequest())) {
        final long totalCount = qm.getCount(OidcUser.class);
        final List<OidcUser> users = qm.getOidcUsers();
        return Response.ok(users).header(TOTAL_COUNT_HEADER, totalCount).build();
    }
}
 
Example #2
Source Project: product-ei   Author: wso2   File: StockQuoteService.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Retrieve a stock for a given symbol.
 * http://localhost:9090/stockquote/IBM
 *
 * @param symbol Stock symbol will be taken from the path parameter.
 * @return Response
 */
@GET
@Path("/{symbol}")
@Produces({"application/json", "text/xml"})
@ApiOperation(
        value = "Return stock quote corresponding to the symbol",
        notes = "Returns HTTP 404 if the symbol is not found")
@ApiResponses(value = {
        @ApiResponse(code = 200, message = "Valid stock item found"),
        @ApiResponse(code = 404, message = "Stock item not found")})
public Response getQuote(@ApiParam(value = "Symbol", required = true)
                         @PathParam("symbol") String symbol) throws SymbolNotFoundException {
    Stock stock = stockQuotes.get(symbol);
    if (stock == null) {
        throw new SymbolNotFoundException("Symbol " + symbol + " not found");
    }
    return Response.ok().entity(stock).cookie(new NewCookie("symbol", symbol)).build();
}
 
Example #3
Source Project: flowable-engine   Author: flowable   File: DeploymentResource.java    License: Apache License 2.0 6 votes vote down vote up
@ApiOperation(value = "Delete a deployment", tags = { "Deployment" })
@ApiResponses(value = {
        @ApiResponse(code = 204, message = "Indicates the deployment was found and has been deleted. Response-body is intentionally empty."),
        @ApiResponse(code = 404, message = "Indicates the requested deployment was not found.")
})
@DeleteMapping(value = "/repository/deployments/{deploymentId}", produces = "application/json")
public void deleteDeployment(@ApiParam(name = "deploymentId") @PathVariable String deploymentId, @RequestParam(value = "cascade", required = false, defaultValue = "false") Boolean cascade,
        HttpServletResponse response) {
    
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();

    if (deployment == null) {
        throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
    }
    
    if (restApiInterceptor != null) {
        restApiInterceptor.deleteDeployment(deployment);
    }

    if (cascade) {
        repositoryService.deleteDeployment(deploymentId, true);
    } else {
        repositoryService.deleteDeployment(deploymentId);
    }
    response.setStatus(HttpStatus.NO_CONTENT.value());
}
 
Example #4
Source Project: paascloud-master   Author: paascloud   File: OpcFileController.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 上传文件.
 *
 * @param request             the request
 * @param optUploadFileReqDto the opt upload file req dto
 *
 * @return the wrapper
 */
@PostMapping(consumes = "multipart/form-data", value = "/uploadFile")
@ApiOperation(httpMethod = "POST", value = "上传文件")
public Wrapper<String> uploadFile(HttpServletRequest request, OptUploadFileReqDto optUploadFileReqDto) {
	StringBuilder temp = new StringBuilder();
	logger.info("uploadFile - 上传文件. optUploadFileReqDto={}", optUploadFileReqDto);
	Preconditions.checkArgument(StringUtils.isNotEmpty(optUploadFileReqDto.getFileType()), "文件类型为空");
	Preconditions.checkArgument(StringUtils.isNotEmpty(optUploadFileReqDto.getBucketName()), "存储地址为空");

	MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
	List<OptUploadFileRespDto> optUploadFileRespDtos = optAttachmentService.uploadFile(multipartRequest, optUploadFileReqDto, getLoginAuthDto(), true);
	for (final OptUploadFileRespDto fileRespDto : optUploadFileRespDtos) {
		temp.append(fileRespDto.getAttachmentId()).append(",");
	}
	String attachmentIds = temp.toString();
	if (StringUtils.isNotEmpty(attachmentIds)) {
		attachmentIds = StringUtils.substringBeforeLast(attachmentIds, GlobalConstant.Symbol.COMMA);
	}
	return WrapMapper.ok(attachmentIds);
}
 
Example #5
Source Project: opencps-v2   Author: VietOpenCPS   File: DossierFileManagement.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
@PUT
@Path("/{id}/files/{referenceUid}/formdata")
@Consumes({
	MediaType.APPLICATION_FORM_URLENCODED
})
@Produces({
	MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON
})
@ApiOperation(value = "update DossierFile")
@ApiResponses(value = {
	@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns"),
	@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
	@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
	@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class)
})
public Response updateDossierFileFormData(
	@Context HttpServletRequest request, @Context HttpHeaders header,
	@Context Company company, @Context Locale locale, @Context User user,
	@Context ServiceContext serviceContext,
	@ApiParam(value = "id of dossier", required = true) @PathParam("id") long id,
	@ApiParam(value = "referenceUid of dossierfile", required = true) @PathParam("referenceUid") String referenceUid,
	@ApiParam(value = "formdata of dossierfile", required = true) @FormParam("formdata") String formdata);
 
Example #6
Source Project: Web-API   Author: Valandur   File: VShopServlet.java    License: MIT License 6 votes vote down vote up
@GET
@Path("/shop/{id}/item")
@Permission({"vshop", "item", "list"})
@ApiOperation(
        value = "List Shop Items",
        notes = "Return a list of all shops items")
public Collection<CachedStockItem> listShopItems(@PathParam("id") UUID id) {
    return WebAPI.runOnMain(() -> {
        Optional<NPCguard> npc = VillagerShops.getNPCfromShopUUID(id);
        if (!npc.isPresent()) {
            throw new NotFoundException("Shop with id " + id + " not found");
        }
        InvPrep inv = npc.get().getPreparator();
        int s = inv.size();

        List<CachedStockItem> csi = new ArrayList<>(s);
        for (int i = 0; i < s; i++)
            csi.add(new CachedStockItem(inv.getItem(i), i, npc.get().getIdentifier()));

        return csi;
    });
}
 
Example #7
Source Project: paascloud-master   Author: paascloud   File: UacActionCommonController.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 检测权限编码是否已存在
 *
 * @param uacActionCheckCodeDto the uac action check code dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkActionCode")
@ApiOperation(httpMethod = "POST", value = "检测权限编码是否已存在")
public Wrapper<Boolean> checkActionCode(@ApiParam(name = "uacActionCheckCodeDto", value = "id与url") @RequestBody UacActionCheckCodeDto uacActionCheckCodeDto) {
	logger.info("校验权限编码唯一性 uacActionCheckCodeDto={}", uacActionCheckCodeDto);

	Long id = uacActionCheckCodeDto.getActionId();
	String actionCode = uacActionCheckCodeDto.getActionCode();

	Example example = new Example(UacAction.class);
	Example.Criteria criteria = example.createCriteria();

	if (id != null) {
		criteria.andNotEqualTo("id", id);
	}
	criteria.andEqualTo("actionCode", actionCode);

	int result = uacActionService.selectCountByExample(example);
	return WrapMapper.ok(result < 1);
}
 
Example #8
Source Project: hmdm-server   Author: h-mdm   File: FilesResource.java    License: Apache License 2.0 6 votes vote down vote up
@ApiOperation(
        value = "Get applications",
        notes = "Gets the list of applications using the file",
        response = Application.class,
        responseContainer = "List"
)
@GET
@Path("/apps/{url}")
@Produces(MediaType.APPLICATION_JSON)
public Response getApplicationsForFile(@PathParam("url") @ApiParam("An URL referencing the file") String url) {
    try {
        String decodedUrl = URLDecoder.decode(url, "UTF-8");
        return Response.OK(this.applicationDAO.getAllApplicationsByUrl(decodedUrl));
    } catch (Exception e) {
        logger.error("Unexpected error when getting the list of applications by URL", e);
        return Response.INTERNAL_ERROR();
    }
}
 
Example #9
Source Project: hmdm-server   Author: h-mdm   File: DeviceLogPluginSettingsResource.java    License: Apache License 2.0 6 votes vote down vote up
@ApiOperation(
        value = "Create or update plugin settings rule",
        notes = "Creates a new plugin settings rule record (if id is not provided) or updates existing one otherwise",
        authorizations = {@Authorization("Bearer Token")}
)
@PUT
@Path("/private/rule")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response saveSettingsRule(String ruleJSON) {
    try {
        ObjectMapper mapper = new ObjectMapper();
        DeviceLogRule rule = mapper.readValue(ruleJSON, this.settingsDAO.getSettingsRuleClass());

        this.settingsDAO.savePluginSettingsRule(rule);
        notifyRuleDevices(rule);

        return Response.OK();
    } catch (Exception e) {
        log.error("Failed to create or update device log plugin settings rule", e);
        return Response.INTERNAL_ERROR();
    }
}
 
Example #10
Source Project: icure-backend   Author: taktik   File: ClassificationFacade.java    License: GNU General Public License v2.0 6 votes vote down vote up
@ApiOperation(
		value = "Create a classification with the current user",
		response = ClassificationDto.class,
		httpMethod = "POST",
		notes = "Returns an instance of created classification Template."
)
@POST
public Response createClassification(ClassificationDto c) {
	if (c == null) {
		return Response.status(400).type("text/plain").entity("A required query parameter was not specified for this request.").build();
	}

	Classification element = classificationLogic.createClassification(mapper.map(c, Classification.class));

	boolean succeed = (element != null);
	if (succeed) {
		return Response.ok().entity(mapper.map(element, ClassificationDto.class)).build();
	} else {
		return Response.status(500).type("text/plain").entity("Classification creation failed.").build();
	}
}
 
Example #11
Source Project: springboot-seed   Author: ustcwudi   File: MyInfoAPI.java    License: MIT License 6 votes vote down vote up
@ApiOperation(value = "修改密码")
@PutMapping("/change_password")
public ResponseEntity<?> changePassword(
        @ApiParam("旧密码") @RequestParam("oldPassword") String oldPassword,
        @ApiParam("新密码") @RequestParam("newPassword") String newPassword
) {
    OAuth2Authentication auth = (OAuth2Authentication) SecurityContextHolder.getContext().getAuthentication();
    Optional<User> user = userService.selectByID(((SecurityUser) auth.getPrincipal()).getId());
    BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
    if (user.isPresent() && encoder.matches(oldPassword, user.get().getPassword())) {
        User instance = user.get();
        instance.setPassword(newPassword);
        userService.modifyById(instance);
        return ResponseEntity.status(HttpStatus.OK).build();
    } else {
        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
    }
}
 
Example #12
Source Project: smarthome   Author: eclipse-archived   File: ThingResource.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@PUT
@RolesAllowed({ Role.USER, Role.ADMIN })
@Path("/{thingUID}/enable")
@ApiOperation(value = "Sets the thing enabled status.")
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = String.class),
        @ApiResponse(code = 404, message = "Thing not found.") })
public Response setEnabled(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) String language,
        @PathParam("thingUID") @ApiParam(value = "thing") String thingUID,
        @ApiParam(value = "enabled") String enabled) throws IOException {
    final Locale locale = localeService.getLocale(language);

    ThingUID thingUIDObject = new ThingUID(thingUID);

    // Check if the Thing exists, 404 if not
    Thing thing = thingRegistry.get(thingUIDObject);
    if (null == thing) {
        logger.info("Received HTTP PUT request for set enabled at '{}' for the unknown thing '{}'.",
                uriInfo.getPath(), thingUID);
        return getThingNotFoundResponse(thingUID);
    }

    thingManager.setEnabled(thingUIDObject, Boolean.valueOf(enabled));

    // everything went well
    return getThingResponse(Status.OK, thing, locale, null);
}
 
Example #13
Source Project: graviteeio-access-management   Author: gravitee-io   File: ScopeResource.java    License: Apache License 2.0 6 votes vote down vote up
@DELETE
@ApiOperation(value = "Delete a scope",
        notes = "User must have the DOMAIN_SCOPE[DELETE] permission on the specified domain " +
                "or DOMAIN_SCOPE[DELETE] permission on the specified environment " +
                "or DOMAIN_SCOPE[DELETE] permission on the specified organization")
@ApiResponses({
        @ApiResponse(code = 204, message = "Scope successfully deleted"),
        @ApiResponse(code = 500, message = "Internal server error")})
public void delete(
        @PathParam("organizationId") String organizationId,
        @PathParam("environmentId") String environmentId,
        @PathParam("domain") String domain,
        @PathParam("scope") String scope,
        @Suspended final AsyncResponse response) {
    final User authenticatedUser = getAuthenticatedUser();

    checkAnyPermission(organizationId, environmentId, domain, Permission.DOMAIN_SCOPE, Acl.DELETE)
            .andThen(scopeService.delete(scope, false, authenticatedUser))
            .subscribe(() -> response.resume(Response.noContent().build()), response::resume);
}
 
Example #14
Source Project: hmdm-server   Author: h-mdm   File: ConfigurationResource.java    License: Apache License 2.0 6 votes vote down vote up
@ApiOperation(
        value = "Copy configuration",
        notes = "Creates a new copy of configuration referenced by the id and names it with provided name."
)
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/copy")
public Response copyConfiguration(Configuration configuration) {
    Configuration dbConfiguration = this.configurationDAO.getConfigurationByName(configuration.getName());
    if (dbConfiguration != null) {
        return Response.DUPLICATE_ENTITY("error.duplicate.configuration");
    } else {
        dbConfiguration = this.getConfiguration(configuration.getId());
        List<Application> configurationApplications = this.configurationDAO.getPlainConfigurationApplications(configuration.getId());
        Configuration copy = dbConfiguration.newCopy();
        copy.setName(configuration.getName());
        copy.setApplications(configurationApplications);
        copy.setBaseUrl(this.configurationDAO.getBaseUrl());
        this.configurationDAO.insertConfiguration(copy);
        return Response.OK();
    }
}
 
Example #15
Source Project: pulsar   Author: apache   File: Namespaces.java    License: Apache License 2.0 6 votes vote down vote up
@POST
@Path("/{property}/{cluster}/{namespace}/clearBacklog")
@ApiOperation(hidden = true, value = "Clear backlog for all topics on a namespace.")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
        @ApiResponse(code = 404, message = "Namespace does not exist") })
public void clearNamespaceBacklog(@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);
        internalClearNamespaceBacklog(asyncResponse, authoritative);
    } catch (WebApplicationException wae) {
        asyncResponse.resume(wae);
    } catch (Exception e) {
        asyncResponse.resume(new RestException(e));
    }
}
 
Example #16
Source Project: titus-control-plane   Author: Netflix   File: JobManagementResource.java    License: Apache License 2.0 6 votes vote down vote up
@PUT
@ApiOperation("Update attributes of a task")
@Path("/tasks/{taskId}/attributes")
public Response updateTaskAttributes(@PathParam("taskId") String taskId,
                                     TaskAttributesUpdate request) {
    TaskAttributesUpdate sanitizedRequest;
    if (request.getTaskId().isEmpty()) {
        sanitizedRequest = request.toBuilder().setTaskId(taskId).build();
    } else {
        if (!taskId.equals(request.getTaskId())) {
            return Response.status(Response.Status.BAD_REQUEST).build();
        }
        sanitizedRequest = request;
    }
    return Responses.fromCompletable(jobServiceGateway.updateTaskAttributes(sanitizedRequest, resolveCallMetadata()));
}
 
Example #17
Source Project: graylog-plugin-aggregates   Author: cvtienhoven   File: ReportScheduleResource.java    License: GNU General Public License v3.0 6 votes vote down vote up
@POST
@Path("/{name}")
@Timed
@RequiresAuthentication
@RequiresPermissions(ReportScheduleRestPermissions.AGGREGATE_REPORT_SCHEDULES_UPDATE)
@AuditEvent(type = AuditEventTypes.AGGREGATES_REPORT_SCHEDULE_UPDATE)
@ApiOperation(value = "Update a report schedule")
@ApiResponses(value = {
        @ApiResponse(code = 400, message = "The supplied request is not valid.")
})
public Response update(@ApiParam(name = "name", required = true)
					   @PathParam("name") String name,
                         @ApiParam(name = "JSON body", required = true) @Valid @NotNull UpdateReportScheduleRequest request
                         ) throws UnsupportedEncodingException {
    final ReportSchedule reportSchedule = reportScheduleService.fromRequest(request);

    reportScheduleService.update(java.net.URLDecoder.decode(name, "UTF-8"), reportSchedule);

    return Response.accepted().build();
}
 
Example #18
Source Project: konker-platform   Author: KonkerLabs   File: DeviceRestController.java    License: Apache License 2.0 6 votes vote down vote up
@PutMapping(path = "/{deviceGuid}/application")
@ApiOperation(value = "Move device to another application")
@PreAuthorize("hasAuthority('EDIT_DEVICE')")
public DeviceVO move(
        @PathVariable("application") String applicationId,
        @PathVariable("deviceGuid") String deviceGuid,
        @ApiParam(name = "body", required = true)
        @RequestBody ApplicationDestinationVO applicationDestinationVO)
        throws BadServiceResponseException, NotFoundResponseException {

    Tenant tenant = user.getTenant();
    Application application = getApplication(applicationId);
    Application destApplication = getApplication(applicationDestinationVO.getDestinationApplicationName());

    ServiceResponse<Device> deviceResponse = deviceRegisterService.move(tenant, application, deviceGuid, destApplication);

    if (!deviceResponse.isOk()) {
        throw new BadServiceResponseException( deviceResponse, validationsCode);
    }

    return new DeviceVO().apply(deviceResponse.getResult());

}
 
Example #19
Source Project: datacollector   Author: streamsets   File: PipelineStoreResource.java    License: Apache License 2.0 6 votes vote down vote up
@Path("/pipeline/{pipelineId}/metadata")
@POST
@ApiOperation(value ="", hidden = true)
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed({
    AuthzRole.CREATOR, AuthzRole.ADMIN, AuthzRole.CREATOR_REMOTE, AuthzRole.ADMIN_REMOTE
})
@SuppressWarnings("unchecked")
public Response saveMetadata(
    @PathParam("pipelineId") String name,
    @QueryParam("rev") @DefaultValue("0") String rev,
    Map<String, Object> metadata
) throws PipelineException {
  PipelineInfo pipelineInfo = store.getInfo(name);
  RestAPIUtils.injectPipelineInMDC(pipelineInfo.getTitle(), pipelineInfo.getPipelineId());
  store.saveMetadata(user, name, rev, metadata);
  return Response.ok().build();
}
 
Example #20
Source Project: hdw-dubbo   Author: JacksonTu   File: ScheduleJobController.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 恢复定时任务信息
 */
@ApiOperation(value = "恢复定时任务信息", notes = "恢复定时任务信息")
@ApiImplicitParam(paramType = "query", name = "jobIds", value = "主键ID数组", dataType = "Integer", required = true, allowMultiple = true)
@PostMapping("/resume")
@RequiresPermissions("sys/schedule/resume")
public CommonResult resume(@RequestBody Long[] jobIds) {
    scheduleJobService.resume(jobIds);

    return CommonResult.success("");
}
 
Example #21
Source Project: HIS   Author: ZainZhao   File: SmsEchartsController.java    License: Apache License 2.0 5 votes vote down vote up
@ApiOperation(value = "统计各科室每日接待患者人数(近7日)")
@RequestMapping(value = "/deptPatients", method = RequestMethod.GET)
@ResponseBody
public CommonResult<SmsPatientsStatisticsResult> deptPatients(Long deptId) {
    SmsPatientsStatisticsResult smsPatientsStatisticsResult = smsEchartsService.deptPatients(deptId);
    return CommonResult.success(smsPatientsStatisticsResult);
}
 
Example #22
Source Project: pulsar   Author: apache   File: Namespaces.java    License: Apache License 2.0 5 votes vote down vote up
@POST
@Path("/{property}/{cluster}/{namespace}/maxProducersPerTopic")
@ApiOperation(value = " Set maxProducersPerTopic configuration on a namespace.")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
        @ApiResponse(code = 404, message = "Namespace does not exist"),
        @ApiResponse(code = 409, message = "Concurrent modification"),
        @ApiResponse(code = 412, message = "maxProducersPerTopic value is not valid") })
public void setMaxProducersPerTopic(@PathParam("property") String property, @PathParam("cluster") String cluster,
        @PathParam("namespace") String namespace, int maxProducersPerTopic) {
    validateNamespaceName(property, cluster, namespace);
    internalSetMaxProducersPerTopic(maxProducersPerTopic);
}
 
Example #23
Source Project: fileServer   Author: codingapi   File: RemoveController.java    License: Apache License 2.0 5 votes vote down vote up
@ApiOperation(value="删除文件", notes="删除文件")
@RequestMapping(value = "/file", method = RequestMethod.POST)
public boolean removeFile(
        @ApiParam(value = "文件服务器存放路径")
        @RequestParam("filePath") String filePath,
        @ApiParam(value = "删除标示,0:本文件,1:整个文件目录")
        @RequestParam("flag") int flag ) throws ServiceException {
    return removeService.removeFile(filePath,flag);
}
 
Example #24
Source Project: AthenaServing   Author: xfyun   File: ServiceConfigController.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 批量推送配置
 *
 * @param body
 * @return
 */
@RequestMapping(value = "/batchPush", method = RequestMethod.POST)
@ApiOperation("批量推送")
public Response<PushServiceConfigResponseBody> batchPush(@RequestBody BatchPushServiceConfigRequestBody body) {
	List<String> configIds = body.getIds();
	if (null == configIds || configIds.isEmpty()) {
		return new Response<>(SystemErrCode.ERRCODE_INVALID_PARAMETER, SystemErrCode.ERRMSG_SERVICE_CONFIG_IDS_NOT_NULL);
	}
	List<String> ids = body.getRegionIds();
	if (null == ids || ids.isEmpty()) {
		return new Response<>(SystemErrCode.ERRCODE_INVALID_PARAMETER, SystemErrCode.ERRMSG_REGION_IDS_NOT_NULL);
	}
	return this.serviceConfigImpl.batchPush(body);
}
 
Example #25
Source Project: efo   Author: code4everything   File: FileController.java    License: MIT License 5 votes vote down vote up
/**
 * 资源下载
 *
 * @param response {@link HttpServletResponse}
 */
@ApiOperation(value = "通过访问路径获取文件资源")
@AuthInterceptor(InterceptorLevel.NONE)
@RequestMapping(value = "/**", method = RequestMethod.GET)
public void getResource(HttpServletResponse response) throws IOException {
    ControllerUtils.loadResource(response, fileService.getResource(request.getServletPath(), request),
            ValueConsts.FALSE);
}
 
Example #26
Source Project: mall   Author: macrozheng   File: UmsPermissionController.java    License: Apache License 2.0 5 votes vote down vote up
@ApiOperation("添加权限")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody UmsPermission permission) {
    int count = permissionService.create(permission);
    if(count>0){
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #27
Source Project: open-cloud   Author: liuyadu   File: EmailTemplateController.java    License: MIT License 5 votes vote down vote up
/**
 * 批量删除数据
 *
 * @return
 */
@ApiOperation(value = "批量删除数据", notes = "批量删除数据")
@ApiImplicitParams({
        @ApiImplicitParam(name = "id", required = true, value = "id", paramType = "form")
})
@PostMapping("/batch/remove")
public ResultBody batchRemove(
        @RequestParam(value = "ids") String ids
) {
    targetService.removeByIds(Arrays.asList(ids.split(",")));
    return ResultBody.ok();
}
 
Example #28
Source Project: BigDataPlatform   Author: KangU4   File: OmsOrderSettingController.java    License: GNU General Public License v3.0 5 votes vote down vote up
@ApiOperation("获取指定订单设置")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<OmsOrderSetting> getItem(@PathVariable Long id) {
    OmsOrderSetting orderSetting = orderSettingService.getItem(id);
    return CommonResult.success(orderSetting);
}
 
Example #29
Source Project: macrozheng   Author: FanCiyuan   File: OmsOrderController.java    License: Apache License 2.0 5 votes vote down vote up
@ApiOperation("批量删除订单")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
    int count = orderService.delete(ids);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #30
Source Project: pacbot   Author: tmobile   File: UserRolesMappingController.java    License: Apache License 2.0 5 votes vote down vote up
/**
    * API to get all user roles mappings details
    * 
    * @author Nidhish
    * @param page - zero-based page index.
    * @param size - the size of the page to be returned.
    * @param searchTerm - searchTerm to be searched.
    * @return All UserRolesMapping Details
    */
@ApiOperation(httpMethod = "GET", value = "API to get all user roles mappings details", response = Response.class,  produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(path = "/list", method = RequestMethod.GET,  produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Object> getAllUserRolesMapping(
	@ApiParam(value = "provide valid page number", required = true) @RequestParam("page") Integer page,
	@ApiParam(value = "provide valid page size", required = true) @RequestParam("size") Integer size,
	@ApiParam(value = "provide valid search term", required = false) @RequestParam(defaultValue="", name = "searchTerm", required = false) String searchTerm) {
	try {
		return ResponseUtils.buildSucessResponse(userRolesMappingService.getAllUserRolesMapping(searchTerm.trim(), page, size));
	} catch (Exception exception) {
		log.error(UNEXPECTED_ERROR_OCCURRED, exception);
		return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage());
	}
}