feat: 添加用户和租户状态管理功能,包括状态列表和状态更新接口

This commit is contained in:
2025-12-17 13:54:52 +08:00
parent 14842d989c
commit d5de64d6cf
14 changed files with 558 additions and 4 deletions

View File

@@ -117,6 +117,31 @@ const docTemplate = `{
}
}
},
"/super/v1/tenants/statuses": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Super"
],
"summary": "租户状态列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/requests.KV"
}
}
}
}
}
},
"/super/v1/tenants/{tenantID}": {
"patch": {
"consumes": [
@@ -250,6 +275,65 @@ const docTemplate = `{
}
}
}
},
"/super/v1/users/statuses": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Super"
],
"summary": "用户状态列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/requests.KV"
}
}
}
}
}
},
"/super/v1/users/{userID}/status": {
"patch": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Super"
],
"summary": "更新用户状态",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "UserID",
"name": "userID",
"in": "path",
"required": true
},
{
"description": "Form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.UserStatusUpdateForm"
}
}
],
"responses": {}
}
}
},
"definitions": {
@@ -452,6 +536,25 @@ const docTemplate = `{
}
}
},
"dto.UserStatusUpdateForm": {
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"enum": [
"normal",
"disabled"
],
"allOf": [
{
"$ref": "#/definitions/consts.UserStatus"
}
]
}
}
},
"gorm.DeletedAt": {
"type": "object",
"properties": {
@@ -558,6 +661,15 @@ const docTemplate = `{
}
}
},
"requests.KV": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {}
}
},
"requests.Pager": {
"type": "object",
"properties": {