Coder Social home page Coder Social logo

football-application-spring-boot's Introduction

Football API Application

About the project

Football Management API using Spring Boot

Prerequisites:

  • Spring Boot 3.2.5
  • JDK 11
  • Maven 3.9.6

API Documentation - /doc/open-api/

Club OpenAPI

openapi: 3.0.1
info:
  title: User Open API
  description: API to manage club and player information
  version: 1.0.0
servers:
  - url: http://localhost:8080/club

paths:
  /:
    post:
      summary: Create a new club
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ClubDTO"
      responses:
        200:
          description: Club created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClubDTO"
    get:
      summary: Get all the public clubs
      responses:
        200:
          description: Clubs retrieved successfully
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ClubDTO"
                type: array

  /{clubId}:
    get:
      summary: Get a club by Id
      parameters:
        - name: clubId
          in: path
          required: true
          schema:
            format: int64
            type: integer
      responses:
        200:
          description: Club retrieved successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClubDTO"
    put:
      summary: Update a club by Id
      parameters:
        - name: clubId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ClubDTO"
      responses:
        200:
          description: Club updated successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClubDTO"

  /{clubId}/player:
    post:
      summary: Add a player by clubId
      parameters:
        - name: clubId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PlayerDTO"
      responses:
        200:
          description: Player created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlayerDTO"
    get:
      summary: Get all the players by its clubId
      responses:
        200:
          description: Players retrieved successfully
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/PlayerDTO"
                type: array
  /{clubId}/player/{playerId}:
    get:
      summary: Get a player by its Id and club Id
      parameters:
        - name: clubId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: playerId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        200:
          description: Player retrieved successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlayerDTO"
    put:
      summary: Update a player by its Id and club Id
      parameters:
        - name: clubId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: playerId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PlayerDTO"
      responses:
        200:
          description: Player updated successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlayerDTO"
    delete:
      summary: Delete a player by its Id and clubId
      parameters:
        - name: clubId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: playerId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        204:
          description: Player deleted successfully
          content:
            application/json: { }
components:
  schemas:
    ClubDTO:
      type: object
      properties:
        clubId:
          type: number
          format: int64
        userName:
          type: string
          format: email
        password:
          type: string
          minLength: 8
        officialName:
          type: string
        popularName:
          type: string
        federation:
          type: string
          maxLength: 8
        public:
          type: boolean
        totalPlayers:
          type: integer
    PlayerDTO:
      type: object
      properties:
        playerId:
          type: integer
          format: int64
        givenName:
          type: string
        familyName:
          type: string
        nationality:
          type: string
        email:
          type: string
          format: email
        dateOfBirth:
          type: string
          format: date

User OpenAPI

openapi: 3.0.1
info:
  title: User Open API
  description: API to manage user information
  version: 1.0.0
servers:
  - url: http://localhost:8080/

paths:
  /login:
    post:
      summary: Create a new user
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UserDTO"
      responses:
        200:
          description: User created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokeDTO"
components:
  schemas:
    UserDTO:
      type: object
      properties:
        userName:
          type: string
          format: email
        password:
          type: string
          minLength: 8
    TokeDTO:
      type: object
      properties:
        accessToken:
          type: string

Note: In the case that a user inserts the Authentication Bearer Header, a 401 error status code will be thrown.

football-application-spring-boot's People

Contributors

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