DmitrMakeev
commited on
Commit
•
d6502ff
1
Parent(s):
b0242f3
Update app.py
Browse files
app.py
CHANGED
@@ -222,6 +222,38 @@ def show_data_gc():
|
|
222 |
return "Internal Server Error", 500
|
223 |
|
224 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
@app.route('/data_ras')
|
226 |
def show_data_ras():
|
227 |
try:
|
|
|
222 |
return "Internal Server Error", 500
|
223 |
|
224 |
|
225 |
+
|
226 |
+
|
227 |
+
@app.route('/data_gc+tab', methods=['GET'])
|
228 |
+
def data_gc+tab():
|
229 |
+
try:
|
230 |
+
api_sys_control = request.args.get('api_sys')
|
231 |
+
|
232 |
+
if api_sys_control != api_key_sys:
|
233 |
+
return "EUR 22", 200
|
234 |
+
|
235 |
+
conn = sqlite3.connect('data_gc.db')
|
236 |
+
cursor = conn.cursor()
|
237 |
+
cursor.execute('SELECT name, phone, email FROM contacts')
|
238 |
+
contacts = cursor.fetchall()
|
239 |
+
conn.close()
|
240 |
+
|
241 |
+
contacts_json = [{'name': contact[0], 'phone': contact[1], 'email': contact[2]} for contact in contacts]
|
242 |
+
return jsonify(contacts_json), 200
|
243 |
+
except Exception as e:
|
244 |
+
print(f"Error getting data from data_gc: {e}")
|
245 |
+
return "Internal Server Error", 500
|
246 |
+
|
247 |
+
|
248 |
+
|
249 |
+
|
250 |
+
|
251 |
+
|
252 |
+
|
253 |
+
|
254 |
+
|
255 |
+
|
256 |
+
|
257 |
@app.route('/data_ras')
|
258 |
def show_data_ras():
|
259 |
try:
|