From 84123c9c22ee4047019a89f456c477bdfacdf35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=AF=85?= <2667210109@qq.com> Date: Sun, 3 Nov 2024 01:10:52 +0800 Subject: [PATCH] =?UTF-8?q?azure=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asg_form/Controllers/webhook.cs | 38 ++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/asg_form/Controllers/webhook.cs b/asg_form/Controllers/webhook.cs index c93991a..a475c05 100644 --- a/asg_form/Controllers/webhook.cs +++ b/asg_form/Controllers/webhook.cs @@ -30,7 +30,7 @@ namespace asg_form.Controllers { logger.Warn(rootobject.EventType); Random random = new Random(); - string[] strings = { "upload", "--copyright 1", "--dolby 0", "--hires 0", $"--title {rootobject.EventData.Title}-直播回放{random.Next(1,99)}", "--tag 第五人格,第五人格ASG赛事", @$"{AppDomain.CurrentDomain.BaseDirectory}video\{rootobject.EventData.RelativePath}" }; + string[] strings = { "upload", "--copyright 1", "--dolby 0", "--hires 0", $"--title {rootobject.EventData.Title}-直播回放{random.Next(1, 99)}", "--tag 第五人格,第五人格ASG赛事", @$"{AppDomain.CurrentDomain.BaseDirectory}video\{rootobject.EventData.RelativePath}" }; StartProcess("biliup.exe", strings); @@ -42,24 +42,39 @@ namespace asg_form.Controllers } } + public class azurereq + { + + public Message message { get; set; } + + public DateTime createdDate { get; set; } + } + + public class Message + { + public string text { get; set; } + } + + + [Route("api/v1/Codepush/")] [HttpPost] - public async Task Codepush([FromBody]dynamic date1) + public async Task Codepush([FromBody] azurereq date) { - try { - dynamic date = JsonConvert.DeserializeObject(Convert.ToString(date1)); - var message = new MessageBuilder().Text($"后端推送了新的代码库\r\n详细信息:{date.message.text}").Build(); + try + { + var message = new MessageBuilder().Text($"后端推送了新的代码库\r\n详细信息:{date.message.text}").Build(); await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "931217544", null, message, "931217544"); } - catch - { - + catch + { + } return "ok"; } @@ -67,13 +82,12 @@ namespace asg_form.Controllers [Route("api/v1/issueadd/")] [HttpPost] - public async Task issueadd([FromBody] dynamic date1) + public async Task issueadd([FromBody] azurereq date) { try { - dynamic date = JsonConvert.DeserializeObject(Convert.ToString(date1)); - + var message = new MessageBuilder().Text($"后端有新bug被提交请及时解决!\r\n详细信息:{date.message.text}").Build(); await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "931217544", null, message, "931217544"); @@ -82,7 +96,7 @@ namespace asg_form.Controllers } catch { - var message = new MessageBuilder().Text($"后端有新bug被提交请及时解决!\r\n详细信息:{date1.ToJsonString}").Build(); + var message = new MessageBuilder().Text($"后端有新bug被提交请及时解决!\r\n详细信息:{date}").Build(); await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "931217544", null, message, "931217544");