A Java-based web application that utilizes the Spring Boot framework for backend development. It
features a RESTful API for managing code snippets, which are stored as entities in a database.
The application supports operations such as retrieving a specific code snippet by its UUID, and
fetching the latest code snippets. Each code snippet entity has properties such as time of creation,
time restriction, view restriction, and last accessed time.
The application also includes exception handling for scenarios such as invalid UUID or exceeding
view restrictions.
POST
/api/code/new
name type data type description code required string Secret code time required int Time in seconds views required int Number of views
{
"code": "Secret code",
"time": 60,
"views": 5
}
http://localhost:8889/api/code/new
Code Description 200 OK
{
"id": uuid
}
GET
/code/{id}
name type data type description id required string id
http://localhost:8889/code/{id}
Code Description 200 OK
Note: HTML will be returned.
GET
/api/code/{id}
http://localhost:8889/api/code/{id}
name type data type description id required string id
Code Description 200 OK
{
"code": string,
"date": date type,
"time": int,
"views": int
}
GET
/api/code/latest
No parameters
http://localhost:8889/api/code/latest
Code Description 200 OK
Notes: this endpoint return json object of all codes.
{
"code": string,
"date": date type,
"time": int,
"views": int
}
GET
/code/latest
No parameters
http://localhost:8889/code/latest
Code Description 200 OK
Notes: this endpoint return HTML of all codes.
GET
/code/new
No parameters
http://localhost:8889/code/new
Code Description 200 OK
Notes: this endpoint return a form to input code.