当前位置: 首页>>代码示例>>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;未经允许,请勿转载。