mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-22 19:02:17 +08:00
新增年度报告上传api
This commit is contained in:
parent
c68636dcf4
commit
1353c3659c
@ -60,11 +60,7 @@ class ContactInfo(QWidget, Ui_Form):
|
|||||||
self.toolButton_output.showMenu()
|
self.toolButton_output.showMenu()
|
||||||
|
|
||||||
def analysis(self):
|
def analysis(self):
|
||||||
QMessageBox.warning(self,
|
QDesktopServices.openUrl(QUrl("https://memotrace.lc044.love/"))
|
||||||
"别急别急",
|
|
||||||
"马上就实现该功能"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
def annual_report(self):
|
def annual_report(self):
|
||||||
if 'room' in self.contact.wxid:
|
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"))
|
QDesktopServices.openUrl(QUrl("http://127.0.0.1:21314/christmas"))
|
||||||
|
|
||||||
def emotionale_Analysis(self):
|
def emotionale_Analysis(self):
|
||||||
if 'room' in self.contact.wxid:
|
QDesktopServices.openUrl(QUrl("https://memotrace.lc044.love/"))
|
||||||
QMessageBox.warning(
|
|
||||||
self, '警告',
|
|
||||||
'暂不支持群组'
|
|
||||||
)
|
|
||||||
return
|
|
||||||
QMessageBox.warning(self,
|
|
||||||
"别急别急",
|
|
||||||
"马上就实现该功能"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
def back(self):
|
def back(self):
|
||||||
"""
|
"""
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
<link rel="stylesheet" href="https://memotrace.lc044.love/static/css/style.css">
|
<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://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>
|
<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://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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="snow"></div>
|
<div id="snow"></div>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import requests
|
||||||
from flask import Flask, render_template, send_file
|
from flask import Flask, render_template, send_file
|
||||||
|
|
||||||
from app.DataBase import msg_db
|
from app.DataBase import msg_db
|
||||||
@ -13,6 +14,9 @@ app = Flask(__name__)
|
|||||||
wxid = ''
|
wxid = ''
|
||||||
contact: Contact = None
|
contact: Contact = None
|
||||||
|
|
||||||
|
html: str = ''
|
||||||
|
api_url = 'http://api.lc044.love/upload'
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def index():
|
def index():
|
||||||
@ -28,8 +32,8 @@ def christmas():
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
first_time = '2023-01-01 00:00:00'
|
first_time = '2023-01-01 00:00:00'
|
||||||
data = {
|
data = {
|
||||||
'ta_avatar_path': contact.avatar_path,
|
'ta_avatar_path': contact.smallHeadImgUrl,
|
||||||
'my_avatar_path': Me().avatar_path,
|
'my_avatar_path': Me().smallHeadImgUrl,
|
||||||
'ta_nickname': contact.remark,
|
'ta_nickname': contact.remark,
|
||||||
'my_nickname': Me().name,
|
'my_nickname': Me().name,
|
||||||
'first_time': first_time,
|
'first_time': first_time,
|
||||||
@ -84,8 +88,11 @@ def christmas():
|
|||||||
'emoji_url': url,
|
'emoji_url': url,
|
||||||
'emoji_num': num,
|
'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)
|
**emoji_data)
|
||||||
|
return html
|
||||||
|
|
||||||
|
|
||||||
@app.route('/home')
|
@app.route('/home')
|
||||||
def home():
|
def home():
|
||||||
@ -103,6 +110,19 @@ def home():
|
|||||||
return render_template('home.html', **data)
|
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>/')
|
@app.route('/wordcloud/<who>/')
|
||||||
def one(who):
|
def one(who):
|
||||||
wxid = contact.wxid
|
wxid = contact.wxid
|
||||||
|
Loading…
Reference in New Issue
Block a user