Let's start our coding to fulfill the preceding requirements. At first, we need to start with customer, CSR, and admin registration. As these users have different roles, we will give different user types for each user.
To differentiate users, we came up with three different user types so their authorization will be varied when they access our REST APIs. Here are the three different user types:
Name | User type |
General user/customer | 1 |
CSR | 2 |
Admin | 3 |
In our previous User
class, we only had the userid
and username
. We may need two more variables to fulfill the business requirements we mentioned earlier. We will add password
and usertype
to our existing User
class:
private String password; /* * usertype: * 1 - general user * 2 - CSR (Customer Service Representative) * 3 - admin */ private Integer usertype; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public void setUsertype...