Create a secured restful API to create and list articles. To create an article the user should provide a title, author, content and the date published. All the properties are mandatory. The title should not exceed 100 characters and the publishing date should be provided in ISO 8601 format. The endpoint for the article list should return paginated results.
Additionally, you are required to develop an endpoint for statistics that would be accessible only by admins. The endpoint should return the count of published articles on daily bases for the last 7 days.
1 APIs are restricted with the spring security.
2 Authorized user's can create Articles.
This application contains 3 api's
Use the following credentials to log in ( 2 roles | Only the user role 'ADMIN' can access '/statistic' end point) Check application.properties file
User
- username: "pramodaya"
- password: "password"
Admin
- username: "john"
- password: "password"
Method - GET http://localhost:8080/api/v1/article This will return follwowing result with success code 200.
Method - POST http://localhost:8080/api/v1/article/add This will return following status code 200 if succeeded.
Method - GET http://localhost:8080/api/v1/article/statistic This will return following result if the user is not an admin:
If the validation is succeeded with spring security it'll give following result:





