From 566aaba27bd2d2bb07b71fa8f63132fed1b8ec2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=82=9C=E7=BF=94?= <2307953404@qq.com> Date: Mon, 16 Sep 2024 22:05:54 +0800 Subject: [PATCH] 111 --- .../Teamregistration/RegisterController.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/asg_form/Controllers/Teamregistration/RegisterController.cs b/asg_form/Controllers/Teamregistration/RegisterController.cs index d5718cd..87ca0aa 100644 --- a/asg_form/Controllers/Teamregistration/RegisterController.cs +++ b/asg_form/Controllers/Teamregistration/RegisterController.cs @@ -10,7 +10,7 @@ namespace asg_form.Controllers.Teamregistration { public class ComformDB { - public long id { get; set; } + public int? id { get; set; } public string chinaname { get; set; } public int user_id { get; set; } public int sex { get; set; } @@ -26,7 +26,7 @@ namespace asg_form.Controllers.Teamregistration } public class userMsg { - public long id { get; set; } + public string chinaname { get; set; } public int userId { get; set; } public int sex { get; set; } @@ -34,7 +34,7 @@ namespace asg_form.Controllers.Teamregistration public string gameId { get; set; } public string? historyRank { get; set; } public string? contactNumber { get; set; } - + public int? id { get; set; } } public class RegisterController : ControllerBase { @@ -51,11 +51,7 @@ namespace asg_form.Controllers.Teamregistration [HttpPost] [Authorize] public async Task> UserRgst([FromBody] userMsg msg) - { - if (msg == null) - { - return Ok(new error_mb { code = 400, message = "请求内容为空" }); - } + { using (TestDbContext sub = new TestDbContext()) { @@ -215,10 +211,10 @@ namespace asg_form.Controllers.Teamregistration if (result.Count == 0) { - return new JsonResult(new { }); + return (new { }); } - return new JsonResult(result); + return (result); } } }