本文整理汇总了Java中org.springframework.web.bind.annotation.RequestMethod.PUT属性的典型用法代码示例。如果您正苦于以下问题:Java RequestMethod.PUT属性的具体用法?Java RequestMethod.PUT怎么用?Java RequestMethod.PUT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.web.bind.annotation.RequestMethod
的用法示例。
在下文中一共展示了RequestMethod.PUT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateMajors
@ResponseBody
@RequestMapping(value="/majors/{academyNo}",method = RequestMethod.PUT)
public Map<String,Object> updateMajors(@PathVariable String academyNo,HttpSession session){
if(academyNo == null||academyNo.equals(""))
return WebUtils.webJsonError(Constants.Error.PARAMETER_ERROR);
FetchHelper fetchHelper = new FetchHelper();
Academy acadmey=new Academy();
acadmey.setNo(academyNo);
try {
List<Major> majorList = fetchHelper.fetchMajorData(acadmey);
if(majorList!=null&&majorList.size()>0){
//暂时写入 session 以 学院 号为 key 避免 线程安全问题
session.setAttribute(Constants.SessionKey.FETCH_MAJOR.toString()+acadmey.getNo(), majorList);
}
} catch (FetchTimeoutException e) {
return WebUtils.webJsonError(Constants.Error.FETCH_TIME_OUT);
}
return WebUtils.webJsonResult("done");
}
示例2: update
@RequestMapping(method = RequestMethod.PUT)
public String update(HttpServletResponse response, HttpServletRequest request) {
ShareDomainEntity arg = parse(request);
if (arg == null) {
return Hret.error(421, "解析参数失败", null);
}
String domainId = arg.getDomain_id();
Boolean status = authService.domainAuth(request, domainId, "w").getStatus();
if (!status) {
response.setStatus(403);
return Hret.error(403, "您没有权限修改域[" + domainId + "]的授权信息", null);
}
int size = shareDomainService.update(arg);
if (size == 1) {
return Hret.success(200, "success", null);
}
response.setStatus(421);
return Hret.error(421, "更新域权限信息失败,请联系管理员", null);
}
示例3: update
@RequestMapping(method = RequestMethod.PUT)
@ResponseBody
public String update(@Validated TaskDefineEntity taskDefineEntity, BindingResult bindingResult, HttpServletResponse response, HttpServletRequest request) {
if (bindingResult.hasErrors()) {
for (ObjectError m : bindingResult.getAllErrors()) {
response.setStatus(421);
return Hret.error(421, m.getDefaultMessage(), null);
}
}
RetMsg retMsg = taskDefineService.update(parse(request));
if (!retMsg.checkCode()) {
response.setStatus(retMsg.getCode());
return Hret.error(retMsg);
}
return Hret.success(retMsg);
}
示例4: updateOpsProcedure
@RequestMapping(method=RequestMethod.PUT, value="/cm/ops/procedures/{procedureId}")
@ResponseBody
public CmsOpsProcedure updateOpsProcedure(
@RequestBody CmsOpsProcedure proc,
@PathVariable long procedureId ) throws OpsException {
proc.setProcedureId(procedureId);
return opsManager.updateOpsProcedure(proc);
}
示例5: copyObjectPart
/**
* Uploads a part by copying data from an existing object as data source.
*
* See https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadUploadPartCopy.html
*
* @param copySource References the Objects to be copied.
* @param copyRange Defines the byte range for this part.
* @param encryption The encryption type.
* @param kmsKeyId The KMS encryption key id.
* @param uploadId id of the upload. Has to match all other part's uploads.
* @param partNumber number of the part to upload.
* @param request {@link HttpServletRequest} of this request.
*
* @return The etag of the uploaded part.
*
* @throws IOException in case of an error.
*/
@RequestMapping(
value = "/{destinationBucket:.+}/**",
method = RequestMethod.PUT,
headers = {
COPY_SOURCE,
COPY_SOURCE_RANGE,
SERVER_SIDE_ENCRYPTION,
SERVER_SIDE_ENCRYPTION_AWS_KMS_KEYID
})
public ResponseEntity<CopyPartResult> copyObjectPart(
@RequestHeader(value = COPY_SOURCE) final ObjectRef copySource,
@RequestHeader(value = COPY_SOURCE_RANGE) final Range copyRange,
@RequestHeader(value = SERVER_SIDE_ENCRYPTION) final String encryption,
@RequestHeader(
value = SERVER_SIDE_ENCRYPTION_AWS_KMS_KEYID,
required = false) final String kmsKeyId,
@PathVariable final String destinationBucket,
@RequestParam final String uploadId,
@RequestParam final String partNumber,
final HttpServletRequest request) throws IOException {
final String destinationFile = filenameFrom(destinationBucket, request);
final String partEtag = fileStore.copyPart(copySource.getBucket(),
copySource.getKey(),
(int) copyRange.getStart(),
(int) copyRange.getEnd(),
isV4SigningEnabled(request),
partNumber,
destinationBucket,
destinationFile,
uploadId
);
return ResponseEntity.ok(CopyPartResult.from(new Date(), "\"" + partEtag + "\""));
}
示例6: updateApprovalStatus
@RequestMapping(value = "/{approvalId}/status", method = RequestMethod.PUT)
public
@ResponseBody
void updateApprovalStatus(@PathVariable String approvalId,
@RequestBody StatusModel model)
throws ValidationException, ServiceException, ObjectNotFoundException {
updateApprovalStatusAction.invoke(model, approvalId);
}
示例7: validatingAssay
@RequestMapping(path = "/assays/{id}" + Links.VALIDATING_URL, method = RequestMethod.PUT)
HttpEntity<?> validatingAssay(@PathVariable("id") Assay assay) {
Event event = this.getStateEngine().advanceStateOfMetadataDocument(
getAssayService().getAssayRepository(),
assay,
ValidationState.VALIDATING);
return ResponseEntity.accepted().body(event);
}
示例8: update
/**
* 更新批次
*
* @param request
* @return 返回更新操作状态信息
*/
@RequestMapping(method = RequestMethod.PUT)
@ResponseBody
@ApiOperation(value = "更新批次信息")
public String update(HttpServletResponse response, HttpServletRequest request) {
BatchDefineEntity m = parse(request);
if (batchDefineService.getStatus(m.getBatchId()) == BatchStatus.BATCH_STATUS_RUNNING) {
response.setStatus(421);
return Hret.error(421, "批次正在运行中,无法编辑", null);
}
// 参数校验
RetMsg retMsg = valid(m);
if (!retMsg.checkCode()) {
response.setStatus(retMsg.getCode());
return Hret.error(retMsg);
}
retMsg = batchDefineService.updateBatch(m);
if (!retMsg.checkCode()) {
logger.info(retMsg.toString());
response.setStatus(retMsg.getCode());
return Hret.error(retMsg);
}
return Hret.success(retMsg);
}
示例9: touchCi
@RequestMapping(method=RequestMethod.PUT, value="/dj/simple/cis/{ciId}/touch")
@ResponseBody
public CmsRfcCISimple touchCi(@PathVariable long ciId,
@RequestBody CmsRfcCISimple rfcSimple,
@RequestHeader(value="X-Cms-User", required = false) String userId,
@RequestHeader(value="X-Cms-Scope", required = false) String scope) throws DJException {
CmsRfcCI baseCi = cmdjManager.getCiById(ciId, null);
scopeVerifier.verifyScope(scope, baseCi);
rfcSimple.setCiId(ciId);
rfcSimple.setNsPath(baseCi.getNsPath());
CmsRfcCI rfc = cmsUtil.custRfcCISimple2RfcCI(rfcSimple);
return cmsUtil.custRfcCI2RfcCISimple(cmdjManager.touchCi(rfc, userId));
}
示例10: addBundleReference
@RequestMapping(path = "/analyses/{analysis_id}/" + Links.BUNDLE_REF_URL,
method = RequestMethod.PUT)
ResponseEntity<Resource<?>> addBundleReference(@PathVariable("analysis_id") Analysis analysis,
@RequestBody BundleReference bundleReference,
final PersistentEntityResourceAssembler assembler) {
Analysis entity = getAnalysisService().resolveBundleReferencesForAnalysis(analysis, bundleReference);
PersistentEntityResource resource = assembler.toFullResource(entity);
return ResponseEntity.accepted().body(resource);
}
示例11: validateFile
@RequestMapping(path = "/files/{id}" + Links.VALID_URL, method = RequestMethod.PUT)
HttpEntity<?> validateFile(@PathVariable("id") File file) {
Event event = this.getStateEngine().advanceStateOfMetadataDocument(
getFileService().getFileRepository(),
file,
ValidationState.VALID);
return ResponseEntity.accepted().body(event);
}
示例12: getCommands
@RequestMapping(value = "/all/{cmd}",
method = {RequestMethod.PUT, RequestMethod.POST, RequestMethod.GET})
public Callable<Map<String, String>> getCommands(@PathVariable String cmd,
@RequestBody(required = false) String arguments) {
Callable<Map<String, String>> callable = new Callable<Map<String, String>>() {
@Override
public Map<String, String> call() throws Exception {
return command.getResponses(cmd, arguments);
}
};
return callable;
}
示例13: updateRfcCi
@RequestMapping(method=RequestMethod.PUT, value="/dj/simple/rfc/cis/{rfcId}")
@ResponseBody
public CmsRfcCISimple updateRfcCi(
@PathVariable long rfcId,
@RequestBody CmsRfcCISimple rfcSimple,
@RequestHeader(value="X-Cms-Scope", required = false) String scope,
@RequestHeader(value="X-Cms-User", required = false) String userId) throws DJException {
scopeVerifier.verifyScope(scope, rfcSimple);
rfcSimple.setRfcId(rfcId);
CmsRfcCI rfc = cmsUtil.custRfcCISimple2RfcCI(rfcSimple);
rfc.setUpdatedBy(userId);
return cmsUtil.custRfcCI2RfcCISimple(djManager.updateRfcCI(rfc));
}
示例14: setOptionsJVM
/**
* Set the JVM Options and Memory
*
* @param input
* @return
* @throws ServiceException
* @throws CheckException
*/
@CloudUnitSecurable
@RequestMapping(value = "/configuration/jvm", method = RequestMethod.PUT)
@ResponseBody
public JsonResponse setOptionsJVM(@RequestBody JsonInput input) throws ServiceException, CheckException {
if (logger.isDebugEnabled()) {
logger.debug("" + input);
}
User user = authentificationUtils.getAuthentificatedUser();
Application application = applicationService.findByNameAndUser(user, input.getApplicationName());
authentificationUtils.canStartNewAction(user, application, locale);
CheckUtils.checkJavaOpts(input.getJvmOptions(), input.getJvmMemory(), input.getJvmRelease());
applicationService.setStatus(application, Status.PENDING);
try {
Server server = application.getServer();
serverService.update(server, input.getJvmMemory(), input.getJvmOptions(), false);
} catch (Exception e) {
applicationService.setStatus(application, Status.FAIL);
}
applicationService.setStatus(application, Status.START);
return new HttpOk();
}
示例15: validatingProtocol
@RequestMapping(path = "/protocols/{id}" + Links.VALIDATING_URL, method = RequestMethod.PUT)
HttpEntity<?> validatingProtocol(@PathVariable("id") Protocol protocol) {
Event event = this.getStateEngine().advanceStateOfMetadataDocument(
getProtocolService().getProtocolRepository(),
protocol,
ValidationState.VALIDATING);
return ResponseEntity.accepted().body(event);
}