Code Monkey home page Code Monkey logo

discovery_mars_2's Introduction

discovery_mars

Objetivo

Explorar o planeta Marte utilizando sondas espaciais

Como funciona?

Um conjunto de sondas é enviado pela NASA à Marte e irá pousar num planalto. Logo após as sondas terem pousado em Marte, é possivel movimenta-las através de requisições via API.

Documentação da API

Criar um planalto.

POST /api/v1/planalto

Exemplo

curl -X POST \
  /api/v1/planalto \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 4daf8457-2e22-0102-f03e-de27d8ba88df' \
  -d '{
    "coordenadas": {
      "x": 5,
      "y": 5
   }
}'

Response

{
    "Planalto": {
        "id": 1,
        "coordenadas": {
            "x": 5,
            "y": 5
        },
        "sondas": []
    }
}

Consultar um planalto.

GET /api/v1/planalto/1

Exemplo

curl -X GET \
  /api/v1/planalto/1 \
  -H 'cache-control: no-cache' \
  -H 'postman-token: 5e7d4a64-1ef6-506e-6bfd-4573aa80ef9c'

Response

{
    "Planalto": {
        "id": 1,
        "coordenadas": {
            "x": 5,
            "y": 5
        },
        "sondas": []
    }
}

Implantar uma sonda no Planalto.

PACH /api/v1/planalto/1/sonda

Exemplo

curl -X PATCH \
  /api/v1/planalto/1/sonda \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 1b2a546f-7e46-0401-4ebc-9652a1788c7c' \
  -d '{
	"direcao": "N",
	"coordenadas": {
		"x": 1,
		"y": 2
	}
}'

Response

{
    "Planalto": {
        "id": 1,
        "coordenadas": {
            "x": 5,
            "y": 5
        },
        "sondas": [
            {
                "Sonda": {
                    "id": 1,
                    "coordenadas": {
                        "x": 1,
                        "y": 2
                    },
                    "direcao": "N"
                }
            }
        ]
    }
}

Buscar uma Sondao.

GET /api/v1/sonda/1

Exemplo

curl -X GET \
  /api/v1/sonda/1 \
  -H 'cache-control: no-cache' \
  -H 'postman-token: 43b8b511-cd9f-7faa-885b-21561ced2834'

Response

{
    "Sonda": {
        "id": 1,
        "coordenadas": {
            "x": 1,
            "y": 2
        },
        "direcao": "N"
    }
}

Mover uma Sonda.

PATCH /api/v1/sonda/1

Exemplo

curl -X PATCH \
  /api/v1/sonda/1 \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: dccebdee-9fa3-18b6-8f1b-47ccb754b64c' \
  -d '{
	"comandos": ["L","M","L","M","L","M","L","M","M"]
}'

Response

{
    "Sonda": {
        "id": 1,
        "coordenadas": {
            "x": 1,
            "y": 3
        },
        "direcao": "N"
    }
}

Requisitos

  • Java 8
  • maven

discovery_mars_2's People

Contributors

antoniobsn avatar

Watchers

James Cloos avatar  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.