윤영준 윤영준 2024-07-17
added json communication format
@fefe14a05a905cb04c34e17c88fa81e19de584ae
action.py
--- action.py
+++ action.py
@@ -169,7 +169,8 @@
         location_x = float(data['location_x'])
         location_y = float(data['location_y'])
         token = request.headers.get('Authorization')
-        print(token)
+        #print(token)
+        print(timestamp,location_x,location_y)
         #print(token)
         if not token:
             return jsonify({'result': 'fail', 'msg': '토큰이 없습니다.'})
@@ -177,7 +178,7 @@
         else:
             # Decode the token to verify it
             decoded_token = jwt.decode(token, "secret", algorithms=['HS256'])
-            print(decoded_token)
+            #print(decoded_token)
             user_id = decoded_token['id']
         
         # GPS 데이터베이스에 삽입
auth.py
--- auth.py
+++ auth.py
@@ -78,9 +78,9 @@
                 "message": "Register Failed"
             }, 500
         else:
-            db.db_add_id(id,pw_has,user_email,sex,phone)
+            db.db_add_id(id_,pw_has,user_email,sex,phone)
             return {
-                'Authorization': id  # str으로 반환하여 return
+                'Authorization': id_  # str으로 반환하여 return
             }, 200
 
 @Auth.route('/login')
example.json
--- example.json
+++ example.json
@@ -1,16 +1,10 @@
 {
    "user_id":"testaccount",
    "trip_id":"cf07ca9f3219808ec7f3f8ff2111ed3d5c5aad33ad0c11f1e6027f378ed4e561",
-   "trip_log":[
+   "trip_log":
       {
-         "latitude":37.778282,
-         "longitude":128.129373,
-         "timestamp":"2024-07-11 16:23:19.667"
+         "latitude":[37.778282, 37.778282,],
+         "longitude":[128.129373, 128.129373,],
+         "timestamp":["2024-07-11 16:23:19.667","2024-07-11 16:09:43.175"],
       },
-      {
-         "latitude":37.778282,
-         "longitude":128.129373,
-         "timestamp":"2024-07-11 15:02:18.965"
-      }
-   ]
 }
Add a comment
List