Solução utilizando Python 3 e o framework Django 2.1 para o code-challenge: https://github.com/ZXVentures/code-challenge/blob/master/backend.md
Para executar localmente é necessário ter instalado o Docker e o Docker Compose.
Com o Docker Compose instalado, basta acessar o diretório do projeto code_challenge_backend
e executar o comando:
$ docker-compose up
Após isso a aplicação será executada em http://localhost:8000.
- Para criar um PDV, é necessário utilizar o método
POST
, enviando os dados no endpointapi/pdv
- Para recuperar um PDV, basta colocar o
id
do PDV no endpointapi/pdv/[id]
. Exemplo: http://localhost:8000/api/pdv/7/ - Para pesquisar o PDV mais próximo de uma
lat
elng
, alat
e alng
são passadas através de parâmetros no endpointapi/search-pdv/?lat=[lat]&lng=[lng]
. Exemplo: http://localhost:8000/api/search-pdv/?lat=-23.6823&lng=-46.6298