Skip to content

CyxouD/blackjack

 
 

Repository files navigation

BlackJack REST service

BlackJack API:

Objects:

  • User:
  • Table:

Urls:

  • Account:
        URL: /account
        TYPE: POST
        BODY: JSON
            {
                "login": "your_login",
                "nickName": "your_nickname",
                "password": "pass"
            }
        EFFECT: Create new user with start balance $10_000 in database
        RESPONSE: JSON
            {   
                "status": 0 or -1,     
                "message": "status message"
            }
            
        URL: /account/login
        TYPE: POST
        BODY: JSON
            {
                "login": "login",
                "password": "password"
            }
        EFFECT: User info like login, nickname, balance
        RESPONSE: JSON
            {
                "nickName": "NickName",
                "balance": 10000
            }
            
        URL: /account/{login}
        TYPE: DELETE
        BODY: NONE
        EFFECT: Delete user from database
        RESPONSE:  JSON
            {
                "status": 0 or -1,     
                "message": "status message"
            }
       
  • Table:
        URL: /account/{login}/select-table
        TYPE: GET
        BODY: NONE
        EFFECT: Gets the available tables types
        RESPONSE:  JSON
            [
                {
                    "id": 1,
                    "minBetSize": 10,
                    "maxBetSize": 100
                },
                ...
            ]
       
        URL: /account/{login}/table
        TYPE: POST
        BODY: 
            {
                "tabletype": 1
            }
        EFFECT: Create new table by tabletype for user by login
        RESPONSE:  JSON
            {
                "tableId": 7
            }
       
        URL: /account/{login}/table/{tableID}
        TYPE: GET
        BODY: NONE
        EFFECT: Gets available commands for this state of game or error message if the game not started.
        RESPONSE:  JSON
            [
                {
                    "type": "HIT",
                    "available": true
                },
                {
                    "type": "BET",
                    "available": false
                },
                {
                    "type": "STAND",
                    "available": true
                },
                {
                    "type": "EXIT",
                    "available": true
                }
            ]
       
    • Commands:

          URL: /account/{login}/table/{tableID}
          TYPE: POST
          BODY: Command in JSON format. See command types
          EFFECT: Sends command to server
          RESPONSE:  JSON
              
         
      • Command types:

            HIT:
                {
                    "command": "HIT"
                }
            
            BET:
                {
                    "command": "BET",
                    "amount": 25
                }
            
            STAND:
                {
                    "command": "STAND"
                }
            
            EXIT:
                {
                    "command": "EXIT"
                }

About

BlackJack REST service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%