Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| import funciones | |
| app = FastAPI() | |
| #Future: Correct warnings in cryptography. | |
| def start(): | |
| return {"Status":"Deployed"} | |
| ## GET DATA ## | |
| #Vía Path | |
| def getData(): | |
| data = funciones.getData() | |
| print("Tipo de resultado:", type(data)) | |
| return data | |
| #Vía Query | |
| #Quizá no es necesaria vía Query porque no pide parámetros. | |
| def getData(): | |
| data = funciones.getData() | |
| print("Tipo de resultado:", type(data)) | |
| return data | |
| ## GET TOKENS ## | |
| #Vía Path | |
| def getTokens(userfile: str): | |
| tokens = funciones.getTokens(userfile) | |
| print("Tipo de resultado:", type(tokens)) | |
| return tokens | |
| #Vía Query | |
| def getTokens(userfile: str = "gAAAAABmEZA4SLBC2YczouOrjIEi9WNCNGOIvyUcqBUnzxNsftXTdy54KaX9x8mAjFkABSI6FJrdZDQKk_5lpJOgJoMChxlniw=="): | |
| tokens = funciones.getTokens(userfile) | |
| print("Tipo de resultado:", type(tokens)) | |
| return tokens | |
| ## AUTHORIZE WORK ## | |
| #Vía Parameters | |
| def authorize(tokens: int, work: str): | |
| autorizacion = funciones.authorize(tokens, work) | |
| print("Tipo de resultado:", type(autorizacion)) | |
| return autorizacion | |
| #Vía Query | |
| def authorize(tokens: int, work: str = "picswap"): | |
| autorizacion = funciones.authorize(tokens,work) | |
| print("Tipo de resultado:", type(autorizacion)) | |
| return autorizacion | |
| ## DEBIT TOKENS ## | |
| #Vía Parámeters | |
| def debitTokens(userfile: str, work: str): | |
| tokens = funciones.debitTokens(userfile,work) | |
| print("Tipo de resultado:", type(tokens)) | |
| return tokens | |
| #Vía Query | |
| def debitTokens(userfile: str, work: str = "picswap"): | |
| tokens = funciones.debitTokens(userfile,work) | |
| print("Tipo de resultado:", type(tokens)) | |
| return tokens | |
| ## GET USER FLAG ## | |
| #Vía Parámeters | |
| def getUserFlag(userfile: str): | |
| novelty = funciones.getUserNovelty(userfile) | |
| print("Tipo de resultado:", type(novelty)) | |
| return novelty | |
| #Vía Query | |
| def getUserNovelty(userfile: str): | |
| novelty = funciones.getUserNovelty(userfile) | |
| print("Tipo de resultado:", type(novelty)) | |
| return novelty |