新增年度报告上传api

This commit is contained in:
shuaikangzhou 2024-01-20 21:14:23 +08:00
parent c68636dcf4
commit 1353c3659c
3 changed files with 27 additions and 21 deletions

View File

@ -60,11 +60,7 @@ class ContactInfo(QWidget, Ui_Form):
self.toolButton_output.showMenu()
def analysis(self):
QMessageBox.warning(self,
"别急别急",
"马上就实现该功能"
)
return
QDesktopServices.openUrl(QUrl("https://memotrace.lc044.love/"))
def annual_report(self):
if 'room' in self.contact.wxid:
@ -81,17 +77,7 @@ class ContactInfo(QWidget, Ui_Form):
QDesktopServices.openUrl(QUrl("http://127.0.0.1:21314/christmas"))
def emotionale_Analysis(self):
if 'room' in self.contact.wxid:
QMessageBox.warning(
self, '警告',
'暂不支持群组'
)
return
QMessageBox.warning(self,
"别急别急",
"马上就实现该功能"
)
return
QDesktopServices.openUrl(QUrl("https://memotrace.lc044.love/"))
def back(self):
"""

View File

@ -7,9 +7,9 @@
<link rel="stylesheet" href="https://memotrace.lc044.love/static/css/style.css">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@latest/dist/echarts.min.js"></script>
<script type="text/javascript" src="https://assets.pyecharts.org/assets/v5/echarts-wordcloud.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fullpage.js/dist/fullpage.min.css" />
<link rel="stylesheet" href="https://memotrace.lc044.love/static/css/fullpage.min.css" />
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="https://proxy.daigua.me/proxy/https://cdn.jsdelivr.net/npm/fullpage.js/dist/fullpage.min.js"></script>
<script src="https://memotrace.lc044.love/static/js/fullpage.min.js"></script>
</head>
<body>
<div id="snow"></div>

View File

@ -1,6 +1,7 @@
import os
import sys
import requests
from flask import Flask, render_template, send_file
from app.DataBase import msg_db
@ -13,6 +14,9 @@ app = Flask(__name__)
wxid = ''
contact: Contact = None
html: str = ''
api_url = 'http://api.lc044.love/upload'
@app.route("/")
def index():
@ -28,8 +32,8 @@ def christmas():
except TypeError:
first_time = '2023-01-01 00:00:00'
data = {
'ta_avatar_path': contact.avatar_path,
'my_avatar_path': Me().avatar_path,
'ta_avatar_path': contact.smallHeadImgUrl,
'my_avatar_path': Me().smallHeadImgUrl,
'ta_nickname': contact.remark,
'my_nickname': Me().name,
'first_time': first_time,
@ -84,8 +88,11 @@ def christmas():
'emoji_url': url,
'emoji_num': num,
}
return render_template("christmas.html", **data, **wordcloud_cloud_data, **time_data, **month_data, **calendar_data,
global html
html = render_template("christmas.html", **data, **wordcloud_cloud_data, **time_data, **month_data, **calendar_data,
**emoji_data)
return html
@app.route('/home')
def home():
@ -103,6 +110,19 @@ def home():
return render_template('home.html', **data)
@app.route('/upload')
def upload():
global html
data = {
'html_content': html,
'wxid': contact.wxid,
'username': Me().wxid,
}
response = requests.post(api_url, data=data)
print(response.json())
return response.json()
@app.route('/wordcloud/<who>/')
def one(who):
wxid = contact.wxid