52 lines
1.3 KiB
Python
52 lines
1.3 KiB
Python
import connexion
|
|
from typing import Dict
|
|
from typing import Tuple
|
|
from typing import Union
|
|
|
|
from openapi_server.models.patch_notes import PatchNotes # noqa: E501
|
|
from openapi_server import util
|
|
|
|
|
|
def get_patchnotes(): # noqa: E501
|
|
"""get_patchnotes
|
|
|
|
returns list of all unseen Patch notes from the user # noqa: E501
|
|
|
|
|
|
:rtype: Union[List[PatchNotes], Tuple[List[PatchNotes], int], Tuple[List[PatchNotes], int, Dict[str, str]]
|
|
"""
|
|
return 'do some magic!'
|
|
|
|
|
|
def patch_note_delete(patch_id): # noqa: E501
|
|
"""patch_note_delete
|
|
|
|
deletes one Patch note # noqa: E501
|
|
|
|
:param patch_id:
|
|
:type patch_id: str
|
|
:type patch_id: str
|
|
|
|
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
"""
|
|
return 'do some magic!'
|
|
|
|
|
|
def post_patchnotes(body=None): # noqa: E501
|
|
"""post_patchnotes
|
|
|
|
creates new Patch notes # noqa: E501
|
|
|
|
:param patch_notes:
|
|
:type patch_notes: dict | bytes
|
|
|
|
:rtype: Union[List[PatchNotes], Tuple[List[PatchNotes], int], Tuple[List[PatchNotes], int, Dict[str, str]]
|
|
"""
|
|
patch_notes = body
|
|
with conn.cursor() as cur:
|
|
player_name = player_post_request.name
|
|
player_id = uuid.uuid4()
|
|
cur.execute(f"INSERT INTO player VALUES ('{player_id}','{player_name}');")
|
|
conn.commit() # noqa: E501
|
|
return 'do some magic!'
|