// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/api/upgrade/check": { "get": { "description": "检查是否有新版本可用(当前为预留接口,返回当前版本信息)", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "升级检查", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/internal_app_upgrade.UpgradeStatus" } } } } }, "/api/v1/audit/logs": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "分页查询审计日志,支持按用户、操作、资源筛选", "produces": [ "application/json" ], "tags": [ "Audit" ], "summary": "查询审计日志", "parameters": [ { "type": "integer", "description": "按用户 ID 筛选", "name": "user_id", "in": "query" }, { "type": "string", "description": "按操作筛选", "name": "action", "in": "query" }, { "type": "string", "description": "按资源类型筛选", "name": "resource", "in": "query" }, { "type": "integer", "description": "页码(默认 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "每页条数(默认 20)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/notifications": { "post": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "向指定用户发送通知", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Notification" ], "summary": "创建通知", "parameters": [ { "description": "通知内容", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_notification_domain.CreateNotificationRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_notification_domain.NotificationDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/notifications/read-all": { "put": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "将当前用户的所有通知标记为已读", "produces": [ "application/json" ], "tags": [ "Notification" ], "summary": "全部标记已读", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/notifications/unread-count": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "获取当前用户的未读通知数量", "produces": [ "application/json" ], "tags": [ "Notification" ], "summary": "获取未读通知数", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/notifications/user/{userId}": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "分页获取指定用户的通知列表", "produces": [ "application/json" ], "tags": [ "Notification" ], "summary": "获取用户通知列表", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "userId", "in": "path", "required": true }, { "type": "integer", "description": "页码(默认 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "每页条数(默认 20)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/notifications/{id}": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "根据 ID 获取指定通知的详细信息", "produces": [ "application/json" ], "tags": [ "Notification" ], "summary": "获取通知详情", "parameters": [ { "type": "integer", "description": "通知 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_notification_domain.NotificationDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "delete": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "删除指定通知", "tags": [ "Notification" ], "summary": "删除通知", "parameters": [ { "type": "integer", "description": "通知 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/notifications/{id}/read": { "put": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "将指定通知标记为已读", "tags": [ "Notification" ], "summary": "标记通知已读", "parameters": [ { "type": "integer", "description": "通知 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/org/tenants": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "获取系统中的所有租户列表", "produces": [ "application/json" ], "tags": [ "Org" ], "summary": "列出所有租户", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/mengstack_internal_modules_org_domain.TenantDTO" } } } } ] } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "post": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "创建新的租户(组织),需提供名称和 slug", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Org" ], "summary": "创建租户", "parameters": [ { "description": "租户信息", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_org_domain.CreateTenantRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_org_domain.TenantDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/org/tenants/{id}": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "根据 ID 获取指定租户的详细信息", "produces": [ "application/json" ], "tags": [ "Org" ], "summary": "获取租户详情", "parameters": [ { "type": "string", "description": "租户 ID (UUID)", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_org_domain.TenantDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "put": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "更新租户的名称、slug 或状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Org" ], "summary": "更新租户", "parameters": [ { "type": "string", "description": "租户 ID (UUID)", "name": "id", "in": "path", "required": true }, { "description": "更新内容", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_org_domain.UpdateTenantRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_org_domain.TenantDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "delete": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "删除指定租户及其所有关联数据", "tags": [ "Org" ], "summary": "删除租户", "parameters": [ { "type": "string", "description": "租户 ID (UUID)", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/rbac/permissions": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "获取所有权限列表,可按模块筛选", "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "列出权限", "parameters": [ { "type": "string", "description": "按模块筛选", "name": "module", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.PermissionDTO" } } } } ] } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/rbac/roles": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "获取当前租户下的所有角色", "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "列出角色", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.RoleDTO" } } } } ] } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "post": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "在当前租户下创建新角色", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "创建角色", "parameters": [ { "description": "角色信息", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.CreateRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.RoleDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/rbac/roles/{id}": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "根据 ID 获取角色信息,包含权限列表", "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "获取角色详情", "parameters": [ { "type": "integer", "description": "角色 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.RoleDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "put": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "更新角色名称或描述", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "更新角色", "parameters": [ { "type": "integer", "description": "角色 ID", "name": "id", "in": "path", "required": true }, { "description": "更新内容", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.UpdateRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.RoleDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "delete": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "删除指定角色(系统角色不可删除)", "tags": [ "RBAC" ], "summary": "删除角色", "parameters": [ { "type": "integer", "description": "角色 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/rbac/roles/{id}/permissions": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "获取指定角色已分配的权限列表", "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "获取角色权限列表", "parameters": [ { "type": "integer", "description": "角色 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.PermissionDTO" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "put": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "为角色批量设置权限(覆盖原有权限)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "设置角色权限", "parameters": [ { "type": "integer", "description": "角色 ID", "name": "id", "in": "path", "required": true }, { "description": "权限 ID 列表", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.SetRolePermissionsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/rbac/users/{userId}/roles": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "获取指定用户的所有角色及权限", "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "获取用户角色", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "userId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.RoleDTO" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "post": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "为指定用户分配一个角色", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "RBAC" ], "summary": "分配角色给用户", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "userId", "in": "path", "required": true }, { "description": "角色 ID", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.AssignRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/rbac/users/{userId}/roles/{roleId}": { "delete": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "从指定用户移除一个角色", "tags": [ "RBAC" ], "summary": "移除用户角色", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "userId", "in": "path", "required": true }, { "type": "integer", "description": "角色 ID", "name": "roleId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/settings": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "获取所有全局配置项", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "列出全局配置", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/mengstack_internal_modules_settings_domain.SettingDTO" } } } } ] } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/settings/global/{key}": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "根据 key 获取全局(非租户)配置项", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "获取全局配置", "parameters": [ { "type": "string", "description": "配置键名", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_settings_domain.SettingDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "put": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "创建或更新全局配置项", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "更新全局配置", "parameters": [ { "type": "string", "description": "配置键名", "name": "key", "in": "path", "required": true }, { "description": "配置值", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_settings_domain.UpdateSettingRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/settings/tenant": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "获取当前租户的所有配置项", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "列出租户配置", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/mengstack_internal_modules_settings_domain.SettingDTO" } } } } ] } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/v1/settings/tenant/{key}": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "根据 key 获取当前租户的配置项", "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "获取租户配置", "parameters": [ { "type": "string", "description": "配置键名", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_settings_domain.SettingDTO" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "put": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "创建或更新当前租户的配置项", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Settings" ], "summary": "更新租户配置", "parameters": [ { "type": "string", "description": "配置键名", "name": "key", "in": "path", "required": true }, { "description": "配置值", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_settings_domain.UpdateSettingRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "delete": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "删除当前租户的指定配置项", "tags": [ "Settings" ], "summary": "删除租户配置", "parameters": [ { "type": "string", "description": "配置键名", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/api/version": { "get": { "description": "返回构建版本、提交哈希、编译时间等", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "版本信息", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_app_version.Info" } } } } }, "/auth/login": { "post": { "description": "使用邮箱和密码登录,返回 JWT token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "用户登录", "parameters": [ { "description": "登录信息", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.TokenPair" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/auth/refresh": { "post": { "description": "使用 refresh_token 获取新的 token 对", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "刷新 Token", "parameters": [ { "description": "{ \\", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.TokenPair" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/auth/register": { "post": { "description": "使用邮箱、用户名和密码注册新用户,返回 JWT token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "用户注册", "parameters": [ { "description": "注册信息", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.RegisterRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.TokenPair" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/dashboard/stats": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "返回平台核心指标的统计数据", "produces": [ "application/json" ], "tags": [ "Dashboard" ], "summary": "仪表盘统计", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/internal_modules_dashboard_interfaces.StatsResponse" } } } ] } } } } }, "/health": { "get": { "description": "检查 PostgreSQL 和 Redis 连接状态", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "健康检查", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "database": { "type": "string" }, "redis": { "type": "string" }, "status": { "type": "string" }, "timestamp": { "type": "integer" }, "trace_id": { "type": "string" }, "version": { "type": "string" } } } } } } }, "/healthz": { "get": { "description": "Kubernetes liveness probe,进程存活即返回 200", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "存活探针", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "status": { "type": "string" } } } } } } }, "/password": { "post": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "使用旧密码验证后设置新密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "修改密码", "parameters": [ { "description": "密码修改请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.ChangePasswordRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/ping": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "返回 pong,用于验证认证和多租户中间件是否正常", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "健康探测", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/profile": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "返回当前认证用户的个人资料", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "获取当前用户信息", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.UserDTO" } } } ] } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } }, "/readyz": { "get": { "description": "Kubernetes readiness probe,检查数据库和 Redis 连接", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "就绪探针", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "database": { "type": "string" }, "redis": { "type": "string" }, "status": { "type": "string" } } } }, "503": { "description": "Service Unavailable", "schema": { "type": "object", "properties": { "database": { "type": "string" }, "redis": { "type": "string" }, "status": { "type": "string" } } } } } } }, "/users": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "description": "分页获取当前租户下的用户列表,支持搜索和状态过滤", "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "用户列表", "parameters": [ { "type": "integer", "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量", "name": "page_size", "in": "query" }, { "type": "string", "description": "搜索关键词", "name": "search", "in": "query" }, { "type": "integer", "description": "状态过滤", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } }, "post": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "创建用户", "parameters": [ { "description": "用户信息", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.CreateUserRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.UserDTO" } } } ] } } } } }, "/users/{id}": { "get": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "获取用户详情", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.UserDTO" } } } ] } } } }, "put": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Users" ], "summary": "更新用户", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true }, { "description": "更新内容", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.UpdateUserRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/mengstack_internal_modules_auth_domain.UserDTO" } } } ] } } } }, "delete": { "security": [ { "Bearer": [] }, { "TenantID": [] } ], "tags": [ "Users" ], "summary": "删除用户", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/mengstack_internal_kernel_response.Response" } } } } } }, "definitions": { "internal_app_upgrade.Manifest": { "type": "object", "properties": { "changelog": { "type": "string" }, "checksum_sha256": { "type": "string" }, "critical": { "type": "boolean" }, "download_url": { "type": "string" }, "min_version": { "type": "string" }, "published_at": { "type": "string" }, "size": { "type": "integer" }, "version": { "type": "string" } } }, "internal_app_upgrade.UpgradeStatus": { "type": "object", "properties": { "available": { "type": "boolean" }, "checked_at": { "type": "string" }, "critical": { "type": "boolean" }, "current_version": { "type": "string" }, "latest_version": { "type": "string" }, "manifest": { "$ref": "#/definitions/internal_app_upgrade.Manifest" } } }, "internal_modules_dashboard_interfaces.StatsResponse": { "type": "object", "properties": { "onlineCount": { "type": "integer" }, "roleCount": { "type": "integer" }, "roleGrowth": { "type": "number" }, "tenantCount": { "type": "integer" }, "tenantGrowth": { "type": "number" }, "todayActiveUsers": { "type": "integer" }, "userCount": { "type": "integer" }, "userGrowth": { "type": "number" } } }, "mengstack_internal_app_version.Info": { "type": "object", "properties": { "arch": { "type": "string" }, "build_date": { "type": "string" }, "commit": { "type": "string" }, "go_version": { "type": "string" }, "os": { "type": "string" }, "version": { "type": "string" } } }, "mengstack_internal_kernel_response.Response": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "message": { "type": "string" }, "trace_id": { "type": "string" } } }, "mengstack_internal_modules_auth_domain.ChangePasswordRequest": { "type": "object", "required": [ "new_password", "old_password" ], "properties": { "new_password": { "type": "string", "maxLength": 128, "minLength": 8 }, "old_password": { "type": "string" } } }, "mengstack_internal_modules_auth_domain.CreateUserRequest": { "type": "object", "required": [ "email", "password", "username" ], "properties": { "email": { "type": "string" }, "nickname": { "type": "string" }, "password": { "type": "string", "maxLength": 128, "minLength": 8 }, "status": { "type": "integer" }, "username": { "type": "string", "maxLength": 64, "minLength": 3 } } }, "mengstack_internal_modules_auth_domain.LoginRequest": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "mengstack_internal_modules_auth_domain.RegisterRequest": { "type": "object", "required": [ "email", "password", "username" ], "properties": { "email": { "type": "string" }, "nickname": { "type": "string" }, "password": { "type": "string", "maxLength": 128, "minLength": 8 }, "username": { "type": "string", "maxLength": 64, "minLength": 3 } } }, "mengstack_internal_modules_auth_domain.TokenPair": { "type": "object", "properties": { "access_token": { "type": "string" }, "expires_in": { "type": "integer" }, "refresh_token": { "type": "string" } } }, "mengstack_internal_modules_auth_domain.UpdateUserRequest": { "type": "object", "properties": { "email": { "type": "string" }, "nickname": { "type": "string" }, "status": { "type": "integer" } } }, "mengstack_internal_modules_auth_domain.UserDTO": { "type": "object", "properties": { "avatar": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "integer" }, "last_login": { "type": "string" }, "nickname": { "type": "string" }, "status": { "type": "integer" }, "tenant_id": { "type": "string" }, "username": { "type": "string" } } }, "mengstack_internal_modules_notification_domain.CreateNotificationRequest": { "type": "object", "required": [ "title", "user_id" ], "properties": { "content": { "type": "string" }, "title": { "type": "string" }, "type": { "type": "string" }, "user_id": { "type": "integer" } } }, "mengstack_internal_modules_notification_domain.NotificationDTO": { "type": "object", "properties": { "content": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "is_read": { "type": "boolean" }, "tenant_id": { "type": "string" }, "title": { "type": "string" }, "type": { "type": "string" }, "user_id": { "type": "integer" } } }, "mengstack_internal_modules_org_domain.CreateTenantRequest": { "type": "object", "required": [ "name", "slug" ], "properties": { "name": { "type": "string" }, "slug": { "type": "string" } } }, "mengstack_internal_modules_org_domain.TenantDTO": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "status": { "type": "integer" }, "updated_at": { "type": "string" } } }, "mengstack_internal_modules_org_domain.UpdateTenantRequest": { "type": "object", "properties": { "name": { "type": "string" }, "slug": { "type": "string" }, "status": { "type": "integer" } } }, "mengstack_internal_modules_rbac_domain.AssignRoleRequest": { "type": "object", "required": [ "role_id" ], "properties": { "role_id": { "type": "integer" } } }, "mengstack_internal_modules_rbac_domain.CreateRoleRequest": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": "string" }, "name": { "type": "string" } } }, "mengstack_internal_modules_rbac_domain.PermissionDTO": { "type": "object", "properties": { "code": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "module": { "type": "string" }, "name": { "type": "string" } } }, "mengstack_internal_modules_rbac_domain.RoleDTO": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "integer" }, "is_system": { "type": "boolean" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/mengstack_internal_modules_rbac_domain.PermissionDTO" } }, "tenant_id": { "type": "string" } } }, "mengstack_internal_modules_rbac_domain.SetRolePermissionsRequest": { "type": "object", "required": [ "permission_ids" ], "properties": { "permission_ids": { "type": "array", "items": { "type": "integer" } } } }, "mengstack_internal_modules_rbac_domain.UpdateRoleRequest": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" } } }, "mengstack_internal_modules_settings_domain.SettingDTO": { "type": "object", "properties": { "id": { "type": "integer" }, "key": { "type": "string" }, "scope": { "type": "string" }, "tenant_id": { "type": "string" }, "type": { "type": "string" }, "updated_at": { "type": "string" }, "updated_by": { "type": "integer" }, "value": { "type": "string" } } }, "mengstack_internal_modules_settings_domain.UpdateSettingRequest": { "type": "object", "required": [ "value" ], "properties": { "type": { "type": "string" }, "value": { "type": "string" } } } }, "securityDefinitions": { "Bearer": { "description": "Bearer \u003ctoken\u003e", "type": "apiKey", "name": "Authorization", "in": "header" }, "TenantID": { "description": "租户 ID(受保护接口必填)", "type": "apiKey", "name": "X-Tenant-ID", "in": "header" } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "0.1.0", Host: "localhost:2222", BasePath: "/api/v1", Schemes: []string{}, Title: "MengStack API", Description: "MengStack 平台 API 文档", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }