feat: add user management API with endpoint to retrieve current user information

This commit is contained in:
GW_MC
2025-12-20 12:27:10 +08:00
parent b0b765b8fa
commit e59e7ca4c8
6 changed files with 147 additions and 3 deletions

View File

@@ -105,6 +105,34 @@
}
}
}
},
"/api/user/me": {
"get": {
"tags": [
"User"
],
"summary": "Get current user information",
"description": "Returns the information of the currently authenticated user.",
"operationId": "get_user_info",
"responses": {
"200": {
"description": "User information retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserInfo"
}
}
}
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal server error"
}
}
}
}
},
"components": {
@@ -183,6 +211,25 @@
"type": "string"
}
}
},
"UserInfo": {
"type": "object",
"description": "System health information",
"required": [
"id",
"username"
],
"properties": {
"id": {
"type": "string",
"format": "uuid",
"description": "User ID"
},
"username": {
"type": "string",
"description": "Username"
}
}
}
}
},
@@ -194,6 +241,10 @@
{
"name": "Authentication",
"description": "Authentication API"
},
{
"name": "User",
"description": "User management API"
}
]
}