✅派聪明 RAG 系统的接口文档
一、用户管理模块
01、用户注册接口
- URL:
/api/v1/users/register - Method: POST
- Request Body:
{
"username": "string", // 用户名,唯一
"password": "string" // 密码(明文传输,后端加密存储)
}
- Response:
{
"code": 200,// 成功
"message": "User registered successfully"
}
{
"code": 400, // 失败
"message": "Username already exists"
}
02、用户登录接口
- URL:
/api/v1/users/login - Method: POST
- Request Body:
{
"username": "string",
"password": "string"
}
- Response:
{
"code": 200,// 成功
"message": "Login successful",
"data": {
"token": "JWT_TOKEN_STRING"
}
}
{
"code": 401, // 失败
"message": "Invalid username or password"
}
03、获取用户信息接口
- URL:
/api/v1/users/me - Method: GET
- Headers:
- Authorization: Bearer JWT_TOKEN_STRING
- Response:
{
"code": 200,// 成功
"message": "Success",
"data": {
"id": 1,
"username": "example_user",
"role": "USER",
"orgTags": ["dept1", "team2"],
"primaryOrg": "dept1"
}
}
{
"code": 401, // 失败
"message": "Unauthorized"
}
04、组织标签管理接口
①、创建组织标签(管理员)
- URL:
/api/v1/admin/org-tags - Method: POST
- Headers:
- Authorization: Bearer JWT_TOKEN_STRING
- Request Body:
{
"tagId": "string", // 标签ID,唯一
"name": "string", // 标签名称
"description": "string", // 标签描述
"parentTag": "string" // 父标签ID(可选)
}
- Response:
{
"code": 200,
"message": "Organization tag created successfully"
}
回复