用户详情

This commit is contained in:
ryan
2026-06-09 15:30:12 +08:00
parent 92664273ed
commit 73b220de3c
11 changed files with 1005 additions and 20 deletions
+177
View File
@@ -253,6 +253,7 @@ const docTemplate = `{
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "认证源 ID 或名称",
"name": "id",
"in": "path",
@@ -330,6 +331,7 @@ const docTemplate = `{
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "认证源 ID 或名称",
"name": "id",
"in": "path",
@@ -397,6 +399,7 @@ const docTemplate = `{
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "认证源 ID 或名称",
"name": "id",
"in": "path",
@@ -1948,6 +1951,156 @@ const docTemplate = `{
}
}
},
"/api/v1/admin/users/{id}": {
"get": {
"security": [
{
"SessionCookie": []
}
],
"description": "返回指定用户的完整个人资料和系统状态,需要管理员权限,不返回密码等敏感字段",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "获取用户详情",
"parameters": [
{
"type": "integer",
"description": "用户 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "用户详情",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/user.user"
}
}
}
]
}
},
"400": {
"description": "参数错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"403": {
"description": "无管理员权限",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"404": {
"description": "用户不存在",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
},
"delete": {
"security": [
{
"SessionCookie": []
}
],
"description": "删除指定非管理员用户,需要管理员权限,不能删除当前登录用户",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "删除用户",
"parameters": [
{
"type": "integer",
"description": "用户 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "删除成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/util.ResponseAny"
},
{
"type": "object",
"properties": {
"data": {
"type": "string"
}
}
}
]
}
},
"400": {
"description": "参数错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"401": {
"description": "未登录",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"403": {
"description": "无管理员权限、尝试删除管理员或当前用户",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"404": {
"description": "用户不存在",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/util.ResponseAny"
}
}
}
}
},
"/api/v1/admin/users/{id}/status": {
"put": {
"security": [
@@ -2225,6 +2378,7 @@ const docTemplate = `{
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "外部帐号绑定记录 ID",
"name": "id",
"in": "path",
@@ -4084,6 +4238,11 @@ const docTemplate = `{
"UploadStatusPending": "待使用",
"UploadStatusUsed": "已使用"
},
"x-enum-descriptions": [
"待使用",
"已使用",
"已删除"
],
"x-enum-varnames": [
"UploadStatusPending",
"UploadStatusUsed",
@@ -4723,9 +4882,18 @@ const docTemplate = `{
"avatar_url": {
"type": "string"
},
"bio": {
"type": "string"
},
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"gender": {
"type": "string"
},
"id": {
"type": "integer"
},
@@ -4738,14 +4906,23 @@ const docTemplate = `{
"last_login_at": {
"type": "string"
},
"location": {
"type": "string"
},
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"username": {
"type": "string"
},
"website": {
"type": "string"
}
}
},