From d8aa6e3db3613289c15a17590d1b36a7af3d3776 Mon Sep 17 00:00:00 2001 From: dzy Date: Mon, 2 Jun 2025 12:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20API.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 API.md diff --git a/API.md b/API.md new file mode 100644 index 0000000..c5d6fcf --- /dev/null +++ b/API.md @@ -0,0 +1,26 @@ +聊天服务器API文档 +1. 服务器概述 +‌服务类型‌: 混合服务(HTTP + Socket) +‌HTTP端口‌: 5001 (Flask) +‌Socket端口‌: 8888 +‌数据库‌: SQLite (usr.db) +2. HTTP API接口 +2.1 用户注册 +‌端点‌: POST /api/register +‌请求格式‌: +json +Copy Code +{ + "username": "string", + "password": "string" +} +‌成功响应‌: +json +Copy Code +{ + "success": true, + "message": "User registered successfully" +} +‌错误响应‌: +403: 用户名已存在 +500: 服务器内部错误 \ No newline at end of file