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": {

View File

@@ -111,6 +111,31 @@
}
}
},
"/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": [
@@ -244,6 +269,65 @@
}
}
}
},
"/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": {
@@ -446,6 +530,25 @@
}
}
},
"dto.UserStatusUpdateForm": {
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"enum": [
"normal",
"disabled"
],
"allOf": [
{
"$ref": "#/definitions/consts.UserStatus"
}
]
}
}
},
"gorm.DeletedAt": {
"type": "object",
"properties": {
@@ -552,6 +655,15 @@
}
}
},
"requests.KV": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {}
}
},
"requests.Pager": {
"type": "object",
"properties": {

View File

@@ -134,6 +134,17 @@ definitions:
verified_at:
type: string
type: object
dto.UserStatusUpdateForm:
properties:
status:
allOf:
- $ref: '#/definitions/consts.UserStatus'
enum:
- normal
- disabled
required:
- status
type: object
gorm.DeletedAt:
properties:
time:
@@ -204,6 +215,12 @@ definitions:
verified_at:
type: string
type: object
requests.KV:
properties:
key:
type: string
value: {}
type: object
requests.Pager:
properties:
items: {}
@@ -332,6 +349,22 @@ paths:
summary: 更新租户状态
tags:
- Super
/super/v1/tenants/statuses:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/requests.KV'
type: array
summary: 租户状态列表
tags:
- Super
/super/v1/users:
get:
consumes:
@@ -370,6 +403,45 @@ paths:
summary: 租户列表
tags:
- Super
/super/v1/users/{userID}/status:
patch:
consumes:
- application/json
parameters:
- description: UserID
format: int64
in: path
name: userID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.UserStatusUpdateForm'
produces:
- application/json
responses: {}
summary: 更新用户状态
tags:
- Super
/super/v1/users/statuses:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/requests.KV'
type: array
summary: 用户状态列表
tags:
- Super
securityDefinitions:
BasicAuth:
type: basic