feat: add user_list

This commit is contained in:
2025-12-17 13:24:32 +08:00
parent dae9a0e55a
commit 14842d989c
20 changed files with 736 additions and 130 deletions

View File

@@ -151,9 +151,8 @@ const docTemplate = `{
"responses": {}
}
},
"/v1/medias/{id}": {
"post": {
"description": "Test",
"/super/v1/tenants/{tenantID}/status": {
"patch": {
"consumes": [
"application/json"
],
@@ -161,27 +160,52 @@ const docTemplate = `{
"application/json"
],
"tags": [
"Test"
"Super"
],
"summary": "Test",
"summary": "更新租户状态",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"format": "int64",
"description": "TenantID",
"name": "tenantID",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "年龄",
"name": "age",
"description": "Form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.TenantStatusUpdateForm"
}
}
],
"responses": {}
}
},
"/super/v1/users": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Super"
],
"summary": "租户列表",
"parameters": [
{
"type": "string",
"name": "asc",
"in": "query"
},
{
"type": "string",
"description": "名称",
"name": "name",
"name": "desc",
"in": "query"
},
{
@@ -193,11 +217,21 @@ const docTemplate = `{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "tenantID",
"in": "query"
},
{
"type": "string",
"name": "username",
"in": "query"
}
],
"responses": {
"200": {
"description": "成功",
"description": "OK",
"schema": {
"allOf": [
{
@@ -206,8 +240,8 @@ const docTemplate = `{
{
"type": "object",
"properties": {
"list": {
"$ref": "#/definitions/v1.ResponseItem"
"items": {
"$ref": "#/definitions/dto.UserItem"
}
}
}
@@ -320,16 +354,17 @@ const docTemplate = `{
"status": {
"$ref": "#/definitions/consts.TenantStatus"
},
"status_description": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"userBalance": {
"type": "integer",
"format": "int64"
"user_balance": {
"type": "integer"
},
"userCount": {
"type": "integer",
"format": "int64"
"user_count": {
"type": "integer"
},
"user_id": {
"type": "integer"
@@ -345,6 +380,78 @@ const docTemplate = `{
}
}
},
"dto.TenantStatusUpdateForm": {
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"enum": [
"normal",
"disabled"
],
"allOf": [
{
"$ref": "#/definitions/consts.TenantStatus"
}
]
}
}
},
"dto.UserItem": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"deleted_at": {
"$ref": "#/definitions/gorm.DeletedAt"
},
"id": {
"type": "integer"
},
"metas": {
"type": "array",
"items": {
"type": "integer"
}
},
"owned": {
"$ref": "#/definitions/models.Tenant"
},
"password": {
"type": "string"
},
"roles": {
"type": "array",
"items": {
"$ref": "#/definitions/consts.Role"
}
},
"status": {
"$ref": "#/definitions/consts.UserStatus"
},
"status_description": {
"type": "string"
},
"tenants": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Tenant"
}
},
"updated_at": {
"type": "string"
},
"username": {
"type": "string"
},
"verified_at": {
"type": "string"
}
}
},
"gorm.DeletedAt": {
"type": "object",
"properties": {
@@ -465,9 +572,6 @@ const docTemplate = `{
"type": "integer"
}
}
},
"v1.ResponseItem": {
"type": "object"
}
},
"securityDefinitions": {