日志发送逻辑及测试消息发送接口

This commit is contained in:
2025-10-24 21:24:48 +08:00
parent 9d6876684b
commit 3fd97aa43f
14 changed files with 576 additions and 9 deletions

View File

@@ -3923,6 +3923,64 @@ const docTemplate = `{
}
}
}
},
"/api/v1/users/{id}/notifications/test": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "为指定用户发送一条特定渠道的测试消息,以验证其配置是否正确。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"用户管理"
],
"summary": "发送测试通知",
"parameters": [
{
"type": "integer",
"description": "用户ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SendTestNotificationRequest"
}
}
],
"responses": {
"200": {
"description": "成功响应",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"type": "string"
}
}
}
]
}
}
}
}
}
},
"definitions": {
@@ -5591,6 +5649,22 @@ const docTemplate = `{
}
}
},
"dto.SendTestNotificationRequest": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"description": "Type 指定要测试的通知渠道\n@enum(smtp, wechat, lark, log)",
"allOf": [
{
"$ref": "#/definitions/notify.NotifierType"
}
]
}
}
},
"dto.SensorDataDTO": {
"type": "object",
"properties": {
@@ -6530,6 +6604,23 @@ const docTemplate = `{
"$ref": "#/definitions/models.SensorType"
}
}
},
"notify.NotifierType": {
"type": "string",
"enum": [
"smtp",
"wechat",
"lark",
"sms",
"log"
],
"x-enum-varnames": [
"NotifierTypeSMTP",
"NotifierTypeWeChat",
"NotifierTypeLark",
"NotifierTypeSMS",
"NotifierTypeLog"
]
}
},
"securityDefinitions": {