-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
story(ccls-1956) get/put application correspondence address
- Loading branch information
1 parent
9d56b8c
commit a80b0c8
Showing
10 changed files
with
265 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ paths: | |
schema: | ||
$ref: '#/components/schemas/applicationDetail' | ||
parameters: | ||
- name: 'Caab-user-Login-Id' | ||
- name: 'Caab-User-Login-Id' | ||
in: header | ||
required: true | ||
schema: | ||
|
@@ -91,13 +91,13 @@ paths: | |
description: 'Not found' | ||
'500': | ||
description: 'Internal server error' | ||
patch: | ||
put: | ||
tags: | ||
- applications | ||
summary: 'patch application type' | ||
operationId: 'patchApplicationType' | ||
summary: 'put application type' | ||
operationId: 'putApplicationType' | ||
requestBody: | ||
description: patch an application's application type | ||
description: put an application's application type | ||
content: | ||
application/json: | ||
schema: | ||
|
@@ -110,7 +110,7 @@ paths: | |
type: 'integer' | ||
format: 'int64' | ||
example: '1234567890' | ||
- name: 'Caab-user-Login-Id' | ||
- name: 'Caab-User-Login-Id' | ||
in: header | ||
required: true | ||
schema: | ||
|
@@ -156,13 +156,13 @@ paths: | |
description: 'Not found' | ||
'500': | ||
description: 'Internal server error' | ||
patch: | ||
put: | ||
tags: | ||
- applications | ||
summary: 'patch an applications provider details' | ||
operationId: 'patchApplicationProviderDetails' | ||
summary: 'put an applications provider details' | ||
operationId: 'putApplicationProviderDetails' | ||
requestBody: | ||
description: patch an application's application type | ||
description: put an application's application type | ||
content: | ||
application/json: | ||
schema: | ||
|
@@ -175,7 +175,72 @@ paths: | |
type: 'integer' | ||
format: 'int64' | ||
example: '1234567890' | ||
- name: 'Caab-user-Login-Id' | ||
- name: 'Caab-User-Login-Id' | ||
in: header | ||
required: true | ||
schema: | ||
type: 'string' | ||
example: '[email protected]' | ||
responses: | ||
'200': | ||
description: 'Successful operation' | ||
'400': | ||
description: 'Bad request' | ||
'401': | ||
description: 'Unauthorized' | ||
'404': | ||
description: 'Not found' | ||
'500': | ||
description: 'Internal server error' | ||
/applications/{id}/correspondence-address: | ||
get: | ||
tags: | ||
- applications | ||
summary: 'get an applications correspondence address' | ||
operationId: 'getApplicationCorrespondenceAddress' | ||
parameters: | ||
- name: 'id' | ||
in: 'path' | ||
required: true | ||
schema: | ||
type: 'integer' | ||
format: 'int64' | ||
example: '1234567890' | ||
responses: | ||
'200': | ||
description: 'Successful operation' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/address" | ||
'400': | ||
description: 'Bad request' | ||
'401': | ||
description: 'Unauthorized' | ||
'404': | ||
description: 'Not found' | ||
'500': | ||
description: 'Internal server error' | ||
put: | ||
tags: | ||
- applications | ||
summary: 'put an applications correspondence address' | ||
operationId: 'putApplicationCorrespondenceAddress' | ||
requestBody: | ||
description: put an application's correspondence address | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/address' | ||
parameters: | ||
- name: 'id' | ||
in: 'path' | ||
required: true | ||
schema: | ||
type: 'integer' | ||
format: 'int64' | ||
example: '1234567890' | ||
- name: 'Caab-User-Login-Id' | ||
in: header | ||
required: true | ||
schema: | ||
|
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
27 changes: 27 additions & 0 deletions
27
caab-service/src/main/java/uk/gov/laa/ccms/caab/api/advice/AuditAdvice.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,27 @@ | ||
package uk.gov.laa.ccms.caab.api.advice; | ||
|
||
import static uk.gov.laa.ccms.caab.api.audit.AuditorAwareImpl.currentUserHolder; | ||
|
||
import org.springframework.web.bind.annotation.ControllerAdvice; | ||
import org.springframework.web.bind.annotation.ModelAttribute; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
|
||
/** | ||
* Controller advice class responsible for setting the current user holder if available. | ||
*/ | ||
@ControllerAdvice | ||
public class AuditAdvice { | ||
|
||
/** | ||
* Sets the current user holder if available from the request header. | ||
* | ||
* @param caabUserLoginId the caab user login id | ||
*/ | ||
@ModelAttribute | ||
public void setCurrentUserHolderIfAvailable( | ||
@RequestHeader(value = "Caab-User-Login-Id", required = false) String caabUserLoginId) { | ||
if (caabUserLoginId != null) { | ||
currentUserHolder.set(caabUserLoginId); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.