Skip to content

Solução para desafio da ClickBus - spring webflux | r2dbc | slugify | validation

Notifications You must be signed in to change notification settings

matheusgmello/place-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Place Service

Aplicação desenvolvida com base no desafio da ClickBus. Baseia-se em uma API para fazer gereciamento de lugares.

Configurações

Requisitos

Localmente

  • Clone o repositório(git@github.com:matheusgmello/place-service.git)
  • Fazer a build do projeto(./mvnw clean package)
  • Executar o projeto(java -jar place-service/target/place-service-0.0.1-SNAPSHOT.jar)
  • Acesse a API em (localhost:8080)

Docker

  • Clone o repositório(git@github.com:matheusgmello/place-service.git)
  • Fazer a build do projeto(./mvnw clean package)
  • Faça a build da imagem(./mvnw spring-boot:build-image)
  • Suba o container(docker run --name place-service -p 8080:8080 -d place-service:0.0.1-SNAPSHOT)

Rotas

Durante a aplicação utilizei o httpie como Rest Client

POST /places

  • Faz a criação de um lugar.

Request Body

{
    "createdAt": "2023-04-20T19:00:07.241632",
    "name": "Place",
    "slug": "place",
    "state": "State",
    "updatedAt": "2023-04-20T19:00:07.241632"
}

GET /places/{id}

  • Faz a busca de um único local.
{
    "createdAt": "2023-06-07T14:45:39.693689",
    "name": "Place",
    "slug": "place",
    "state": "State",
    "updatedAt": "2023-06-07T14:45:39.693689"
} 

GET /places?name=?

  • Busca um local por nome.
[
    {
        "createdAt": "2023-06-07T14:45:39.693689",
        "name": "Place",
        "slug": "place",
        "state": "State",
        "updatedAt": "2023-06-07T14:45:39.693689"
    }
]

PATCH /places/{id}

  • Faz uma pequena alteração em um local.
{
    "createdAt": "2023-06-07T14:45:39.693689",
    "name": "New Name",
    "slug": "new-name",
    "state": "New State",
    "updatedAt": "2023-06-07T14:53:21.671129345"
}

Tecnologias

Práticas adotadas

  • SOLID
  • Testes automatizados
  • API reativa na web e na camada de banco
  • Uso de DTOs para a API
  • Injeção de Dependências
  • Geração de slugs automática com o Slugify
  • Auditoria sobre criação e atualização da entidade

🔗 Connect with me

LinkedIn Reddit GitHub

About

Solução para desafio da ClickBus - spring webflux | r2dbc | slugify | validation

Topics

Resources

Stars

Watchers

Forks

Languages