本文整理汇总了Java中org.springframework.http.HttpHeaders.AUTHORIZATION属性的典型用法代码示例。如果您正苦于以下问题:Java HttpHeaders.AUTHORIZATION属性的具体用法?Java HttpHeaders.AUTHORIZATION怎么用?Java HttpHeaders.AUTHORIZATION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.http.HttpHeaders
的用法示例。
在下文中一共展示了HttpHeaders.AUTHORIZATION属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: legalSealedClaim
@ApiOperation("Returns a sealed claim copy for a given claim external id")
@GetMapping(
value = "/legalSealedClaim/{externalId}",
produces = MediaType.APPLICATION_PDF_VALUE
)
public ResponseEntity<ByteArrayResource> legalSealedClaim(
@ApiParam("Claim external id")
@PathVariable("externalId") @NotBlank String externalId,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation
) {
byte[] pdfDocument = documentsService.getLegalSealedClaim(externalId, authorisation);
return ResponseEntity
.ok()
.contentLength(pdfDocument.length)
.body(new ByteArrayResource(pdfDocument));
}
示例2: resendStaffNotifications
@PutMapping("/claim/{referenceNumber}/event/{event}/resend-staff-notifications")
@ApiOperation("Resend staff notifications associated with provided event")
public void resendStaffNotifications(
@PathVariable("referenceNumber") String referenceNumber,
@PathVariable("event") String event,
@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authorisation
) throws ServletRequestBindingException {
Claim claim = claimService.getClaimByReference(referenceNumber)
.orElseThrow(() -> new NotFoundException(CLAIM + referenceNumber + " does not exist"));
switch (event) {
case "claim-issued":
resendStaffNotificationsOnClaimIssued(claim, authorisation);
break;
case "more-time-requested":
resendStaffNotificationOnMoreTimeRequested(claim);
break;
case "response-submitted":
resendStaffNotificationOnDefendantResponseSubmitted(claim);
break;
case "ccj-request-submitted":
resendStaffNotificationCCJRequestSubmitted(claim);
break;
case "offer-accepted":
resendStaffNotificationOnOfferAccepted(claim);
break;
default:
throw new NotFoundException("Event " + event + " is not supported");
}
}
示例3: getByClaimReference
@GetMapping("/{claimReference:" + CLAIM_REFERENCE_PATTERN + "}")
@ApiOperation("Fetch claim for given claim reference")
public Claim getByClaimReference(@PathVariable("claimReference") String claimReference,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation) {
return claimService.getClaimByReference(claimReference, authorisation)
.orElseThrow(() -> new NotFoundException("Claim not found by claim reference " + claimReference));
}
示例4: getClaimByExternalReference
@GetMapping("/representative/{externalReference}")
@ApiOperation("Fetch user claims for given external reference number")
public List<Claim> getClaimByExternalReference(
@PathVariable("externalReference") String externalReference,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation) {
return claimService.getClaimByExternalReference(externalReference, authorisation);
}
示例5: save
@PostMapping(value = "/{submitterId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ApiOperation("Creates a new claim")
public Claim save(@Valid @NotNull @RequestBody ClaimData claimData,
@PathVariable("submitterId") String submitterId,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation) {
return claimService.saveClaim(submitterId, claimData, authorisation);
}
示例6: makeOffer
@PostMapping(value = "/{claimId:\\d+}/offers/{party}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseStatus(HttpStatus.CREATED)
@ApiOperation("Makes an offer as a party")
public Claim makeOffer(
@PathVariable("claimId") Long claimId,
@PathVariable("party") MadeBy party,
@RequestBody @Valid Offer offer,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation
) {
Claim claim = claimService.getClaimById(claimId);
assertActionIsPermittedFor(claim, party, authorisation);
offersService.makeOffer(claim, offer, party);
return claimService.getClaimById(claimId);
}
示例7: accept
@PostMapping(value = "/{claimId:\\d+}/offers/{party}/accept", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseStatus(HttpStatus.CREATED)
@ApiOperation("Accepts an offer as a party")
public Claim accept(
@PathVariable("claimId") Long claimId,
@PathVariable("party") MadeBy party,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation
) {
Claim claim = claimService.getClaimById(claimId);
assertActionIsPermittedFor(claim, party, authorisation);
offersService.accept(claim, party);
return claimService.getClaimById(claimId);
}
示例8: reject
@PostMapping(value = "/{claimId:\\d+}/offers/{party}/reject", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseStatus(HttpStatus.CREATED)
@ApiOperation("Rejects an offer as a party")
public Claim reject(
@PathVariable("claimId") Long claimId,
@PathVariable("party") MadeBy party,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation
) {
Claim claim = claimService.getClaimById(claimId);
assertActionIsPermittedFor(claim, party, authorisation);
offersService.reject(claim, party);
return claimService.getClaimById(claimId);
}
示例9: save
@PostMapping(
value = "/claim/{claimId}/defendant/{defendantId:\\d+}",
consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ApiOperation("Creates a new defendant response")
public Claim save(
@Valid @NotNull @RequestBody Response response,
@PathVariable("defendantId") String defendantId,
@PathVariable("claimId") Long claimId,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorization
) {
return defendantResponseService.save(claimId, defendantId, response, authorization);
}
示例10: save
@PostMapping("/{claimId:\\d+}/county-court-judgment")
@ApiOperation("Save County Court Judgment")
public Claim save(
@PathVariable("claimId") Long claimId,
@NotNull @RequestBody @Valid CountyCourtJudgment countyCourtJudgment,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation
) {
String submitterId = userService.getUserDetails(authorisation).getId();
return countyCourtJudgmentService.save(submitterId, countyCourtJudgment, claimId);
}
示例11: permissions
@GetMapping("/v2/apps/{applicationId}/permissions")
public Mono<ResponseEntity<Map<String, Boolean>>> permissions(
@PathVariable String applicationId,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorization) {
String token = authorization.substring(7);
return this.accessTokenService.checkToken(applicationId, token) //
.flatMap(accessToken -> this.applicationRepository.findById(applicationId)
.map(application -> ResponseEntity
.ok(singletonMap("read_sensitive_data",
application.isReadSensitiveData()))) //
.switchIfEmpty(forbidden()))
.switchIfEmpty(forbidden());
}
示例12: retrieveUserDetails
@RequestMapping(method = RequestMethod.GET, value = "/details")
UserDetails retrieveUserDetails(@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation);
示例13: generatePin
@RequestMapping(method = RequestMethod.POST, value = "/pin")
GeneratePinResponse generatePin(
GeneratePinRequest requestBody,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation
);
示例14: requestMoreTimeToRespond
@PostMapping(value = "/{claimId:\\d+}/request-more-time")
@ApiOperation("Updates response deadline. Can be called only once per each claim")
public Claim requestMoreTimeToRespond(@PathVariable("claimId") Long claimId,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation) {
return claimService.requestMoreTimeForResponse(claimId, authorisation);
}