Skip to content

gdurazzo/quero-ser-clickbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Crud api Project

Description

Inside the solution folder, there is a SpringBoot project using MongoDb, it has the basic functionality of list, register, update and delete Places in the database. The Project has already created two places registered in the database.

Testing environment

REST Resource

GET /places

  • Will return the list of registered places

Response Body example:

[
  {
    "city": "string",
    "createdAt": "string",
    "id": "string",
    "name": "string",
    "slug": "string",
    "state": "string",
    "updatedAt": "string",
  }
]

GET /places/cities

  • Will return to list of registered places filtered by cities

Path parameters Parameter:city Description:city Parameter Type:query Data Type:String

Response Body example:

[
  {
    "city": "string",
    "createdAt": "string",
    "id": "string",
    "name": "string",
    "slug": "string",
    "state": "string",
    "updatedAt": "string",
  }
]

GET /places/filter/{slug}

  • Will return to list of registered places filtered by name(or a part of the name)

Path parameters Parameter:slug Description:place name in slug format Parameter Type:path Data Type:String

Response Body example:

[
  {
    "city": "string",
    "createdAt": "string",
    "id": "string",
    "name": "string",
    "slug": "string",
    "state": "string",
    "updatedAt": "string",
  }
]

GET /places/placename

-Will return a place object Path parameters Parameter:name Description:Place name Parameter Type:query Data Type:String

Response Body example:
 {
    "city": "string",
    "createdAt": "string",
    "id": "string",
    "name": "string",
    "slug": "string",
    "state": "string",
    "updatedAt": "string",
}

-#GET /places/{id} Will return a place dto, selected by id

Path parameters Parameter:id Description:the place id on database Parameter Type:path Data Type:String

Response Body example:

{
  "city": "string",
  "name": "string",
  "state": "string"
}

POST /places

  • Will insert a place dto

Request Body Example:

{
  "city": "string",
  "name": "string",
  "state": "string"
}

Response Body no content

DELETE /places/{id}

  • Will delete a place in database

Path parameters Parameter:id Description:the place id on database Parameter Type:path Data Type:String

PUT /places/{id}

  • Will update Place by id

Path parameters Parameter:id Description:the place id on database Parameter Type:path Data Type:String

Response Body example:

{
  "city": "string",
  "name": "string",
  "state": "string"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published