Giter VIP home page Giter VIP logo

canaldenoticias's Introduction

Rotas de consumo da api

Buscar nome da equipe

http://localhost:8080/ajuda

Response body (200 OK)

{
    "nomes": "Daniel, Gean, Kauan, Silvio",
    "projeto": "Canal de notícias"
}

Cadastrar noticias

http://localhost:8080/news
{
    "news_title":"Titulo da noticias",
    "news_country":"Brasil",
    "news_date":"01/09/2024"
}

Response Body (201 Created)

{
    "news_id": 1,
    "news_title": "Titulo da noticias",
    "news_country": "Brasil",
    "news_date": "01/09/2024"
}

Exceptions (400 Bad Request)

{
    "status": "BAD_REQUEST",
    "message": "Titulo não pode estar vazio."
}
{
    "status": "BAD_REQUEST",
    "message": "País não pode estar vazio."
}
{
    "status": "BAD_REQUEST",
    "message": "Data não pode estar vazio"
}

Buscar todas as noticias ordenado por data mais recente.

http://localhost:8080/news

Response body (200 OK)

[
    {
        "news_id": 1,
        "news_title": "Titulo da noticias",
        "news_country": "Brasil",
        "news_date": "01/12/2024",
        "links": [
            {
                "rel": "self",
                "href": "http://localhost:8080/news/1"
            }
        ]
    },
    {
        "news_id": 2,
        "news_title": "Titulo da noticias",
        "news_country": "Brasil",
        "news_date": "01/10/2024",
        "links": [
            {
                "rel": "self",
                "href": "http://localhost:8080/news/2"
            }
        ]
    },
    {
        "news_id": 3,
        "news_title": "Titulo da noticias",
        "news_country": "Brasil",
        "news_date": "01/09/2024",
        "links": [
            {
                "rel": "self",
                "href": "http://localhost:8080/news/3"
            }
        ]
    }
]

Buscar noticia por id unico

http://localhost:8080/news/{id}

Response body (200 OK)

{
    "news_id": 1,
    "news_title": "Titulo da noticias",
    "news_country": "Brasil",
    "news_date": "01/12/2024",
    "links": [
        {
            "rel": "Todas as noticias",
            "href": "http://localhost:8080/news"
        }
    ]
}

Exeption (404 Not Found) Nenhum noticia com este id


Atualizar noticia por id unico

http://localhost:8080/news/{id}
{
    "news_title":"Titulo da noticias atualizado",
    "news_country":"Brasil",
    "news_date":"01/09/2024"
}

Response body (200 ok)

{
    "news_id": 1,
    "news_title": "Titulo da noticias atualizado",
    "news_country": "Brasil",
    "news_date": "01/09/2024"
}

Exceptions (400 Bad Request)

{
    "status": "BAD_REQUEST",
    "message": "Titulo não pode estar vazio."
}
{
    "status": "BAD_REQUEST",
    "message": "País não pode estar vazio."
}
{
    "status": "BAD_REQUEST",
    "message": "Data não pode estar vazio"
}

Deletar noticia por id

http://localhost:8080/news/{id}

Response (204 No Content)

Exception (404) Nenhum noticia com este id


Cadastrar esportes

http://localhost:8080/sport
{
    "sport_title":"Titulo",
    "sport_team":"Real Madrid",
    "sport_date":"01/01/2023"
}

Response Body (201 Created)

{
    "sport_id": 1,
    "sport_title": "Titulo",
    "sport_team": "Real Madrid",
    "sport_date": "01/01/2023"
}

Exceptions

{
    "status": "BAD_REQUEST",
    "message": "Campo titulo não pode estar vazio"
}
{
    "status": "BAD_REQUEST",
    "message": "Campo nome de time não pode estar vazio"
}
{
    "status": "BAD_REQUEST",
    "message": "O campo data não pode estar nulo"
}

Buscar todos os esportes ordenado por data da postagem

http://localhost:8080/sport

Response (200 OK)

[
    {
        "sport_id": 1,
        "sport_title": "Titulo",
        "sport_team": "Real Madrid",
        "sport_date": "01/09/2023",
        "links": [
            {
                "rel": "self",
                "href": "http://localhost:8080/sport/1"
            }
        ]
    },
    {
        "sport_id": 2,
        "sport_title": "Titulo",
        "sport_team": "Real Madrid",
        "sport_date": "01/01/2023",
        "links": [
            {
                "rel": "self",
                "href": "http://localhost:8080/sport/2"
            }
        ]
    }
]

Buscar postagem de esporte por id

http://localhost:8080/sport/{id}

Response body (200 OK)

{
    "sport_id": 1,
    "sport_title": "Titulo",
    "sport_team": "Real Madrid",
    "sport_date": "01/09/2023",
    "links": [
        {
            "rel": "Lista de esportes",
            "href": "http://localhost:8080/sport"
        }
    ]
}

Atualizar postagem de esporte por id

http://localhost:8080/sport/{id}
{
    "sport_title":"Titulo",
    "sport_team":"Real Madrid",
    "sport_date":"01/01/2023"
}

Response body (200 OK)

{
    "sport_id": 1,
    "sport_title": "Titulo atualizado",
    "sport_team": "Real Madrid",
    "sport_date": "01/01/2023"
}

Exceptions (400 Bad Request)

{
    "status": "BAD_REQUEST",
    "message": "Campo titulo não pode estar vazio"
}
{
    "status": "BAD_REQUEST",
    "message": "Campo nome de time não pode estar vazio"
}
{
    "status": "BAD_REQUEST",
    "message": "O campo data não pode estar nulo"
}

Deletar postagem de esporte por id

http://localhost:8080/sport/1

Response (204 Not Content)

canaldenoticias's People

Contributors

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