I use micro service in spring boot with Restful services so i have
- Authentication Service app
- Main Service app
The entity that I have in Authentication Service
public class User implements Serializable {
private int userId;
private String firstname;
private String lastname;
private String email;
private String password;
}
I need to display username in my UI page using userId.
For every UI in Main Service app i can not make a one rest call to get user firstname.
so in this case i would like to have User entity in both service and it will point to same database user table and Authentication Service app has full access to user table like add user, login, delete user but in Main Service app i want fetch user firstname alone using userId.
Here i confused in designing user entity in Main Service app.
- What are the field that i need to have in user entity of Main Service app
- Can I have Id field(I feel it is not required)?