From 3cbce61c4f268f6e24b07e0fcce1b7ab3a3d8b4d Mon Sep 17 00:00:00 2001 From: TheWhiteDog9487 Date: Mon, 29 Sep 2025 09:39:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=8E=E7=A1=AEX-API-Key=E6=98=AF=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/xyz/thewhitedog9487/WebAPI/Controller/Message.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/thewhitedog9487/WebAPI/Controller/Message.java b/src/main/java/xyz/thewhitedog9487/WebAPI/Controller/Message.java index 2ef24c2..997c1cd 100644 --- a/src/main/java/xyz/thewhitedog9487/WebAPI/Controller/Message.java +++ b/src/main/java/xyz/thewhitedog9487/WebAPI/Controller/Message.java @@ -5,6 +5,7 @@ import discord4j.core.GatewayDiscordClient; import discord4j.rest.http.client.ClientException; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.ExampleObject; import io.swagger.v3.oas.annotations.media.Schema; @@ -115,7 +116,8 @@ class Message { """) } ) @PostMapping("/discord") ResponseEntity DiscordPush( - @Parameter(description = "用于身份验证的API密钥", required = true, example = "ds1858dscc8745sfwe") + @Parameter(description = "用于身份验证的API密钥", in = ParameterIn.HEADER, required = true, example = "ds1858dscc8745sfwe") + @RequestHeader("X-API-Key") String ApiKey, @io.swagger.v3.oas.annotations.parameters.RequestBody( description = "包含频道ID和消息内容的JSON对象", required = true,