當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpHeaders.AUTHORIZATION屬性代碼示例

本文整理匯總了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));
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:17,代碼來源:DocumentsController.java

示例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");
    }
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:31,代碼來源:SupportController.java

示例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));
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:8,代碼來源:ClaimController.java

示例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);
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:8,代碼來源:ClaimController.java

示例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);
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:7,代碼來源:ClaimController.java

示例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);
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:14,代碼來源:OffersController.java

示例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);
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:13,代碼來源:OffersController.java

示例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);
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:13,代碼來源:OffersController.java

示例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);
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:12,代碼來源:DefendantResponseController.java

示例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);
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:10,代碼來源:CountyCourtJudgmentController.java

示例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());
}
 
開發者ID:making,項目名稱:spring-boot-actuator-dashboard,代碼行數:13,代碼來源:PseudoCloudController.java

示例12: retrieveUserDetails

@RequestMapping(method = RequestMethod.GET, value = "/details")
UserDetails retrieveUserDetails(@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:2,代碼來源:IdamApi.java

示例13: generatePin

@RequestMapping(method = RequestMethod.POST, value = "/pin")
GeneratePinResponse generatePin(
    GeneratePinRequest requestBody,
    @RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation
);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:5,代碼來源:IdamApi.java

示例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);
}
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:6,代碼來源:ClaimController.java


注:本文中的org.springframework.http.HttpHeaders.AUTHORIZATION屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。