保存现有功能 增加域名和添加时间关联

This commit is contained in:
huangzhenpc
2025-03-01 11:25:11 +08:00
parent 34eb2528c9
commit 0720ee9110

View File

@@ -1,6 +1,6 @@
from flask import Flask, request, jsonify from flask import Flask, request, jsonify
from .config import Config from .config import Config
from .utils import get_latest_emails, get_latest_email_with_code, add_allowed_domain, remove_allowed_domain, get_allowed_domains from .utils import get_latest_emails, get_latest_email_with_code, add_allowed_domain, remove_allowed_domain, get_allowed_domains, get_allowed_domains_with_time
def create_app(): def create_app():
app = Flask(__name__) app = Flask(__name__)
@@ -46,4 +46,9 @@ def create_app():
domains = get_allowed_domains() domains = get_allowed_domains()
return jsonify(domains), 200 return jsonify(domains), 200
@app.route('/allowed_domains_with_time', methods=['GET'])
def list_domains_with_time():
domains_with_time = get_allowed_domains_with_time()
return jsonify(domains_with_time), 200
return app return app