Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,34 @@ import time
|
|
| 4 |
app = Flask(__name__)
|
| 5 |
|
| 6 |
fake_db = {
|
| 7 |
-
"accounts": []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
| 9 |
|
| 10 |
def generate_new_id():
|
|
@@ -28,7 +55,7 @@ def get_or_create_account(platform, udid):
|
|
| 28 |
return jsonify({
|
| 29 |
"success": True,
|
| 30 |
"object": {
|
| 31 |
-
"account": {
|
| 32 |
"id": account["id"],
|
| 33 |
"timestamp": account["timestamp"],
|
| 34 |
"udid": account["udid"],
|
|
@@ -51,7 +78,7 @@ def get_or_create_account(platform, udid):
|
|
| 51 |
return jsonify({
|
| 52 |
"success": True,
|
| 53 |
"object": {
|
| 54 |
-
"account": {
|
| 55 |
"id": new_account["id"],
|
| 56 |
"timestamp": new_account["timestamp"],
|
| 57 |
"udid": new_account["udid"],
|
|
@@ -62,5 +89,15 @@ def get_or_create_account(platform, udid):
|
|
| 62 |
"error": None
|
| 63 |
}), 201
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
if __name__ == '__main__':
|
| 66 |
app.run(host='0.0.0.0', port=7860)
|
|
|
|
| 4 |
app = Flask(__name__)
|
| 5 |
|
| 6 |
fake_db = {
|
| 7 |
+
"accounts": [],
|
| 8 |
+
"generate_lists": [
|
| 9 |
+
{
|
| 10 |
+
"id": "1",
|
| 11 |
+
"name": "REALISTIC",
|
| 12 |
+
"imageUrl": "assets/images/0.jpg"
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"id": "2",
|
| 16 |
+
"name": "DRAWING",
|
| 17 |
+
"imageUrl": "assets/images/2.jpg"
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"id": "3",
|
| 21 |
+
"name": "TOY FIGURE",
|
| 22 |
+
"imageUrl": "assets/images/3.jpg"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"id": "4",
|
| 26 |
+
"name": "3D",
|
| 27 |
+
"imageUrl": "assets/images/4.jpg"
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"id": "5",
|
| 31 |
+
"name": "ANIMATION",
|
| 32 |
+
"imageUrl": "assets/images/1.jpg"
|
| 33 |
+
}
|
| 34 |
+
]
|
| 35 |
}
|
| 36 |
|
| 37 |
def generate_new_id():
|
|
|
|
| 55 |
return jsonify({
|
| 56 |
"success": True,
|
| 57 |
"object": {
|
| 58 |
+
"account": {
|
| 59 |
"id": account["id"],
|
| 60 |
"timestamp": account["timestamp"],
|
| 61 |
"udid": account["udid"],
|
|
|
|
| 78 |
return jsonify({
|
| 79 |
"success": True,
|
| 80 |
"object": {
|
| 81 |
+
"account": {
|
| 82 |
"id": new_account["id"],
|
| 83 |
"timestamp": new_account["timestamp"],
|
| 84 |
"udid": new_account["udid"],
|
|
|
|
| 89 |
"error": None
|
| 90 |
}), 201
|
| 91 |
|
| 92 |
+
@app.route('/generate_list', methods=['GET'])
|
| 93 |
+
def get_generate_list():
|
| 94 |
+
return jsonify({
|
| 95 |
+
"success": True,
|
| 96 |
+
"object": {
|
| 97 |
+
"lists": fake_db["generate_lists"]
|
| 98 |
+
},
|
| 99 |
+
"error": None
|
| 100 |
+
})
|
| 101 |
+
|
| 102 |
if __name__ == '__main__':
|
| 103 |
app.run(host='0.0.0.0', port=7860)
|