update app_vx

This commit is contained in:
2025-11-13 07:40:46 +08:00
parent 926ffa1b8f
commit d64349b606
7 changed files with 13787 additions and 112 deletions

516
app_vx.py
View File

@@ -15,6 +15,7 @@ from pathlib import Path
import time
from sqlalchemy import create_engine, text, func, or_, case, event, desc, asc
from flask import Flask, has_request_context, render_template, request, jsonify, redirect, url_for, flash, session, render_template_string, current_app, send_from_directory
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, UserMixin, login_user, logout_user, login_required, current_user
from flask_mail import Mail, Message
@@ -325,7 +326,7 @@ def subscription_required(level='pro'):
@subscription_required('pro') # 需要 Pro 或 Max 用户
@subscription_required('max') # 仅限 Max 用户
注意:此装饰器需要配合 @token_required 使用
注意:此装饰器需要配合 使用
"""
from functools import wraps
@@ -1052,8 +1053,6 @@ def get_clickhouse_client():
@app.route('/api/stock/<stock_code>/kline')
@token_required
@pro_or_max_required
def get_stock_kline(stock_code):
"""获取股票K线数据 - 仅限 Pro/Max 会员(小程序功能)"""
chart_type = request.args.get('chart_type', 'daily') # 默认改为daily
@@ -1628,7 +1627,7 @@ def add_comment(post_id):
@app.route('/post/comments/<int:post_id>')
@token_required
def get_comments(post_id):
"""获取帖子评论列表"""
page = request.args.get('page', 1, type=int)
@@ -2012,8 +2011,8 @@ def get_limit_rate(stock_code):
@app.route('/api/events', methods=['GET'])
@token_required
@pro_or_max_required
def api_get_events():
"""
获取事件列表API - 优化版本(保持完全兼容)
@@ -2555,11 +2554,7 @@ def api_get_events():
'week_change': week_change
}
# ==================== 获取整体统计信息 ====================
# 获取所有筛选条件下的事件和股票(用于统计)
all_filtered_events = query.limit(500).all()
all_event_ids = [e.id for e in all_filtered_events]
# ==================== 获取整体统计信息(应用所有筛选条件) ====================
overall_distribution = {
'limit_down': 0,
@@ -2573,40 +2568,105 @@ def api_get_events():
'limit_up': 0
}
if all_event_ids:
# 获取所有相关股票
all_stocks_for_stats = RelatedStock.query.filter(
RelatedStock.event_id.in_(all_event_ids)
# 使用当前筛选条件的query但不应用分页限制获取所有符合条件的事件
# 这样统计数据会跟随用户的筛选条件变化
all_filtered_events = query.limit(1000).all() # 限制最多1000个事件避免查询过慢
week_event_ids = [e.id for e in all_filtered_events]
if week_event_ids:
# 获取这些事件的所有关联股票
week_related_stocks = RelatedStock.query.filter(
RelatedStock.event_id.in_(week_event_ids)
).all()
# 统计涨跌分布
for stock in all_stocks_for_stats:
clean_code = stock.stock_code.replace('.SH', '').replace('.SZ', '').replace('.BJ', '')
if clean_code in stock_changes:
daily_change = stock_changes[clean_code]['daily_change']
# 按事件ID分组
week_stocks_by_event = {}
for stock in week_related_stocks:
if stock.event_id not in week_stocks_by_event:
week_stocks_by_event[stock.event_id] = []
week_stocks_by_event[stock.event_id].append(stock)
# 计算涨跌停限制
limit_rate = get_limit_rate(stock.stock_code)
# 收集所有股票代码(用于批量查询行情)
week_stock_codes = []
week_code_mapping = {}
for stocks in week_stocks_by_event.values():
for stock in stocks:
clean_code = stock.stock_code.replace('.SH', '').replace('.SZ', '').replace('.BJ', '')
week_stock_codes.append(clean_code)
week_code_mapping[clean_code] = stock.stock_code
# 分类统计
if daily_change <= -limit_rate + 0.01:
overall_distribution['limit_down'] += 1
elif daily_change >= limit_rate - 0.01:
overall_distribution['limit_up'] += 1
elif daily_change > 5:
overall_distribution['up_over_5'] += 1
elif daily_change > 1:
overall_distribution['up_1_to_5'] += 1
elif daily_change > 0.1:
overall_distribution['up_within_1'] += 1
elif daily_change >= -0.1:
overall_distribution['flat'] += 1
elif daily_change > -1:
overall_distribution['down_within_1'] += 1
elif daily_change > -5:
overall_distribution['down_5_to_1'] += 1
else:
overall_distribution['down_over_5'] += 1
week_stock_codes = list(set(week_stock_codes))
# 批量查询这些股票的最新行情数据
week_stock_changes = {}
if week_stock_codes:
codes_str = "'" + "', '".join(week_stock_codes) + "'"
recent_trades_sql = f"""
SELECT
SECCODE,
SECNAME,
F010N as daily_change,
ROW_NUMBER() OVER (PARTITION BY SECCODE ORDER BY TRADEDATE DESC) as rn
FROM ea_trade
WHERE SECCODE IN ({codes_str})
AND F010N IS NOT NULL
AND TRADEDATE >= DATE_SUB(CURDATE(), INTERVAL 3 DAY)
ORDER BY SECCODE, TRADEDATE DESC
"""
result = db.session.execute(text(recent_trades_sql))
for row in result.fetchall():
sec_code = row[0]
if row[3] == 1: # 只取最新的数据rn=1
week_stock_changes[sec_code] = {
'stock_name': row[1],
'daily_change': float(row[2]) if row[2] else 0
}
# 按事件统计平均涨跌幅分布
event_avg_changes = {}
for event in all_filtered_events:
event_stocks = week_stocks_by_event.get(event.id, [])
if not event_stocks:
continue
total_change = 0
valid_count = 0
for stock in event_stocks:
clean_code = stock.stock_code.replace('.SH', '').replace('.SZ', '').replace('.BJ', '')
if clean_code in week_stock_changes:
daily_change = week_stock_changes[clean_code]['daily_change']
total_change += daily_change
valid_count += 1
if valid_count > 0:
avg_change = total_change / valid_count
event_avg_changes[event.id] = avg_change
# 统计事件平均涨跌幅的分布
for event_id, avg_change in event_avg_changes.items():
# 对于事件平均涨幅,不使用涨跌停分类,使用通用分类
if avg_change <= -10:
overall_distribution['limit_down'] += 1
elif avg_change >= 10:
overall_distribution['limit_up'] += 1
elif avg_change > 5:
overall_distribution['up_over_5'] += 1
elif avg_change > 1:
overall_distribution['up_1_to_5'] += 1
elif avg_change > 0.1:
overall_distribution['up_within_1'] += 1
elif avg_change >= -0.1:
overall_distribution['flat'] += 1
elif avg_change > -1:
overall_distribution['down_within_1'] += 1
elif avg_change > -5:
overall_distribution['down_5_to_1'] += 1
else:
overall_distribution['down_over_5'] += 1
# ==================== 构建响应数据 ====================
@@ -2839,8 +2899,8 @@ def get_event_class(count):
else:
return 'bg-gradient-success'
@app.route('/api/calendar-event-counts')
@token_required
@pro_or_max_required
def get_calendar_event_counts():
"""获取整月的事件数量统计仅统计type为event的事件"""
try:
@@ -2930,8 +2990,8 @@ def to_dict(self):
# 1. 首页接口
@app.route('/api/home', methods=['GET'])
@token_required
@pro_or_max_required
def api_home():
try:
seven_days_ago = datetime.now() - timedelta(days=7)
@@ -3620,17 +3680,107 @@ def api_login_email():
# 5. 事件详情-相关标的接口
@app.route('/api/event/<int:event_id>/related-stocks-detail', methods=['GET'])
@token_required
@pro_or_max_required
def api_event_related_stocks(event_id):
"""事件相关标的详情接口 - 仅限 Pro/Max 会员"""
try:
from datetime import datetime, timedelta, time as dt_time
from sqlalchemy import text
event = Event.query.get_or_404(event_id)
related_stocks = event.related_stocks.order_by(RelatedStock.correlation.desc()).all()
# 获取ClickHouse客户端用于分时数据查询
client = get_clickhouse_client()
# 获取事件时间(如果事件有开始时间,使用开始时间;否则使用创建时间)
event_time = event.start_time if event.start_time else event.created_at
current_time = datetime.now()
# 定义交易日和时间范围计算函数(与 app.py 中的逻辑完全一致)
def get_trading_day_and_times(event_datetime):
event_date = event_datetime.date()
event_time_only = event_datetime.time()
# Trading hours
market_open = dt_time(9, 30)
market_close = dt_time(15, 0)
with engine.connect() as conn:
# First check if the event date itself is a trading day
is_trading_day = conn.execute(text("""
SELECT 1
FROM trading_days
WHERE EXCHANGE_DATE = :date
"""), {"date": event_date}).fetchone() is not None
if is_trading_day:
# If it's a trading day, determine time period based on event time
if event_time_only < market_open:
# Before market opens - use full trading day
return event_date, market_open, market_close
elif event_time_only > market_close:
# After market closes - get next trading day
next_trading_day = conn.execute(text("""
SELECT EXCHANGE_DATE
FROM trading_days
WHERE EXCHANGE_DATE > :date
ORDER BY EXCHANGE_DATE LIMIT 1
"""), {"date": event_date}).fetchone()
# Convert to date object if we found a next trading day
return (next_trading_day[0].date() if next_trading_day else None,
market_open, market_close)
else:
# During trading hours
return event_date, event_time_only, market_close
else:
# If not a trading day, get next trading day
next_trading_day = conn.execute(text("""
SELECT EXCHANGE_DATE
FROM trading_days
WHERE EXCHANGE_DATE > :date
ORDER BY EXCHANGE_DATE LIMIT 1
"""), {"date": event_date}).fetchone()
# Convert to date object if we found a next trading day
return (next_trading_day[0].date() if next_trading_day else None,
market_open, market_close)
trading_day, start_time, end_time = get_trading_day_and_times(event_time)
if not trading_day:
# 如果没有交易日,返回空数据
return jsonify({
'code': 200,
'message': 'success',
'data': {
'event_id': event_id,
'event_title': event.title,
'event_desc': event.description,
'event_type': event.event_type,
'event_importance': event.importance,
'event_status': event.status,
'event_created_at': event.created_at.strftime("%Y-%m-%d %H:%M:%S"),
'event_start_time': event.start_time.isoformat() if event.start_time else None,
'event_end_time': event.end_time.isoformat() if event.end_time else None,
'keywords': event.keywords,
'view_count': event.view_count,
'post_count': event.post_count,
'follower_count': event.follower_count,
'related_stocks': [],
'total_count': 0
}
})
# For historical dates, ensure we're using actual data
start_datetime = datetime.combine(trading_day, start_time)
end_datetime = datetime.combine(trading_day, end_time)
# If the trading day is in the future relative to current time, return only names without data
if trading_day > current_time.date():
start_datetime = datetime.combine(trading_day, start_time)
end_datetime = datetime.combine(trading_day, end_time)
print(f"事件时间: {event_time}, 交易日: {trading_day}, 时间范围: {start_datetime} - {end_datetime}")
def get_minute_chart_data(stock_code):
"""获取股票分时图数据"""
try:
@@ -3705,39 +3855,126 @@ def api_event_related_stocks(event_id):
stocks_data = []
for stock in related_stocks:
# 获取股票基本信息 - 也使用灵活匹配
print(f"正在处理股票 {stock.stock_code} 的价格数据...")
# 获取股票基本信息
stock_info = StockBasicInfo.query.filter_by(SECCODE=stock.stock_code).first()
if not stock_info:
base_code = stock.stock_code.split('.')[0]
stock_info = StockBasicInfo.query.filter_by(SECCODE=base_code).first()
# 获取最新交易数据 - 使用灵活匹配
latest_trade = None
search_codes = [stock.stock_code, stock.stock_code.split('.')[0]]
for code in search_codes:
latest_trade = TradeData.query.filter_by(SECCODE=code) \
.order_by(TradeData.TRADEDATE.desc()).first()
if latest_trade:
break
# 获取前一交易日数据
prev_trade = None
if latest_trade:
prev_trade = TradeData.query.filter_by(SECCODE=latest_trade.SECCODE) \
.filter(TradeData.TRADEDATE < latest_trade.TRADEDATE) \
.order_by(TradeData.TRADEDATE.desc()).first()
# 计算涨跌幅
# 使用与 get_stock_quotes 完全相同的逻辑计算涨跌幅
latest_price = None
first_price = None
change_pct = None
change_amount = None
if latest_trade and prev_trade:
if prev_trade.F007N and prev_trade.F007N != 0:
change_amount = float(latest_trade.F007N) - float(prev_trade.F007N)
change_pct = (change_amount / float(prev_trade.F007N)) * 100
elif latest_trade and latest_trade.F010N:
change_pct = float(latest_trade.F010N)
change_amount = float(latest_trade.F009N) if latest_trade.F009N else None
open_price = None
high_price = None
low_price = None
volume = None
amount = None
trade_date = trading_day
try:
# 使用与 get_stock_quotes 完全相同的 SQL 查询
# 获取事件时间点的第一个价格 (first_price) 和当前时间的最后一个价格 (last_price)
data = client.execute("""
WITH first_price AS (
SELECT close
FROM stock_minute
WHERE code = %(code)s
AND timestamp >= %(start)s
AND timestamp <= %(end)s
ORDER BY timestamp
LIMIT 1
),
last_price AS (
SELECT close
FROM stock_minute
WHERE code = %(code)s
AND timestamp >= %(start)s
AND timestamp <= %(end)s
ORDER BY timestamp DESC
LIMIT 1
)
SELECT
last_price.close as last_price,
(last_price.close - first_price.close) / first_price.close * 100 as change,
first_price.close as first_price
FROM last_price
CROSS JOIN first_price
WHERE EXISTS (SELECT 1 FROM first_price)
AND EXISTS (SELECT 1 FROM last_price)
""", {
'code': stock.stock_code,
'start': start_datetime,
'end': end_datetime
})
print(f"股票 {stock.stock_code} 查询结果: {data}")
if data and data[0] and data[0][0] is not None:
latest_price = float(data[0][0])
change_pct = float(data[0][1]) if data[0][1] is not None else None
first_price = float(data[0][2]) if len(data[0]) > 2 and data[0][2] is not None else None
# 计算涨跌额
if latest_price is not None and first_price is not None:
change_amount = latest_price - first_price
# 获取额外的价格信息(开盘价、最高价、最低价等)
extra_data = client.execute("""
SELECT
open, high, low, volume, amt
FROM stock_minute
WHERE code = %(code)s
AND timestamp >= %(start)s
AND timestamp <= %(end)s
ORDER BY timestamp DESC
LIMIT 1
""", {
'code': stock.stock_code,
'start': start_datetime,
'end': end_datetime
})
if extra_data and extra_data[0]:
open_price = float(extra_data[0][0]) if extra_data[0][0] else None
high_price = float(extra_data[0][1]) if extra_data[0][1] else None
low_price = float(extra_data[0][2]) if extra_data[0][2] else None
volume = int(extra_data[0][3]) if extra_data[0][3] else None
amount = float(extra_data[0][4]) if extra_data[0][4] else None
except Exception as e:
print(f"Error fetching price data for {stock.stock_code}: {e}")
# 如果 ClickHouse 查询失败,尝试使用 TradeData 作为降级方案
try:
latest_trade = None
search_codes = [stock.stock_code, stock.stock_code.split('.')[0]]
for code in search_codes:
latest_trade = TradeData.query.filter_by(SECCODE=code) \
.order_by(TradeData.TRADEDATE.desc()).first()
if latest_trade:
break
if latest_trade:
latest_price = float(latest_trade.F007N) if latest_trade.F007N else None
open_price = float(latest_trade.F003N) if latest_trade.F003N else None
high_price = float(latest_trade.F005N) if latest_trade.F005N else None
low_price = float(latest_trade.F006N) if latest_trade.F006N else None
first_price = float(latest_trade.F002N) if latest_trade.F002N else None
volume = float(latest_trade.F004N) if latest_trade.F004N else None
amount = float(latest_trade.F011N) if latest_trade.F011N else None
trade_date = latest_trade.TRADEDATE
# 计算涨跌幅
if latest_trade.F010N:
change_pct = float(latest_trade.F010N)
if latest_trade.F009N:
change_amount = float(latest_trade.F009N)
except Exception as fallback_error:
print(f"Fallback query also failed for {stock.stock_code}: {fallback_error}")
# 获取分时图数据
minute_chart_data = get_minute_chart_data(stock.stock_code)
@@ -3755,17 +3992,19 @@ def api_event_related_stocks(event_id):
# 交易数据
'trade_data': {
'latest_price': float(latest_trade.F007N) if latest_trade and latest_trade.F007N else None,
'open_price': float(latest_trade.F003N) if latest_trade and latest_trade.F003N else None,
'high_price': float(latest_trade.F005N) if latest_trade and latest_trade.F005N else None,
'low_price': float(latest_trade.F006N) if latest_trade and latest_trade.F006N else None,
'prev_close': float(latest_trade.F002N) if latest_trade and latest_trade.F002N else None,
'change_amount': change_amount,
'latest_price': latest_price,
'first_price': first_price, # 事件发生时的价格
'open_price': open_price,
'high_price': high_price,
'low_price': low_price,
'change_amount': round(change_amount, 2) if change_amount is not None else None,
'change_pct': round(change_pct, 2) if change_pct is not None else None,
'volume': float(latest_trade.F004N) if latest_trade and latest_trade.F004N else None,
'amount': float(latest_trade.F011N) if latest_trade and latest_trade.F011N else None,
'trade_date': latest_trade.TRADEDATE.isoformat() if latest_trade else None,
} if latest_trade else None,
'volume': volume,
'amount': amount,
'trade_date': trade_date.isoformat() if trade_date else None,
'event_start_time': start_datetime.isoformat() if start_datetime else None, # 事件开始时间
'event_end_time': end_datetime.isoformat() if end_datetime else None, # 查询结束时间
} if latest_price is not None else None,
# 分时图数据
'minute_chart_data': minute_chart_data,
@@ -3809,8 +4048,8 @@ def api_event_related_stocks(event_id):
@app.route('/api/stock/<stock_code>/minute-chart', methods=['GET'])
@token_required
@pro_or_max_required
def get_minute_chart_data(stock_code):
"""获取股票分时图数据 - 仅限 Pro/Max 会员"""
client = get_clickhouse_client()
@@ -3885,8 +4124,8 @@ def get_minute_chart_data(stock_code):
@app.route('/api/event/<int:event_id>/stock/<stock_code>/detail', methods=['GET'])
@token_required
@pro_or_max_required
def api_stock_detail(event_id, stock_code):
"""个股详情接口 - 仅限 Pro/Max 会员"""
try:
@@ -4146,8 +4385,8 @@ def get_stock_minute_chart_data(stock_code):
# 7. 事件详情-相关概念接口
@app.route('/api/event/<int:event_id>/related-concepts', methods=['GET'])
@token_required
@pro_or_max_required
def api_event_related_concepts(event_id):
"""事件相关概念接口"""
try:
@@ -4189,8 +4428,8 @@ def api_event_related_concepts(event_id):
# 8. 事件详情-历史事件接口
@app.route('/api/event/<int:event_id>/historical-events', methods=['GET'])
@token_required
@pro_or_max_required
def api_event_historical_events(event_id):
"""事件历史事件接口"""
try:
@@ -4290,8 +4529,8 @@ def api_event_historical_events(event_id):
@app.route('/api/event/<int:event_id>/comments', methods=['GET'])
@token_required
@pro_or_max_required
def get_event_comments(event_id):
"""获取事件的所有评论和帖子(嵌套格式)
@@ -4545,8 +4784,8 @@ def get_event_comments(event_id):
@app.route('/api/comment/<int:comment_id>/replies', methods=['GET'])
@token_required
@pro_or_max_required
def get_comment_replies(comment_id):
"""获取某条评论的所有回复
@@ -4689,10 +4928,64 @@ def get_comment_replies(comment_id):
}), 500
# 工具函数:清理 Markdown 文本
def clean_markdown_text(text):
"""清理文本中的 Markdown 符号和多余的换行符
Args:
text: 原始文本(可能包含 Markdown 符号)
Returns:
清理后的纯文本
"""
if not text:
return text
import re
# 1. 移除 Markdown 标题符号 (### , ## , # )
text = re.sub(r'^#{1,6}\s+', '', text, flags=re.MULTILINE)
# 2. 移除 Markdown 加粗符号 (**text** 或 __text__)
text = re.sub(r'\*\*(.+?)\*\*', r'\1', text)
text = re.sub(r'__(.+?)__', r'\1', text)
# 3. 移除 Markdown 斜体符号 (*text* 或 _text_)
text = re.sub(r'\*(.+?)\*', r'\1', text)
text = re.sub(r'_(.+?)_', r'\1', text)
# 4. 移除 Markdown 列表符号 (- , * , + , 1. )
text = re.sub(r'^[\s]*[-*+]\s+', '', text, flags=re.MULTILINE)
text = re.sub(r'^[\s]*\d+\.\s+', '', text, flags=re.MULTILINE)
# 5. 移除 Markdown 引用符号 (> )
text = re.sub(r'^>\s+', '', text, flags=re.MULTILINE)
# 6. 移除 Markdown 代码块符号 (``` 或 `)
text = re.sub(r'```[\s\S]*?```', '', text)
text = re.sub(r'`(.+?)`', r'\1', text)
# 7. 移除 Markdown 链接 ([text](url) -> text)
text = re.sub(r'\[(.+?)\]\(.+?\)', r'\1', text)
# 8. 清理多余的换行符
# 将多个连续的换行符(\n\n\n...)替换为单个换行符
text = re.sub(r'\n{3,}', '\n\n', text)
# 9. 清理行首行尾的空白字符
text = re.sub(r'^\s+|\s+$', '', text, flags=re.MULTILINE)
# 10. 移除多余的空格(连续多个空格替换为单个空格)
text = re.sub(r' {2,}', ' ', text)
# 11. 清理首尾空白
text = text.strip()
return text
# 10. 投资日历-事件接口(增强版)
@app.route('/api/calendar/events', methods=['GET'])
@token_required
@pro_or_max_required
def api_calendar_events():
"""投资日历事件接口 - 连接 future_events 表 (修正版)"""
try:
@@ -4895,10 +5188,15 @@ def api_calendar_events():
elif search_query.lower() in str(related_concepts).lower():
highlight_match = 'concepts'
# 清理 Markdown 符号和多余的换行符
cleaned_former = clean_markdown_text(event.former)
cleaned_forecast = clean_markdown_text(event.forecast)
cleaned_fact = clean_markdown_text(event.fact)
event_dict = {
'id': event.data_id,
'title': event.title,
'description': f"前值: {event.former}, 预测: {event.forecast}, 实际: {event.fact}" if event.former or event.forecast or event.fact else "",
'description': f"前值: {cleaned_former}, 预测: {cleaned_forecast}, 实际: {cleaned_fact}" if cleaned_former or cleaned_forecast or cleaned_fact else "",
'start_time': event.calendar_time.isoformat() if event.calendar_time else None,
'end_time': None, # future_events 表没有结束时间
'category': {
@@ -4914,9 +5212,9 @@ def api_calendar_events():
'related_avg_chg': round(related_avg_chg, 2),
'related_max_chg': round(related_max_chg, 2),
'related_week_chg': round(related_week_chg, 2),
'former': event.former,
'forecast': event.forecast,
'fact': event.fact
'former': cleaned_former,
'forecast': cleaned_forecast,
'fact': cleaned_fact
}
# 可选:添加搜索匹配标记
@@ -4948,8 +5246,8 @@ def api_calendar_events():
# 11. 投资日历-数据接口
@app.route('/api/calendar/data', methods=['GET'])
@token_required
@pro_or_max_required
def api_calendar_data():
"""投资日历数据接口"""
try:
@@ -5136,8 +5434,8 @@ def extract_concepts_from_concepts_field(concepts_text):
@app.route('/api/calendar/detail/<int:item_id>', methods=['GET'])
@token_required
@pro_or_max_required
def api_future_event_detail(item_id):
"""未来事件详情接口 - 连接 future_events 表 (修正数据解析) - 仅限 Pro/Max 会员"""
try:
@@ -5372,8 +5670,8 @@ def api_future_event_detail(item_id):
# 13-15. 筛选弹窗接口(已有,优化格式)
@app.route('/api/filter/options', methods=['GET'])
@token_required
@pro_or_max_required
def api_filter_options():
"""筛选选项接口"""
try:
@@ -5952,7 +6250,7 @@ if __name__ == '__main__':
port=5002,
debug=True,
ssl_context=(
'/home/ubuntu/dify/docker/nginx/ssl/fullchain.pem',
'/home/ubuntu/dify/docker/nginx/ssl/privkey.pem'
'/etc/letsencrypt/live/api.valuefrontier.cn/fullchain.pem',
'/etc/letsencrypt/live/api.valuefrontier.cn/privkey.pem'
)
)