Files
Snap.Server/routes/announcement.py
2026-01-08 23:34:42 +08:00

15 lines
485 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from flask import Blueprint, jsonify, request
from services.announcement_service import get_announcements
announcement_bp = Blueprint("announcement", __name__)
@announcement_bp.route("/List", methods=["POST"])
def list_announcements():
# 获取用户已关闭的公告ID列表也可能没有请求体
request_data = request.get_json(silent=True) or []
return jsonify({
"code": 0,
"message": "OK",
"data": get_announcements(request_data)
})