本文整理匯總了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);
}