--- action.py
+++ action.py
... | ... | @@ -104,12 +104,10 @@ |
104 | 104 |
class fileUpload(Resource): |
105 | 105 |
@Action.doc(responses={200: 'Success'}) |
106 | 106 |
@Action.doc(responses={500: 'Register Failed'}) |
107 |
- def post(self): |
|
107 |
+ def get(self): |
|
108 | 108 |
if request.method == 'GET': |
109 | 109 |
db = DB() |
110 |
- now = datetime.now() |
|
111 |
- d = now.strftime('%Y-%m-%d %X') |
|
112 |
- value = db.db_display_action(d) |
|
110 |
+ value = db.db_display_action() |
|
113 | 111 |
return { |
114 | 112 |
'report': list(value) |
115 | 113 |
}, 200 |
--- app.py
+++ app.py
... | ... | @@ -18,5 +18,5 @@ |
18 | 18 |
api.add_namespace(Action, '/action') |
19 | 19 |
|
20 | 20 |
if __name__ == "__main__": |
21 |
- app.run(debug=False, host='0.0.0.0', port=8080) |
|
21 |
+ app.run(debug=True, host='0.0.0.0', port=8080) |
|
22 | 22 |
print("Flask Start")(파일 끝에 줄바꿈 문자 없음) |
--- database/database.py
+++ database/database.py
... | ... | @@ -73,16 +73,13 @@ |
73 | 73 |
''') |
74 | 74 |
|
75 | 75 |
|
76 |
- def db_display_action(self,timestamp) : |
|
76 |
+ def db_display_action(self) : |
|
77 | 77 |
cur = self.conn.cursor() # 커서를 생성한다 |
78 |
- now=timestamp |
|
79 |
- d_plus=now +timedelta(hours=2) |
|
80 |
- d_plus=str("'"+d_plus.strftime('%Y-%m-%d %X')+"'") |
|
81 |
- d_minus=now -timedelta(hours=2) |
|
82 |
- d_minus=str("'"+d_minus.strftime('%Y-%m-%d %X')+"'") |
|
78 |
+ now=datetime.now() |
|
83 | 79 |
cur.execute(f''' |
84 |
- select * from rds.pothole |
|
85 |
- where timestamp between {d_minus} and {d_plus}; |
|
80 |
+ select action_gps_1,action_gps_2 from rds.action ; |
|
86 | 81 |
''') |
87 | 82 |
result=cur.fetchall() |
88 |
- return result(파일 끝에 줄바꿈 문자 없음) |
|
83 |
+ return result |
|
84 |
+ |
|
85 |
+# where timestamp between {d_minus} and {d_plus}(파일 끝에 줄바꿈 문자 없음) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?