4.8 KiB
4.8 KiB
Monster Trading Card Game
Created by Georg Reisinger
Protocol
- RestServer von https://github.com/DerGeorg/RESTServer
- MTCG Git Repo https://github.com/DerGeorg/SWE1-MTCG
- JavaDoc online auf: http://mtcg.dergeorg.at
- Postgres Server läuft auf einem Raspberry Pi 4 --> http://postgres.dergeorg.at
- User Table
- Alle User die in MTCG registriert sind
- User_cards Table
- Alle Cards der User
- User_deck Table
- Deck der User
- Battle Table
- Battle Einladungen
- Battle_log Table
- Nach beendetem battle wird hier das Log gespeichert
- Package Table
- Alle Packages die die User bekommen können
- Card Table
- Alle Cards die in dem Spiel verwendet werden
- Typ der Card wird automatisch in Card und Element Typ getrennt
- Trading Table
- Alle aktiven Trading deals
- User Table
API Beschreibung
GET
ROUTE | BESCHREIBUNG | ATTRIBUTE | RETURN | HEADER |
---|---|---|---|---|
/cards | show all acquired cards | / | Cards Object | --header "Authorization: Basic kienboec-mtcgToken" |
/deck | show deck | / | Cards Object | --header "Authorization: Basic kienboec-mtcgToken" |
/deck?format=plain | show deck different representation | / | Card names Array | --header "Authorization: Basic kienboec-mtcgToken" |
/users/{username} | get user | / | User Object | --header "Authorization: Basic kienboec-mtcgToken" |
/stats | get stats about all battles | / | All battle Logs | --header "Authorization: Basic kienboec-mtcgToken" |
/score | get score, about last battle | / | Last Battle Log | --header "Authorization: Basic kienboec-mtcgToken" |
/tradings | get trading deals | / | List TradingDeal Object | --header "Authorization: Basic kienboec-mtcgToken" |
POST
ROUTE | BESCHREIBUNG | ATTRIBUTE | RETURN | HEADER |
---|---|---|---|---|
/users | create user | Username, Password | User Object | / |
/sessions | login user | Username, Password | login token | / |
/packages | create package | [ID, Name, Damage]x5 | Package Object | --header "Authorization: Basic admin-mtcgToken" |
/transactions/packages | acquire packages kienboec | / | Package Object | --header "Authorization: Basic kienboec-mtcgToken" |
/battles | Battle | / | Anweisungen String | --header "Authorization: Basic kienboec-mtcgToken" |
/tradings | create tradingdeal | Id, CardToTrade, Type, MinimumDamage | TradingDeal Object | --header "Authorization: Basic kienboec-mtcgToken" |
/tradings/{TradeID} | Do Trade | CardID | New Card Object | --header "Authorization: Basic kienboec-mtcgToken" |
PUT
ROUTE | BESCHREIBUNG | ATTRIBUTE | RETURN | HEADER |
---|---|---|---|---|
/deck | configure deck | [ID, ID, ID, ID] | Cards Object | --header "Authorization: Basic kienboec-mtcgToken" |
/users/{username} | / | Name, Bio, Image | User Object | --header "Authorization: Basic kienboec-mtcgToken" |
DELETE
ROUTE | BESCHREIBUNG | ATTRIBUTE | RETURN | HEADER |
---|---|---|---|---|
/tradings/{TradeID} | delete trading deal | / | / | --header "Authorization: Basic kienboec-mtcgToken" |
Zeit
5 Tage x 6 Stunden = 30 Stunden
UML
UML2021.png
http://dergeorg.at/mtcg/UML2021.png