-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable user service to communicate with the core service (#377)
* Add spring openfeign dependency to user service * Enable user service to communicate with core service * Remove unused code from shared library * Add rest-client.svg to the draw.io library * Update challenge-library.xml * Update draw.io lib * Update .gitignore * Added challenge-user-service-requests.drawio.svg * Update challenge-user-service-requests.drawio.svg * Rename java shared library * Cleanup UserController * Minor update * Update challenge db config * Fix db connection * Rename mariadb tables * Update mariadb config for core service * Added data-model.drawio.svg * Update data-model.drawio.svg * Update data-model.drawio.svg * Make request via API gateway * Update data-model.drawio.svg
- Loading branch information
1 parent
5cdcea2
commit 897f711
Showing
45 changed files
with
226 additions
and
188 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
SERVICE_REGISTRY_URL=http://challenge-service-registry:8081/eureka | ||
DB_URL=jdbc:mysql://challenge-mariadb:3306/challenge_core_service | ||
DB_URL=jdbc:mysql://challenge-mariadb:3306/challenge |
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
1 change: 1 addition & 0 deletions
1
...vice/src/main/java/org/sagebionetworks/challenge/model/mapper/ChallengeAccountMapper.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
1 change: 1 addition & 0 deletions
1
...nge-core-service/src/main/java/org/sagebionetworks/challenge/model/mapper/UserMapper.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
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
6 changes: 3 additions & 3 deletions
6
...challenge-core-service/src/main/resources/db/migration/V1.0.20210427174721__temp_data.sql
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
24 changes: 12 additions & 12 deletions
24
apps/challenge-mariadb/docker-entrypoint-initdb.d/init-db.sql
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
create database challenge; | ||
create role challenge_role_admin; | ||
grant all on challenge.* to challenge_role_admin; | ||
|
||
-- maria | ||
grant challenge_role_admin to maria; | ||
set default role challenge_role_admin for maria; | ||
|
||
-- challenge-core-service | ||
create user challenge_core_service identified by 'changeme'; | ||
create role challenge_core_service_role_admin; | ||
create database challenge_core_service; | ||
|
||
grant all on challenge_core_service.* to challenge_core_service_role_admin; | ||
grant challenge_core_service_role_admin to challenge_core_service; | ||
set default role challenge_core_service_role_admin for challenge_core_service; | ||
grant challenge_role_admin to challenge_core_service; | ||
set default role challenge_role_admin for challenge_core_service; | ||
|
||
-- challenge-user-service | ||
create user challenge_user_service identified by 'changeme'; | ||
create role challenge_user_service_role_admin; | ||
create database challenge_user_service; | ||
|
||
grant all on challenge_user_service.* to challenge_user_service_role_admin; | ||
grant challenge_user_service_role_admin to challenge_user_service; | ||
set default role challenge_user_service_role_admin for challenge_user_service; | ||
grant challenge_role_admin to challenge_user_service; | ||
set default role challenge_role_admin for challenge_user_service; |
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 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
12 changes: 5 additions & 7 deletions
12
...e-user-service/src/main/java/org/sagebionetworks/challenge/controller/UserController.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
8 changes: 8 additions & 0 deletions
8
...e-user-service/src/main/java/org/sagebionetworks/challenge/exception/GlobalErrorCode.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,8 @@ | ||
package org.sagebionetworks.challenge.exception; | ||
|
||
public class GlobalErrorCode { | ||
public static final String ERROR_ENTITY_NOT_FOUND = "CHALLENGE-USER-SERVICE-1000"; | ||
public static final String ERROR_EMAIL_REGISTERED = "CHALLENGE-USER-SERVICE-1001"; | ||
public static final String ERROR_INVALID_EMAIL = "CHALLENGE-USER-SERVICE-1002"; | ||
public static final String ERROR_USER_NOT_FOUND_UNDER_NIC = "CHALLENGE-USER-SERVICE-1003"; | ||
} |
7 changes: 7 additions & 0 deletions
7
.../src/main/java/org/sagebionetworks/challenge/exception/InvalidChallengeUserException.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,7 @@ | ||
package org.sagebionetworks.challenge.exception; | ||
|
||
public class InvalidChallengeUserException extends SimpleChallengeGlobalException { | ||
public InvalidChallengeUserException(String message, String code) { | ||
super(message, code); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...-service/src/main/java/org/sagebionetworks/challenge/exception/InvalidEmailException.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,7 @@ | ||
package org.sagebionetworks.challenge.exception; | ||
|
||
public class InvalidEmailException extends SimpleChallengeGlobalException { | ||
public InvalidEmailException(String message, String code) { | ||
super(message, code); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...src/main/java/org/sagebionetworks/challenge/exception/SimpleChallengeGlobalException.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,20 @@ | ||
package org.sagebionetworks.challenge.exception; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class SimpleChallengeGlobalException extends RuntimeException { | ||
|
||
private String code; | ||
private String message; | ||
|
||
public SimpleChallengeGlobalException(String message) { | ||
super(message); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...src/main/java/org/sagebionetworks/challenge/exception/UserAlreadyRegisteredException.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,7 @@ | ||
package org.sagebionetworks.challenge.exception; | ||
|
||
public class UserAlreadyRegisteredException extends SimpleChallengeGlobalException { | ||
public UserAlreadyRegisteredException(String message, String code) { | ||
super(message, code); | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
...nge-user-service/src/main/java/org/sagebionetworks/challenge/model/mapper/UserMapper.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
13 changes: 13 additions & 0 deletions
13
...vice/src/main/java/org/sagebionetworks/challenge/model/rest/response/AccountResponse.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,13 @@ | ||
package org.sagebionetworks.challenge.model.rest.response; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class AccountResponse { | ||
private String number; | ||
private Integer id; | ||
private String type; | ||
private String status; | ||
} |
16 changes: 16 additions & 0 deletions
16
...service/src/main/java/org/sagebionetworks/challenge/model/rest/response/UserResponse.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,16 @@ | ||
package org.sagebionetworks.challenge.model.rest.response; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
public class UserResponse { | ||
private String firstName; | ||
private String lastName; | ||
private List<AccountResponse> challengeAccounts; | ||
private String identificationNumber; | ||
private Integer id; | ||
private String email; | ||
} |
Oops, something went wrong.