Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I your application you need to let users perforn the following operations on tasks: ( 1 ) create,read,update,delete; ( 2 ) describe; ( 3 )
I your application you need to let users perforn the following operations on tasks: create,read,update,delete; describe; get all; describe all. Requirements Create one: Request URL:task Method:POST Payloadexample:title:"Task"description":"Some description" Response Status: Bodyexample Comments Duringcreation you can only set the title and description of a Task Response body is the id of the newly created Task Read One: Request URL:taskid Method:GET Response Scenario :Task found Status: Bodyexample: id:"title":"Task"description":"Some description","status":"CREATED" Scenario :Task Not found Status: Update One: Request URL:taskid Method:PUT Payloadexample:title:"Task"description":"New description","status":"BLOCKED" Response Scenario :Task found Status: Scenario :Task not found Status: Scenario :Invalid status given Status: Body:Available statuses are: CREATED,APPROVAL,REJECTED,BLOCKED,DONE Additional requirements: Payload does not have to contain values for all fields.Modify only those that are different from null. Delete One: Request URL:taskid Method:DELETE Response Scenario :Task found Status: Scenario :Task not found Status: Describe one: Request URL:taskdescribeid Method:GET Response Scenario :Task found Status: Bodyexample: Description of Task:Name is:Some description" Scenario :Task not found Status: Bodyexample: Task with id does not exist" Find all tasks: Request URL:tasks Method:GET Response Status: Bodyexample: id:"title":"Task"description":"Some description","status":"CREATED" id:"title":"Task"description":"Another description","status":"CREATED" Describe all tasks: Request URL:tasksdescribe Method:GET Response Status: Bodyexample: Description of Task :Task is:Some description","Description of Task :Task is:Another description" TaskRepository.java import org.springframework.data.repository.CrudRepository; public interface TaskRepository extends CrudRepository Task.java @Entity public class Task @Id @GeneratedValue private Long id; private String title; private String description; private TaskStatus status CREATED; public TaskDto toDto return new TaskDtoStringvalueOfidtitle. TaskDto.java public class TaskDto private String id;private String title;private String description;private String status; TaskStatus.java public enum TaskStatus CREATEDAPPROVED,REJECTED,BLOCKED,DONE TaskController.java all End point need implement
I your application you need to let users perforn the following operations on tasks:
create,read,update,delete;
describe;
get all;
describe all.
Requirements
Create one:
Request
URL:task
Method:POST
Payloadexample:title:"Task"description":"Some description"
Response
Status:
Bodyexample
Comments
Duringcreation you can only set the title and description of a Task
Response body is the id of the newly created Task
Read One:
Request
URL:taskid
Method:GET
Response
Scenario :Task found
Status:
Bodyexample:
id:"title":"Task"description":"Some description","status":"CREATED"
Scenario :Task Not found
Status:
Update One:
Request
URL:taskid
Method:PUT
Payloadexample:title:"Task"description":"New description","status":"BLOCKED"
Response
Scenario :Task found
Status:
Scenario :Task not found
Status:
Scenario :Invalid status given
Status:
Body:Available statuses are:
CREATED,APPROVAL,REJECTED,BLOCKED,DONE
Additional requirements:
Payload does not have to contain values for all fields.Modify only those that are different from null.
Delete One:
Request
URL:taskid
Method:DELETE
Response
Scenario :Task found
Status:
Scenario :Task not found
Status:
Describe one:
Request
URL:taskdescribeid
Method:GET
Response
Scenario :Task found
Status:
Bodyexample:
Description of Task:Name is:Some description"
Scenario :Task not found
Status:
Bodyexample:
Task with id does not exist"
Find all tasks:
Request
URL:tasks
Method:GET
Response
Status:
Bodyexample:
id:"title":"Task"description":"Some description","status":"CREATED"
id:"title":"Task"description":"Another description","status":"CREATED"
Describe all tasks:
Request
URL:tasksdescribe
Method:GET
Response
Status:
Bodyexample:
Description of Task :Task is:Some description","Description of Task :Task is:Another description"
TaskRepository.java
import org.springframework.data.repository.CrudRepository;
public interface TaskRepository extends CrudRepository
Task.java
@Entity
public class Task
@Id
@GeneratedValue
private Long id;
private String title;
private String description;
private TaskStatus status CREATED;
public TaskDto toDto
return new TaskDtoStringvalueOfidtitle.
TaskDto.java
public class TaskDto private String id;private String title;private String description;private String status;
TaskStatus.java
public enum TaskStatus CREATEDAPPROVED,REJECTED,BLOCKED,DONE
TaskController.java
all End point need implement
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started