Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Building RESTful Web Services with Spring 5

You're reading from   Building RESTful Web Services with Spring 5 Leverage the power of Spring 5.0, Java SE 9, and Spring Boot 2.0

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher Packt
ISBN-13 9781788475891
Length 228 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Raja CSP Raman Raja CSP Raman
Author Profile Icon Raja CSP Raman
Raja CSP Raman
 Dewailly Dewailly
Author Profile Icon Dewailly
Dewailly
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
1. A Few Basics FREE CHAPTER 2. Building RESTful Web Services in Spring 5 with Maven 3. Flux and Mono (Reactor Support) in Spring 4. CRUD Operations in Spring REST 5. CRUD Operations in Plain REST (Without Reactive) and File Upload 6. Spring Security and JWT (JSON Web Token) 7. Testing RESTful Web Services 8. Performance 9. AOP and Logger Controls 10. Building a REST Client and Error Handling 11. Scaling 12. Microservice Basics 13. Ticket Management – Advanced CRUD 1. Other Books You May Enjoy Index

Registration


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.

User types

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

User POJO

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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images