更新数据截止日2025.12.14
This commit is contained in:
12
app.py
12
app.py
@@ -1,7 +1,4 @@
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any
|
||||
|
||||
import requests
|
||||
from flask import Flask, jsonify, request, render_template
|
||||
import json
|
||||
import os
|
||||
@@ -853,11 +850,12 @@ def create_qa():
|
||||
answer_ids = data.get('answer', [])
|
||||
conn = db_manager.get_connection()
|
||||
cursor = conn.cursor()
|
||||
|
||||
index_id = cursor.execute_query(f"SELECT id FROM qa order by id desc limit 1", fetch_all=False)[0]
|
||||
index_id += 1
|
||||
cursor.execute('''
|
||||
INSERT INTO qa (groupId, question, answer, start_time, end_time)
|
||||
VALUES (?, ?, ?, ?, ?)
|
||||
''', (group_id, json.dumps(question_ids), json.dumps(answer_ids),
|
||||
INSERT INTO qa ("id", "groupId", "question", "answer", "start_time", "end_time")
|
||||
VALUES (?, ?, ?, ?, ?, ?)
|
||||
''', (index_id, group_id, json.dumps(question_ids), json.dumps(answer_ids),
|
||||
data.get('start_time', ''), data.get('end_time', '')))
|
||||
|
||||
conn.commit()
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
mammoth
|
||||
pytz
|
||||
flask
|
||||
12
script.py
12
script.py
@@ -62,7 +62,7 @@ def update_user_group_info():
|
||||
conn = dm.get_connection()
|
||||
cursor = conn.cursor()
|
||||
|
||||
m = cursor.execute("select id from 'group' where id = name OR name = ''").fetchall()
|
||||
m = cursor.execute("select id from 'group' where id = name").fetchall()
|
||||
group_list =[]
|
||||
for gid in m:
|
||||
gid = gid[0]
|
||||
@@ -97,16 +97,16 @@ if __name__ == '__main__':
|
||||
|
||||
chat_session = ChatSessionManager(db_manager)
|
||||
month = 12
|
||||
day_start = 8
|
||||
day_end = 9
|
||||
day_start = 11
|
||||
day_end = 14
|
||||
for day in range(day_start, day_end):
|
||||
for hour in range(17):
|
||||
for hour in range(24):
|
||||
chat_session.process_chat_session(2025, month, day, hour)
|
||||
chat_session.update_qa_data(f"2025-{month}-{day_start:02d} 00:00:00", f"2025-{month}-{day_end:02d} 00:00:00")
|
||||
# update user group info
|
||||
|
||||
update_user_group_info()
|
||||
# upload db
|
||||
|
||||
db_manager.upload_db()
|
||||
|
||||
# update user group info
|
||||
#update_user_group_info()
|
||||
Reference in New Issue
Block a user