Skip to content

0xprasanth/taskmgmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Management using REST API

A simple task management application using Spring boot that performs CRUD operations using REST controller

CRUD

CRUD stands for Create, Read, Update and Delete. As the name suggests it performs the related operations on the relational database and mapped to standard HTTP method.

Operations

Get All Tasks

    @GetMapping("/alltasks")
    public List<Task> getAllTasks() {
        return taskService.getAllList();
    }

Get all tasks stored by a Get Mapping method all tasks

Get Task by ID

    @RequestMapping("/getTask")
    public Task getTask(@RequestParam("id") Integer id) {
        return taskService.getTask(id);
    }

Get a task by an id parameter id

Save a Task

    @PostMapping(value="/saveTask")
    public void createTask(@RequestBody Task task) {
        taskService.createTask(task);
    }

The save task method uses post mapping. It gets a task body as an input and stores into the DB. save task After saving new Task new save task

Change Status

    @RequestMapping(value = "/changeStatus", method = RequestMethod.PUT)
    public void updateStatus(@RequestParam("id") Integer id,  @RequestBody Task task ) { 
        taskService.updateStatus(id, task);
    }

The Change status method uses PUT method to update the status of the task by getting id as a parameters and the whole task body as input. Change Task Before Change Task Before Change Task After Change Task After Change Task

Delete Task

    @DeleteMapping(value = "/deleteTask")
    public void deleteTask(@RequestParam("id") Integer id) { 
        taskService.deleteTask(id);
    }

About

A simple Task Management app using spring boot and to demonstrate REST api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages