万能墙开放平台

开放平台

万能墙对外提供统一响应格式的 HTTP API(当前 160 个接口,100% 带说明与参数文档), 并提供插件扩展点体系:不改核心代码即可加功能。下面是开发与接入所需的全部文档。

160万能墙 API 接口
5市场插件
11插件下载量

插件开发快速开始

一个插件就是一个目录,放进站点 backend/plugins/ 即可被识别:

backend/plugins/my_plugin/
├── plugin.json    # 清单:名称/版本/依赖/能力/设置/后台页/定时任务
├── plugin.php     # 入口:启用时被加载,在这里注册钩子
└── lifecycle.php  # 可选:install / enable / disable / uninstall 回调

最小可用示例

{
  "slug": "my_plugin",
  "name": "我的插件",
  "version": "1.0.0",
  "author": "你的名字",
  "description": "一句话说明",
  "capabilities": ["admin_ui"],
  "settings": [{ "key": "text", "label": "文案", "type": "text", "default": "你好" }]
}
<?php
// plugin.php
addFilter('plugin_render_footer', function ($html) {
    return $html . '<div>' . htmlspecialchars(pluginSetting('my_plugin', 'text', ''), ENT_QUOTES, 'UTF-8') . '</div>';
});
registerApiRoute('my_ping', ['method' => 'GET', 'auth' => 'none'], function ($ctx) {
    return ['pong' => time()];
});
完整规范(清单字段、能力表、20+ 扩展点、设置/后台页/前台页/短代码/定时任务、日志与熔断)见下方「插件开发文档」全文。

插件开发文档(全文)

插件开发指南

> 目标:不改核心代码就能加功能。插件可以监听事件、改写数据与页面、注册接口、添加后台/前台页面、

> 定义设置项与定时任务;插件出错不会影响站点,出问题可一键全部停载。

目录结构

backend/plugins/<slug>/
├── plugin.json      清单(推荐;缺失时回退读 plugin.php 头部注释)
├── plugin.php       入口:启用时被 require,用来注册钩子
├── lifecycle.php    可选:install / enable / disable / uninstall 回调
└── ...              插件自己的其它文件(视图、资源、类)

slug 规则:小写字母/数字/-/_,2~40 位,且必须与目录名一致。

example/plugin.php.example 是旧版模板(.example 后缀不会被加载),可直接复制改名使用。

plugin.json

json
{
  "slug": "my_plugin",
  "name": "我的插件",
  "version": "1.0.0",
  "author": "你的名字",
  "description": "一句话说明它做什么",
  "requires": { "core": ">=1.0.0", "php": ">=7.4", "plugins": { "other_plugin": ">=1.0.0" } },
  "capabilities": ["db", "http", "mail", "admin_ui", "front_ui", "files"],
  "priority": 50,
  "settings": [
    { "key": "keyword", "label": "关键词", "type": "text", "default": "", "help": "说明文字" }
  ],
  "hooks": ["post_card_html", "plugin_render_footer"],
  "cron": [{ "key": "rollup", "interval": 3600 }],
  "lifecycle": { "install": "lifecycle.php:onInstall", "uninstall": "lifecycle.php:onUninstall" },
  "admin": { "title": "统计面板", "icon": "fa-chart-simple", "desc": "后台页说明" },
  "front": { "index": "前台页面 /plugin.php?p=my_plugin&view=index" }
}
  • requires.plugins:依赖的插件必须先安装并启用,版本需满足规则;缺失/版本不符 → 该插件不会加载(后台显示「被阻止 + 原因」)。
  • 版本规则写法:>=1.2.0^1.2.0~1.2.01.2.**
  • capabilities:能力白名单,只有声明了对应能力才能用相应助手:

| 能力 | 你能用 |

| --- | --- |

| db | pluginCreateTable()、自建表(前缀 plugin_<slug>_,卸载时自动清理) |

| http | pluginHttp()(仅 http/https、带超时,禁止其它协议) |

| mail | 调用核心的发信函数(请自行限频) |

| admin_ui | registerAdminPage() 注册后台页面 |

| front_ui | registerFrontView() 注册前台页面 |

| files | 读写插件自己的目录 |

  • priority:1~99,数字小的先加载;依赖永远先于被依赖者(优先级不会打乱依赖)。
  • settingstype 支持 text / textarea / switch / number / select;后台会按它自动生成表单。

钩子(hooks)

php
// 监听事件
addAction('post_created', function ($postId, $userId, $content) { ... });

// 改写数据(返回新值)
addFilter('post_card_html', function ($html, $post, $comments) {
    return $html . '<div>我加的角标</div>';
}, 20);   // 第三个参数是优先级,越小越先执行

过滤器出错时会原样返回入参,不会把上游结果吃掉;所有回调异常都会被记录到插件日志并计入熔断计数。

核心扩展点

| 钩子 | 类型 | 参数 / 用途 |

| --- | --- | --- |

| api_request | action | $action, $method 接口请求进入 |

| api_response | filter | $response, $action 改写任意接口响应 |

| api_unknown_action | filter | null, $action 接管未知接口 |

| moderation_verdict | filter | $verdict, $content, $scene, $userId 改写审核结论(放行/加严) |

| moderation_words | filter | $words 追加本地违禁词 |

| post_publish_guard | filter | true, $ctx 返回 false 可否决发帖 |

| comment_publish_guard | filter | true, $ctx 可否决评论 |

| post_created | action | $postId, $userId, $content |

| post_deleted / post_restored / post_purged | action | $postId, $byId, $byType / $postId |

| comment_created | action | $commentId, $postId, $userId |

| user_registered | action | $userId, $username |

| admin_action | action | $postedActions, $page, $adminId 后台动作审计 |

| plugin_loaded | action | $slug |

| post_card_html | filter | $html, $post, $comments 帖子卡片 |

| feed_posts | filter | $posts, $ctx 信息流数据 |

| plugin_render_body_top / plugin_render_footer / plugin_render_nav_extra | filter | $html, $ctx 前台渲染注入(无需改页面代码) |

后台「API与插件」页会列出全部钩子(hookDocs())。

注册接口

php
registerApiRoute('my_stats', [
    'method' => 'GET',            // GET / POST / ANY
    'auth'   => 'login',          // none / login
    'admin'  => false,            // true = 需要后台身份
    'module' => 'chat',           // 可选:绑定模块开关,模块关闭时自动 403
    'desc'   => '我的统计',
], function ($ctx) {              // $ctx = slug/action/route/user_id/db
    return ['total' => 42];       // 返回数组会被包上统一响应外壳
});

访问:/api?action=my_stats。接口会出现在「API与插件」的接口清单里(api_index / api_hooks)。

后台页面 / 前台页面 / 短代码 / 定时任务

php
// 后台页面(需要 admin_ui 能力):入口在 后台 → 插件管理 → 插件页
registerAdminPage('my_plugin', ['title' => '统计面板', 'icon' => 'fa-chart-simple', 'desc' => '说明'], function ($ctx) {
    echo '<p>用 PHP 直接输出你的界面即可</p>';
});

// 前台页面(需要 front_ui 能力):/plugin.php?p=my_plugin&view=index
registerFrontView('my_plugin', 'index', function ($ctx) {
    return '<!DOCTYPE html><html>...你的页面...</html>';
});

// 短代码:帖子内容里写 [my_tag name="x"]内容[/my_tag]
addShortcode('my_tag', function ($attrs, $inner) { return '<b>' . $inner . '</b>'; });

// 定时任务:interval 秒,随站点流量触达(不需要服务器 cron)
registerPluginCron('my_plugin', 'rollup', 3600, function ($ctx) { /* 每小时跑一次 */ });

设置读写

php
pluginSetting('my_plugin', 'keyword', '默认值');           // 读单个
pluginSetting('my_plugin');                                // 读全部(含 schema 默认值)
pluginSaveSettings('my_plugin', ['keyword' => '新值']);    // 写

设置存在 plugin_settings 表,按插件隔离;卸载插件时自动清空。

自建表与卸载清理

php
pluginCreateTable('my_plugin', 'hits', 'keyword TEXT PRIMARY KEY, hits INTEGER DEFAULT 0, updated_at TEXT');
$table = pluginTableName('my_plugin') . '_hits';   // plugin_my_plugin_hits
  • 表名统一 plugin_<slug>_* 前缀;
  • 卸载插件时,pluginUninstall() 会 DROP 掉该前缀下的所有表,并清空设置与日志。

日志、故障与熔断

php
pluginLog('my_plugin', 'info', '开始处理');
pluginFault('my_plugin', '外部接口超时');   // 记一次故障(一般不用手写,回调异常会自动记)
  • 后台「插件管理 → 日志」可看每个插件的最近 100 条日志;
  • 1 小时内故障达到阈值(默认 10 次,PLUGIN_FAULT_LIMIT 可调)→ 该插件在本次请求被跳过,标记「已熔断」;管理员在线时自动停用;
  • 「重置故障」可解除熔断。

安装与卸载

  • 后台「插件管理」→ 上传 zip(zip 内需含 plugin.jsonplugin.php,可放在根目录或一层子目录),上限 8MB;
  • 也可以直接把插件目录放进 backend/plugins/
  • 卸载会:跑 uninstall 回调 → 删掉 plugin_<slug>_* 表 → 清空设置与日志 → 删除插件目录。

出问题时怎么快速止损

1. 安全模式:访问 ?no_plugins=<钥匙>(钥匙在「插件管理」页有现成链接),或把 PLUGIN_SAFE_MODE=true 写进 backend/.env.php

2. 安全模式下所有插件都不加载,站点回到纯核心状态;

3. 到「插件管理」逐个启用,定位问题插件,必要时「卸载」。

两个现成示例

| 插件 | 演示了什么 |

| --- | --- |

| hello_world | 过滤器、渲染注入、导航注入、短代码、API 接口、后台页面、前台页面、设置项 |

| post_badge | 自建表、生命周期回调(install/uninstall)、定时任务、设置项、熔断计数 |

铁律

  • 插件不得修改核心文件;一切扩展走钩子/注册函数;
  • 不要在入口文件里直接执行耗时操作(入口每个请求都会跑),耗时逻辑放定时任务或钩子;
  • 数据库一律通过 getDB() 与预处理语句;不要拼接用户输入;
  • 输出到 HTML 的内容必须转义(htmlspecialchars);
  • 需要外网/发信/建表时先声明能力,别绕开助手函数。

万能墙 API 文档(全文)

由万能墙后台从 backend/api_meta.php 的接口说明表自动导出(100% 覆盖,含参数与鉴权说明)。

万能墙 API 接口文档

> 自动生成(来源:backend/api_meta.php 的接口说明表 + api.php 源码扫描),请勿手改。

> 接口总数 160(GET 58 / POST 102,需登录 74,后台接口 21,插件接口 0),已写说明 160/160

调用约定

  • 入口:/api?action=<接口名>;成功与失败都返回 JSON,统一带 success / code / api_version / data
  • 写接口必须 POST,并携带 csrf_token(先调 get_csrf 取,或放请求头 X-CSRF-Token)。
  • 需要登录的接口未登录时返回 AUTH_REQUIRED;后台接口返回 FORBIDDEN,账号被停用返回 ACCOUNT_DISABLED
  • 模块被关闭时相关接口返回 MODULE_CLOSED;管理员校区范围外返回 OUT_OF_SCOPE
  • 完整机器可读清单:api?action=api_index;钩子清单:api?action=api_hooks

聊天室(12)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| chat_create | POST | 登录 | 创建聊天室(房主自动成为管理员) |

| chat_delete_message | POST | 登录 | 撤回/删除聊天消息(房主或管理员) |

| chat_history | GET | 公开 | 聊天记录(按房间与时间游标拉取历史消息) |

| chat_join | POST | 登录 | 加入聊天室(写入成员表,房主自动成为管理员) |

| chat_leave | POST | 登录 | 退出聊天室(房主退出会移交或关闭房间) |

| chat_poll | GET | 公开 | 聊天增量轮询(拉取新消息、成员、投票等) |

| chat_room_context | POST | 登录 | 聊天室首页所需上下文(房间信息 + 成员 + 我的身份) |

| chat_rooms | GET | 公开 | 聊天室列表(含人数、消息数与我的身份) |

| chat_send | POST | 登录 | 发言(关键词过滤 + 限流) |

| chat_set_admin | POST | 登录 | 设置/取消聊天室管理员(房主权限) |

| chat_vote | POST | 登录 | 聊天室内投票(如踢人表决) |

| chat_vote_status | GET | 公开 | 聊天室投票当前状态 |

聊天室 · 参数

chat_create

  • name — string 房间名
  • description — string 房间简介

chat_delete_message

  • room_id — int 房间 ID
  • message_id — int 消息 ID

chat_join

  • room_id — int 房间 ID

chat_leave

  • room_id — int 房间 ID

chat_poll

  • room_id — int 房间 ID
  • since_id — int 上次拿到的最大消息 ID

chat_room_context

  • id — int 房间 ID

chat_send

  • room_id — int 房间 ID
  • content — string 消息内容(先过关键词库,命中则拦截/打码)

chat_set_admin

  • room_id — int 房间 ID
  • target_id — int 目标用户 ID
  • make_admin — bool 1 设为管理员 / 0 取消管理员

chat_vote

  • room_id — int 房间 ID
  • candidate_id — int 被投票的目标

chat_vote_status

  • room_id — int 房间 ID

硬币系统(3)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| coin | POST | 登录 | 给帖子投币(消耗自己的硬币,受限流与余额校验) |

| coin_balance | GET | 登录 | 当前用户硬币余额与今日已得 |

| coin_transactions | GET | 登录 | 硬币收支流水(最近若干条) |

硬币系统 · 参数

coin

  • post_id — int 帖子 ID
  • count — int 投币数量

校草校花(9)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| contest_candidate | GET | 公开 | 校草校花投稿详情(本人或审核人可见) |

| contest_comment | POST | 公开 | 候选人留言(先打码再送审) |

| contest_entry | POST | 登录 | 校草校花投稿 |

| contest_vote | POST | 登录 | 校草校花投票 |

| get_contest | GET | 公开 | 校草校花评比数据 |

| get_contest_candidate | GET | 公开 | 校草校花候选人详情 |

| get_contest_champions | GET | 公开 | 历届校草校花冠军榜 |

| get_contest_comments | GET | 公开 | 候选人留言列表 |

| get_contest_review | GET | 登录 | 待审核的校草校花投稿列表(审核人用) |

校草校花 · 参数

contest_comment

  • candidate_id — int 候选人 ID
  • content — string 留言内容
  • publish_as — enum 发布身份:account 用账号名 / anonymous 匿名
  • nickname — string 兼容旧客户端
  • fingerprint — string 设备指纹
  • admin_username — string 可选,风纪委员认证
  • admin_password — string 可选,认证密码

contest_entry

  • category — enum 组别:hunk 校草 / beauty 校花
  • dimension — enum 维度:real 三次元 / fiction 二次元
  • name — string 姓名或角色名
  • bio — string 简介
  • photo — string 照片文件名
  • grade — string 年级
  • class_name — string 班级
  • submitter_name — string 投稿人真实姓名
  • submitter_grade — string 投稿人年级
  • submitter_class — string 投稿人班级
  • agree_terms — bool 1 表示已签署免责条款与承诺书
  • terms_start — int 开始阅读条款的时间戳
  • fingerprint — string 设备指纹

contest_vote

  • id — int 候选人 ID(每人每天每组限票)

get_contest_review

  • format — json 时返回结构化数据

基础(86)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| account_bindings | GET | 登录 | 查询当前账号的第三方绑定情况 |

| admin_announcement_save | POST | 后台 | 新增/编辑公告(支持 Markdown 与配图) |

| admin_announcements_list | POST | 后台 | 后台公告列表(含草稿与发布时间) |

| admin_comment_delete | POST | 后台 | 后台删除评论 |

| admin_comments_list | POST | 后台 | 后台评论列表(按帖子筛选,分页) |

| admin_config_get | POST | 后台 | 后台读取站点配置(仅后台身份,返回可配置项) |

| admin_config_save | POST | 后台 | 后台配置保存 |

| admin_event_review | POST | 后台 | 趣事审核(列表/通过/驳回/删除) |

| admin_food_review | POST | 后台 | 必吃榜审核(列表/通过/驳回/删除/编辑) |

| admin_hero_review | POST | 后台 | 豪王赛审核(列表/通过/驳回/删除) |

| admin_login | POST | 公开 | 后台登录(密码或 U 盘密钥,带限流与登录日志) |

| admin_logout | POST | 后台 | 后台退出登录(清除后台会话) |

| admin_post_action | POST | 后台 | 后台帖子操作(软删/恢复/永久删除/置顶/关评论/改内容) |

| admin_posts_list | POST | 后台 | 后台帖子列表(分页 + 关键词 + 状态筛选,按管理员的校区范围过滤) |

| admin_report_handle | POST | 后台 | 处理举报(忽略 / 删帖 / 删帖并拉黑设备) |

| admin_reports_list | POST | 后台 | 后台举报列表(按状态筛选) |

| admin_user_action | POST | 后台 | 后台用户操作(改名/改头衔/删除/删除并连带帖子进回收站) |

| admin_users_list | POST | 后台 | 后台用户列表(分页 + 关键词,按管理员的校区范围过滤) |

| agree_terms | POST | 登录 | 记录同意用户协议(阅读时长由服务端校验) |

| ai_draft | POST | 登录 | AI 草稿生成(润色通道) |

| ai_faq | POST | 登录 | AI 规则问答(润色通道) |

| ai_polish | POST | 登录 | 文案润色(润色通道) |

| ai_polish_test | POST | 后台 | AI 润色联调测试(后台配置页用,消耗一次 AI 调用) |

| aidiy_test | POST | 公开 | 自定义 AI 通道自检 |

| api_hooks | GET | 登录 | 可用钩子(action/filter)清单与说明 |

| api_index | GET | 登录 | 接口清单(含方法/鉴权/参数/来源),供插件与文档使用 |

| apply_upload_music_dup | POST | 后台 | 应用「重名音乐」的处理决策(覆盖/保留/跳过) |

| bind_email_request | POST | 登录 | 绑定/更换邮箱:校验密码后发验证邮件 |

| captcha | GET | 公开 | 生成图形验证码(发帖/评论前的人机校验) |

| change_password | POST | 公开 | 修改/设置密码(QQ 微信注册的账号无需原密码,只需新密码两次) |

| check_update | GET | 公开 | 客户端版本检查 |

| cloud_ai_test | POST | 公开 | 云端审核通道自检 |

| contest_review | POST | 登录 | 校草校花审核(风纪委员/管理员通过或驳回) |

| delete_account | POST | 登录 | 注销账号(校验密码;连带清理关注/硬币/统计/头像,帖子保留) |

| delete_avatar | POST | 登录 | 删除头像(引用计数归零后物理删除文件) |

| delete_music_cover | POST | 后台 | 删除音乐封面(无人引用时物理删除) |

| forgot_password | POST | 公开 | 忘记密码(发重置邮件) |

| get_about | GET | 公开 | 关于页数据(统计/运行时间/鸣谢) |

| get_announcement | GET | 公开 | 当前生效的站点公告 |

| get_cloud_announcements | GET | 公开 | 拉取云端公告(后台/前台提示条) |

| get_cloud_sensitive_words | GET | 公开 | 拉取云端预置敏感词(聊天关键词库) |

| get_csrf | GET | 公开 | 取 CSRF token(写操作必须带 X-CSRF-Token) |

| get_feedbacks | GET | 公开 | 反馈列表(管理员看全部,普通用户看自己的) |

| get_latest_version | GET | 公开 | 查询最新版本与更新说明 |

| get_memorial | GET | 公开 | 纪念日/缅怀日内容 |

| get_post | GET | 公开 | 帖子详情(含作者展示信息、媒体、点赞与评论) |

| get_profile | GET | 公开 | 个人主页数据 |

| get_schools | GET | 公开 | 学校列表(按级别/区域组织,投稿与个人中心选择用) |

| get_site_bg | GET | 公开 | 站点背景图配置(主题用) |

| get_topics | GET | 公开 | 话题标签列表 |

| heartbeat | POST | 公开 | 页面心跳(更新在线状态与最后活跃时间) |

| like_music | POST | 公开 | 点赞音乐(切换式) |

| listing_hide | POST | 登录 | 卖家隐藏/显示自己的商品 |

| login | POST | 公开 | 账号密码登录 |

| logout | POST | 登录 | 退出登录(销毁会话;需登录) |

| me | GET | 登录 | 当前登录用户信息与个人中心开关 |

| my_posts | GET | 登录 | 我的帖子 / 回收站 / 被风纪处理的帖子 |

| oauth_consume_ticket | GET | 公开 | 消费一次登录票据(把票据换成会话,票据一次性) |

| oauth_pair_new | POST | 公开 | 生成「扫码绑定」配对码(新设备/新浏览器确认用) |

| oauth_pair_poll | GET | 公开 | 轮询配对结果(绑定是否已被确认) |

| online_count | GET | 公开 | 当前在线人数(心跳统计,带短缓存) |

| page_context | GET | 登录 | 页面壳渲染所需的登录态与站点配置 |

| record_music_play | POST | 公开 | 记录一次音乐播放(播放量统计) |

| register | POST | 公开 | 邮箱注册(需同意条款 + 阅读 20 秒) |

| report_post | POST | 公开 | 举报帖子(写入待处理举报列表) |

| resend_verification | POST | 公开 | 重发邮箱验证邮件(可带账号标识与密码确认) |

| reset_password | POST | 公开 | 通过邮件链接重置密码 |

| submit_feedback | POST | 公开 | 提交用户反馈(可留联系方式) |

| toggle_post_comments | POST | 登录 | 楼主关闭/开启自己帖子的评论区 |

| unbind_email | POST | 登录 | 解绑邮箱(需密码确认) |

| unbind_oauth | POST | 登录 | 解绑第三方账号(需密码确认) |

| update_email_notify | POST | 登录 | 新帖邮件推送开关(默认关闭) |

| update_email_react_notify | POST | 登录 | 点赞/评论邮件通知开关(默认关闭) |

| update_profile | POST | 登录 | 更新资料(昵称/学校等) |

| update_school | POST | 登录 | 保存学校信息(级别/区域/学校名) |

| update_show_android_btn | POST | 登录 | 首页「安卓客户端」按钮开关(下载功能已下线,仅保留接口兼容) |

| update_show_music_player | POST | 登录 | 个人中心音乐播放器显示开关 |

| update_username | POST | 登录 | 修改用户名(有频率与敏感词校验) |

| upload | POST | 登录 | 通用媒体上传(图片/视频,返回文件地址;发帖前上传需在规定时间内使用,否则会被自动清理) |

| upload_avatar | POST | 登录 | 上传头像(自动压缩) |

| upload_music | POST | 后台 | 上传音乐文件到曲库(管理员/音乐管理员) |

| upload_music_cover | POST | 后台 | 上传/替换音乐封面 |

| verify_admin | POST | 公开 | 校验后台账号密码(用于敏感操作二次确认) |

| verify_captcha | POST | 公开 | 校验图形验证码 |

| verify_email | GET | 公开 | 邮箱验证链接落地(校验 token 并标记已验证) |

| year_review_stats | POST | 登录 | 年度报告统计数据 |

基础 · 参数

admin_announcement_save

  • id — int 公告 ID(0 表示新增)
  • content — string 公告正文(支持 Markdown)
  • image — string 配图文件名
  • mode — enum 操作:save 保存 / toggle 切换显示 / delete 删除

admin_comment_delete

  • id — int 评论 ID

admin_comments_list

  • post_id — int 指定帖子的评论(0 表示不筛)
  • offset — int 起始位置(分页)
  • limit — int 每页条数(1~50)

admin_config_save

  • site_name — string 站点名称
  • theme — string 主题色
  • theme_scheme — string 配色方案
  • custom_colors — json 自定义配色
  • theme_auto_switch — bool 1 开启主题自动切换
  • pure_mode — bool 1 简洁模式
  • login_enabled — bool 1 开放登录
  • login_required — bool 1 强制登录
  • email_verify_enabled — bool 1 开启邮箱验证
  • maintenance_enabled — bool 1 开启维护模式
  • maintenance_start — string 维护开始时间 HH:MM
  • maintenance_end — string 维护结束时间 HH:MM
  • bug_page_enabled — bool 1 开启报错页
  • bug_page_start — string 报错页开始时间
  • bug_page_end — string 报错页结束时间
  • bug_page_reason — string 报错页说明文案
  • sensitive_words — string 自定义敏感词(换行分隔)

admin_event_review

  • op — enum 操作:list 列表 / toggle 通过-驳回 / delete 删除
  • id — int 趣事 ID

admin_food_review

  • op — enum 操作:list 列表 / toggle 通过-驳回 / delete 删除 / edit 编辑
  • id — int 条目 ID
  • name — string 店名或菜名
  • category — string 分类
  • address — string 地址
  • description — string 推荐理由

admin_hero_review

  • op — enum 操作:list 列表 / toggle 通过-驳回 / delete 删除
  • id — int 参赛者 ID

admin_login

  • username — string 管理员账号
  • password — string 登录密码
  • usb_key — string 可选,U 盘密钥文件内容
  • login_mode — enum 登录方式:password 密码 / usb U 盘密钥

admin_post_action

  • id — int 帖子 ID
  • op — enum 操作:delete 软删 / restore 恢复 / purge 永久删除 / pin 置顶 / unpin 取消置顶 / toggle_comments 切换评论区 / edit 改内容
  • content — string op=edit 时的新正文

admin_posts_list

  • offset — int 起始位置(分页)
  • limit — int 每页条数(1~50)
  • filter — enum 筛选:all 全部 / active 正常 / deleted 回收站 / pending 待审
  • q — string 关键词(正文或昵称)

admin_report_handle

  • id — int 举报 ID
  • mode — enum 处理方式:dismiss 忽略 / delete 删除帖子 / delete_ban 删除并拉黑设备

admin_reports_list

  • status — enum 状态:0 待处理 / 1 已忽略 / 2 已删除 / 3 已删除并拉黑 / all 全部
  • offset — int 起始位置(分页)
  • limit — int 每页条数(1~50)

admin_user_action

  • id — int 用户 ID
  • op — enum 操作:rename 改名 / title 改头衔 / delete 删号 / delete_with_posts 删号并连带帖子进回收站
  • username — string op=rename 时的新用户名
  • title — string op=title 时的新头衔

admin_users_list

  • q — string 关键词(用户名或头衔)
  • offset — int 起始位置(分页)
  • limit — int 每页条数(1~50)

agree_terms

  • terms_read_start — int 开始阅读的时间戳

ai_draft

  • topic — string 话题
  • column — string 栏目

ai_faq

  • q — string 用户提问(返回帮助中心答案)

ai_polish

  • content — string 待润色文本(返回润色结果,不落库)

ai_polish_test

  • content — string 待润色文本

aidiy_test

  • content — string 测试文本(验证 AI 自定义接口)

apply_upload_music_dup

  • file — string 文件名
  • title — string 歌曲标题
  • cover — string 封面文件名
  • dup_action — enum 处理:overwrite 覆盖 / keep 都保留 / skip 跳过

bind_email_request

  • email — string 新邮箱
  • password — string 当前密码

change_password

  • password — string 新密码
  • password2 — string 再次输入
  • old_password — string 老密码(已设置过密码的账号必填)

cloud_ai_test

  • content — string 测试文本(验证云端 AI 通道连通性)

contest_review

  • id — int 投稿 ID
  • approve — 1|0 通过或驳回
  • reason — string 驳回理由

delete_account

  • password — string 当前密码(注销前确认)

delete_music_cover

  • file — string 文件名

forgot_password

  • identifier — string 用户名或邮箱

get_feedbacks

  • filter — enum 筛选:all 全部 / pending 待处理 / done 已处理
  • format — string 传 json 返回结构化数据

heartbeat

  • uid — int 可选,未登录时用匿名标识

like_music

  • file — string 文件名

listing_hide

  • id — int 商品 ID
  • hidden — bool 1 隐藏 / 0 显示

login

  • username — string 用户名或邮箱
  • password — string 密码
  • remember — bool 1 记住我(30 天免登录)

oauth_consume_ticket

  • ticket — string 登录票据

oauth_pair_poll

  • pair — string 配对码

record_music_play

  • file — string 文件名

register

  • email — string 邮箱
  • username — string 可选,用户名(留空自动生成)
  • password — string 密码
  • agree_terms — bool 1 表示已同意用户协议
  • terms_start — int 开始阅读协议的时间戳

report_post

  • post_id — int 帖子 ID
  • reason — string 举报类型
  • detail — string 补充说明
  • fingerprint — string 设备指纹

resend_verification

  • identifier — string 用户名或邮箱
  • password — string 可选,密码确认
  • old_password — string 可选
  • password2 — string 可选
  • username — string 可选
  • token — string 可选,验证令牌

reset_password

  • token — string 邮件里的重置令牌
  • password — string 新密码

submit_feedback

  • content — string 反馈内容
  • contact — string 联系方式
  • fingerprint — string 设备指纹

toggle_post_comments

  • post_id — int 帖子 ID

unbind_email

  • password — string 当前密码

unbind_oauth

  • provider — enum 平台:qq / wx
  • password — string 当前密码(确认身份)

update_email_notify

  • email_notify — 0|1 新帖发布邮件推送开关

update_email_react_notify

  • email_react_notify — 0|1 点赞/评论邮件提醒开关

update_profile

  • bio — string 个性签名
  • contact — string 联系方式
  • phone — string 手机号
  • grade — string 年级
  • class_name — string 班级

update_school

  • school_level — enum 学段:high 高中 / middle 初中
  • school_area — string 区域
  • school_name — string 学校名称

update_show_android_btn

  • show_android_btn — bool 1 显示 / 0 隐藏(下载功能已下线,仅保留兼容)

update_show_music_player

  • show_music_player — bool 1 显示音乐播放器 / 0 隐藏

update_username

  • username — string 新用户名

upload

  • file — file 媒体文件(图片/视频,字段名 file)

upload_avatar

  • file — file 头像图片(表单字段 file,服务端转 webp 并清理旧头像)

upload_music

  • dup_action — overwrite|keep|skip 重名处理

upload_music_cover

  • file — file 图片文件

verify_admin

  • username — string 管理员账号
  • password — string 密码

verify_captcha

  • code — string 用户输入的验证码

verify_email

  • token — string 邮件里的验证令牌

year_review_stats

  • with_user — int 可选,是否带上当前用户维度

小法庭(7)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| court_file | POST | 登录 | 提起小法庭诉讼(原告填写被告、原因与诉求,可附证据) |

| court_respond | POST | 登录 | 小法庭应诉(被告提交答辩与证据) |

| court_vote | POST | 登录 | 小法庭投票(原告/被告方,按投票人资格校验) |

| court_withdraw | POST | 登录 | 原告撤诉(案件转为已撤诉,不再计票) |

| get_court_case | GET | 公开 | 小法庭案件详情(含证据与票数) |

| get_court_cases | GET | 公开 | 小法庭案件列表 |

| get_court_users | GET | 公开 | 小法庭可投票用户列表(按学校范围) |

小法庭 · 参数

court_file

  • defendant_id — int 被告用户 ID
  • reason — string 起诉原因
  • claim — string 诉求
  • evidence_list — json 证据文件数组

court_respond

  • case_id — int 案件 ID
  • statement — string 答辩说明
  • claim — string 反诉诉求
  • evidence_list — json 证据文件数组

court_vote

  • case_id — int 案件 ID
  • side — plaintiff|defendant 支持哪一方

court_withdraw

  • case_id — int 案件 ID

get_court_case

  • id — int 案件 ID
  • format — json 时返回结构化数据

风纪委员会(6)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| discipline_apply | POST | 登录 | 申请加入风纪委员会(填写真实姓名/年级/班级/学校) |

| discipline_post | POST | 登录 | 风纪处理帖子:hide/show/delete(需理由、留痕、限额) |

| discipline_remove | POST | 登录 | 移除某用户的风纪委员身份(风纪主席/超管) |

| discipline_review | POST | 登录 | 审批风纪委员会入会申请(风纪主席/超管) |

| get_discipline | GET | 登录 | 风纪委员会主页数据(成员/申请/日志) |

| get_discipline_logs | GET | 登录 | 风纪操作留痕 |

风纪委员会 · 参数

discipline_apply

  • real_name — string 真实姓名
  • grade — string 年级
  • class — string 班级
  • school — string 学校

discipline_post

  • op — delete|restore|hide 等风纪操作
  • post_id — int 帖子 ID
  • reason — string 处理理由(留痕)

discipline_remove

  • user_id — int 用户 ID

discipline_review

  • app_id — int 申请 ID
  • approve — 1|0 通过或驳回

get_discipline

  • format — json 时返回结构化数据

趣事(4)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| create_event | POST | 登录 | 投稿趣事(官方/小道消息 + 时间地点,需审核) |

| event_comment | POST | 登录 | 趣事评论(支持匿名/账号身份,过词库与限流) |

| get_event | GET | 公开 | 趣事详情(含评论) |

| get_events | GET | 公开 | 校园趣事列表 |

趣事 · 参数

create_event

  • name — string 标题
  • description — string 内容
  • location — string 地点
  • event_date — string 时间
  • msg_type — enum 消息类型:official 官方 / rumor 小道
  • publish_as — enum 发布身份:account 用账号名 / anonymous 匿名
  • nickname — string 兼容旧客户端
  • fingerprint — string 设备指纹

event_comment

  • event_id — int 趣事 ID
  • content — string 评论内容
  • publish_as — enum 发布身份:account 用账号名 / anonymous 匿名
  • nickname — string 兼容旧客户端
  • fingerprint — string 设备指纹

get_event

  • id — int 趣事 ID
  • format — json 时返回结构化数据

关注关系(4)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| follow | POST | 登录 | 关注/取关某用户(切换式) |

| follow_list | GET | 公开 | 关注/粉丝列表 |

| follow_stats | GET | 公开 | 某用户的关注数/粉丝数与是否已关注 |

| update_follower_privacy | POST | 登录 | 设置粉丝数是否公开 |

关注关系 · 参数

follow

  • target_id — int 目标用户 ID

follow_list

  • target_id — int 目标用户 ID
  • mode — enum 列表类型:following 我关注的 / followers 关注我的

follow_stats

  • target_id — int 目标用户 ID

update_follower_privacy

  • show — bool 1 公开粉丝数 / 0 隐藏

foods(5)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| create_food | POST | 登录 | 投稿必吃榜(店铺/菜品 + 图片,需审核) |

| food_comment | POST | 登录 | 必吃榜评论(可带评分) |

| food_like | POST | 公开 | 给必吃榜条目点赞(去重) |

| get_food | GET | 公开 | 必吃榜条目详情(含评论) |

| get_foods | GET | 公开 | 必吃榜列表(可按分类/关键词/学校筛选) |

foods · 参数

create_food

  • name — string 店名或菜名
  • category — string 分类
  • address — string 地址
  • description — string 推荐理由
  • image — string 图片文件名
  • publish_as — enum 发布身份:account 用账号名 / anonymous 匿名
  • nickname — string 兼容旧客户端
  • fingerprint — string 设备指纹

food_comment

  • food_id — int 条目 ID
  • content — string 评论内容
  • rating — int 1~5 评分
  • publish_as — enum 发布身份:account 用账号名 / anonymous 匿名
  • nickname — string 兼容旧客户端
  • fingerprint — string 设备指纹

food_like

  • id — int 条目 ID

get_food

  • id — int 条目 ID
  • format — json 时返回结构化数据

豪王赛(8)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| get_hero | GET | 公开 | 豪王赛参赛者详情(含票数、留言与应援数) |

| get_heroes | GET | 公开 | 豪王挑战赛列表 |

| hero_comment | POST | 登录 | 豪王赛留言(对参赛者的公开留言) |

| hero_entry | POST | 登录 | 豪王赛报名(姓名/年级/班级/事迹 + 照片) |

| hero_like | POST | 登录 | 给参赛者点赞(去重) |

| hero_poll | GET | 公开 | 豪王页轮询(增量拉取新留言/票数) |

| hero_ranking | GET | 公开 | 豪王排行榜(按票数) |

| hero_support | POST | 登录 | 支持/应援参赛者 |

豪王赛 · 参数

get_hero

  • id — int 参赛者 ID
  • format — json 时返回结构化数据

hero_comment

  • hero_id — int 参赛者 ID
  • content — string 留言内容
  • nickname — string 昵称
  • fingerprint — string 设备指纹

hero_entry

  • name — string 姓名
  • grade — string 年级
  • class_name — string 班级
  • deeds — string 事迹
  • photo — string 照片文件名
  • fingerprint — string 设备指纹

hero_like

  • hero_id — int 参赛者 ID

hero_poll

  • hero_id — int 参赛者 ID
  • last_id — int 上次拿到的最大 ID

hero_support

  • hero_id — int 参赛者 ID

校园集市(5)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| listing_create | POST | 登录 | 发布集市信息 |

| listing_delete | POST | 登录 | 卖家删除自己的商品(软删除进回收站) |

| listing_detail | GET | 公开 | 集市信息详情(浏览计数、卖家信息) |

| listing_status | POST | 登录 | 卖家标记商品状态(在售/已售/下架) |

| listings_list | GET | 公开 | 校园集市列表(按类型/学校/关键词筛选,支持分页) |

校园集市 · 参数

listing_create

  • title — string 标题
  • type — sell|buy|team|lost 信息类型
  • price — string 价格
  • description — string 描述
  • images — json 图片数组
  • contact — string 联系方式

listing_delete

  • id — int 商品 ID

listing_detail

  • id — int 商品 ID
  • format — json 时返回结构化数据

listing_status

  • id — int 商品 ID
  • status — on|sold|closed 目标状态

moderation(1)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| moderation_words | GET | 登录 | 本地违禁词表(前端即时预检用) |

music(3)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| get_music_library | GET | 公开 | 站点音乐库(含封面与播放次数) |

| get_music_list | GET | 公开 | 音乐列表(当前曲库与我的歌单) |

| save_music_list | POST | 登录 | 保存我的歌单顺序 |

music · 参数

save_music_list

  • list — json 文件名数组

帖子与互动(7)

| 接口 | 方法 | 鉴权 | 说明 |

| --- | --- | --- | --- |

| comment | POST | 登录 | 发表评论(支持匿名/账号身份,本地词库 + AI 审核 + 限流) |

| create_post | POST | 登录 | 发帖(本地违禁词 + AI 审核 + 限流) |

| delete_post | POST | 登录 | 删除自己的帖子(进回收站) |

| like | POST | 登录 | 点赞(防重 + 限流) |

| load_more_posts | GET | 公开 | 信息流分页加载(HTML 或 JSON,支持关键词与校区筛选) |

| purge_post | POST | 登录 | 永久删除自己删除的帖子(含媒体) |

| restore_post | POST | 登录 | 恢复自己删除的帖子(24h 内) |

帖子与互动 · 参数

comment

  • post_id — int 帖子 ID
  • content — string 评论内容
  • publish_as — enum 发布身份:account 用账号名 / anonymous 匿名
  • nickname — string 兼容旧客户端
  • fingerprint — string 设备指纹
  • admin_username — string 可选,管理员认证身份
  • admin_password — string 可选,管理员认证密码

create_post

  • content — string 正文
  • publish_as — enum 发布身份:account 用账号名 / anonymous 匿名
  • topic — string 可选,话题标签
  • media — json 媒体数组(文件地址)

delete_post

  • post_id — int 帖子 ID(仅本人,进回收站)

like

  • post_id — int 帖子 ID(服务端按用户/设备去重)

load_more_posts

  • page — int 页码
  • school — string 可选

purge_post

  • post_id — int 帖子 ID(永久删除,含媒体文件)

restore_post

  • post_id — int 帖子 ID(24 小时内可恢复)