generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from hmcts/feature/civ-7745
Add common code from civil-service
- Loading branch information
Showing
139 changed files
with
7,276 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
src/main/java/uk/gov/hmcts/reform/ccd/client/CaseAccessDataStoreApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package uk.gov.hmcts.reform.ccd.client; | ||
|
||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
import uk.gov.hmcts.reform.ccd.model.AddCaseAssignedUserRolesRequest; | ||
import uk.gov.hmcts.reform.ccd.model.AddCaseAssignedUserRolesResponse; | ||
import uk.gov.hmcts.reform.ccd.model.CaseAssignedUserRolesRequest; | ||
import uk.gov.hmcts.reform.ccd.model.CaseAssignedUserRolesResource; | ||
|
||
import java.util.List; | ||
|
||
import static org.springframework.http.HttpHeaders.AUTHORIZATION; | ||
import static uk.gov.hmcts.reform.ccd.client.CoreCaseDataApi.SERVICE_AUTHORIZATION; | ||
|
||
@FeignClient(name = "ccd-access-data-store-api", url = "${core_case_data.api.url}", | ||
configuration = CoreCaseDataConfiguration.class) | ||
public interface CaseAccessDataStoreApi { | ||
|
||
@PostMapping( | ||
value = "/case-users", | ||
consumes = MediaType.APPLICATION_JSON_VALUE | ||
) | ||
@ResponseBody | ||
AddCaseAssignedUserRolesResponse addCaseUserRoles( | ||
@RequestHeader(AUTHORIZATION) String authorisation, | ||
@RequestHeader(SERVICE_AUTHORIZATION) String serviceAuthorization, | ||
@RequestBody AddCaseAssignedUserRolesRequest caseRoleRequest | ||
); | ||
|
||
@GetMapping( | ||
value = "/case-users", | ||
produces = MediaType.APPLICATION_JSON_VALUE | ||
) | ||
@ResponseBody | ||
CaseAssignedUserRolesResource getUserRoles( | ||
@RequestHeader(AUTHORIZATION) String authorisation, | ||
@RequestHeader(SERVICE_AUTHORIZATION) String serviceAuthorization, | ||
@RequestParam("case_ids") List<String> caseIds | ||
); | ||
|
||
@DeleteMapping( | ||
value = "/case-users", | ||
consumes = MediaType.APPLICATION_JSON_VALUE | ||
) | ||
@ResponseBody | ||
AddCaseAssignedUserRolesResponse removeCaseUserRoles( | ||
@RequestHeader(AUTHORIZATION) String authorisation, | ||
@RequestHeader(SERVICE_AUTHORIZATION) String serviceAuthorization, | ||
@RequestBody CaseAssignedUserRolesRequest caseRoleRequest | ||
); | ||
} |
Oops, something went wrong.