Coder Social home page Coder Social logo

labone's Introduction

labone

Spring boot Rest API implementation, DTO, service layer and domain model.
LAB 1

This lab you will create a spring boot application from scratch. This will help you practice more and get a better grip of designing a n-tier web application. You should implement the following: 1- Make a domain model using the domain model. public class Post {

long id;
String title;
String content;
String author;

}

2- Make a repository with a fake database (using an ArrayList). This database will hold the Posts. 3- Make a service layer that will inject the repository. 4- Make a RestController that will inject the service and respond to the following requests. a. GET localhost:8080/posts/  This should retrieve all the posts in the database. b. GET localhost:8080/posts/1  This should retrieve the post with id = 1. c. POST localhost:8080/posts/  This should create and save a new post.

Note:

  • 1 is just an example, the actual path should ask for ‘id’
  • Make sure all your data are passed with Dtos
  • Follow the n-tier architecture

Optional

d. DELETE ocalhost:8080/posts/1  This should delete the post where id = 1. e. UPDATE localhost:8080/posts/1  This should update the post where id = 1.

a. Make another version of your api using a ‘customized header’ that will retrieve another version of the Post domain model, as the following: b. Apply the ModelMapper when you are passing your dtos c. Create a filter endpoint that will retrieve all Posts made by an ‘author’ (query parameter) – You may apply any standard if it is structured and manageable.

public class PostV2 {

long id;
String title;
String content;
String author;

} Make sure you execute these requests using postman.

labone's People

Contributors

kiduskebede avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.