Skip to content

KEmreAkkaya/SpringRestAPIExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringRestAPIExample


##Spring Rest API Example##
This project includes REST API example using Java and Spring Framework.
In this project ,Postman App was used to create user,login etc.
MySQL/MySQL WorkBench was used to store and show data.
Also Swagger was used to create automatic documentation, code generation and test case build.


  • When you start the project , it will create admin user and regular user to login like this

  • You will see this line in a different way.

    Created admin6042938019390559721@test.com and Password:123
    Created user7067998864034308207@test.com and Password:123


    At first, If you want to see sign-in page how it works ( localhost:8080/users/login ) ,you can use Postman to sign-in with this code snippet


    (DO NOT FORGET!) You must use POST HTTP method to sign-in in Postman.

    {"email": "admin6042938019390559721@test.com", "password": "123" }


  • When you login your account (admin or user) , WebService creates Authorization Token and UserId to use CRUD operations.

  • You can use the following code snippet to create regular user in Postman ,when you authenticated and authorized.

    {"firstName": "Emre",
    "lastName": "Akkaya",
    "email": "user123456@test.com",
    "password": "123",
    "addresses":[
        {
          "city":"Samsun" ,
          "country": "Turkey" ,
          "streetName": "Gazipasa" ,
          "postalCode" : "55100"  ,
          "type" :"Billing"
        },
        
        {
          "city":"Samsun" ,
          "country": "Turkey" ,
          "streetName": "Gazipasa" ,
          "postalCode" : "55100"  ,
          "type" :"Shipping"
    
        }
    ]
    }
    

    If you want to see this application what it does,you can check and test this app in swagger-ui.
    NOTE: You must change from HTTPS to HTTP at Schemes to use SWAGGER-UI. Project is not working with SSL

    About

    Spring Rest API Example

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages