Giter VIP home page Giter VIP logo

post-comment's Introduction

Blog Engine powered by Spring Boot

Introduction

This project is a simple REST application for serving a blog. It uses Spring Boot, Spring Data JPA and some other helper libraries.

Problem Statement

Currently, application can only serve blog post details by executing GET request at /posts/{id}, where {id} is a post identifier.

Your task is to add comments feature. The application should be able to serve two new kinds of requests:

  • POST at /posts/{id}/comments which should:

    • Save a new comment with current date and time for post with passed {id}
    • Return 201 Created if comment is created successfully for post with passed {id}
    • Return 404 Not Found if post with passed {id} does not exist
  • GET at /posts/{id}/comments which should:

    • Return all comments sorted by creation date in descending order for a post with passed {id}
    • Return empty list if a post with passed {id} does not exists or when it does not contain any comments

There is a service class CommentService that you should implement. See contents of that class to see detailed requirements. For each method, there is a javadoc comment that describes expected behavior.

There are some tests that are currently failing and your solution should satisfy these tests requirements. Remember that provided tests verify the functional correctness, however, you should remember to fulfill all best practices as well.

Hints

Feel free to create new and modify existing files. You can add some new dependencies if you will, to do so just modify appropriate pom.xml. Do not change unit tests, however.

Please follow conventions used in this project.

Good Luck!

post-comment's People

Contributors

javed2447 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.