Spaces:
Sleeping
Sleeping
Moibe
commited on
Commit
·
8deab9e
1
Parent(s):
0a93397
Integra Get User Flag API
Browse files
main.py
CHANGED
|
@@ -27,7 +27,6 @@ def getData():
|
|
| 27 |
|
| 28 |
|
| 29 |
## GET TOKENS ##
|
| 30 |
-
|
| 31 |
#Vía Path
|
| 32 |
@app.get("/getTokens/{userfile}")
|
| 33 |
def getTokens(userfile: str):
|
|
@@ -43,7 +42,6 @@ def getTokens(userfile: str = "gAAAAABmEZA4SLBC2YczouOrjIEi9WNCNGOIvyUcqBUnzxNsf
|
|
| 43 |
return tokens
|
| 44 |
|
| 45 |
## AUTHORIZE WORK ##
|
| 46 |
-
|
| 47 |
#Vía Parameters
|
| 48 |
@app.get("/authorize/{tokens}/{work}")
|
| 49 |
def authorize(tokens: int, work: str):
|
|
@@ -60,7 +58,6 @@ def authorize(tokens: int, work: str = "picswap"):
|
|
| 60 |
|
| 61 |
|
| 62 |
## DEBIT TOKENS ##
|
| 63 |
-
|
| 64 |
#Vía Parámeters
|
| 65 |
@app.get("/debitTokens/{userfile}/{work}")
|
| 66 |
def debitTokens(userfile: str, work: str):
|
|
@@ -73,4 +70,19 @@ def debitTokens(userfile: str, work: str):
|
|
| 73 |
def debitTokens(userfile: str, work: str = "picswap"):
|
| 74 |
tokens = funciones.debitTokens(userfile,work)
|
| 75 |
print("Tipo de resultado:", type(tokens))
|
| 76 |
-
return tokens
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
## GET TOKENS ##
|
|
|
|
| 30 |
#Vía Path
|
| 31 |
@app.get("/getTokens/{userfile}")
|
| 32 |
def getTokens(userfile: str):
|
|
|
|
| 42 |
return tokens
|
| 43 |
|
| 44 |
## AUTHORIZE WORK ##
|
|
|
|
| 45 |
#Vía Parameters
|
| 46 |
@app.get("/authorize/{tokens}/{work}")
|
| 47 |
def authorize(tokens: int, work: str):
|
|
|
|
| 58 |
|
| 59 |
|
| 60 |
## DEBIT TOKENS ##
|
|
|
|
| 61 |
#Vía Parámeters
|
| 62 |
@app.get("/debitTokens/{userfile}/{work}")
|
| 63 |
def debitTokens(userfile: str, work: str):
|
|
|
|
| 70 |
def debitTokens(userfile: str, work: str = "picswap"):
|
| 71 |
tokens = funciones.debitTokens(userfile,work)
|
| 72 |
print("Tipo de resultado:", type(tokens))
|
| 73 |
+
return tokens
|
| 74 |
+
|
| 75 |
+
## GET USER FLAG ##
|
| 76 |
+
#Vía Parámeters
|
| 77 |
+
@app.get("/getUserFlag/{userfile}")
|
| 78 |
+
def debitTokens(userfile: str):
|
| 79 |
+
flag = funciones.getUserFlag(userfile)
|
| 80 |
+
print("Tipo de resultado:", type(flag))
|
| 81 |
+
return flag
|
| 82 |
+
|
| 83 |
+
#Vía Query
|
| 84 |
+
@app.get("/getUserFlag/")
|
| 85 |
+
def debitTokens(userfile: str):
|
| 86 |
+
flag = funciones.gwtUserFlag(userfile)
|
| 87 |
+
print("Tipo de resultado:", type(flag))
|
| 88 |
+
return flag
|