diff --git a/asg_form/Controllers/Events.cs b/asg_form/Controllers/Events.cs index 18c55bb..a37dcda 100644 --- a/asg_form/Controllers/Events.cs +++ b/asg_form/Controllers/Events.cs @@ -34,12 +34,12 @@ namespace asg_form.Controllers object Event = new object(); if (get_poem) { - Event = testDbContext.events.Select(a => new { a.Id, a.is_over, a.opentime, a.name, a.promChart ,a.status}).ToList(); + Event = testDbContext.events.Select(a => new { a.Id, a.is_over, a.opentime, a.name, a.promChart ,a.status,a.config}).ToList(); } else { - Event = testDbContext.events.Select(a => new { a.Id, a.is_over, a.opentime, a.name,a.status }).ToList(); + Event = testDbContext.events.Select(a => new { a.Id, a.is_over, a.opentime, a.name,a.status,a.config}).ToList(); } return Event; @@ -55,7 +55,7 @@ namespace asg_form.Controllers public async Task>> Postevent([FromBody] events_get events) { TestDbContext testDbContext = new TestDbContext(); - await testDbContext.events.AddAsync(new T_events { name = events.name, is_over = events.is_over, opentime = events.opentime, events_rule_uri = new Uri($"https://124.223.35.239/doc/rule/{events.name}.md"),status =events.status }); + await testDbContext.events.AddAsync(new T_events { name = events.name, is_over = events.is_over, opentime = events.opentime, events_rule_uri = new Uri($"https://124.223.35.239/doc/rule/{events.name}.md"),status =events.status,config = events.config }); System.IO.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + $"loge/{events.name}"); System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + $"doc/rule/{events.name}.md", events.rule_markdown); await testDbContext.SaveChangesAsync(); @@ -85,6 +85,7 @@ namespace asg_form.Controllers eve.is_over = events.is_over; eve.events_rule_uri = events.events_rule_uri; eve.status = events.status; + eve.config = events.config; if (!string.IsNullOrEmpty(events.rule_markdown)) { @@ -202,6 +203,7 @@ namespace asg_form.Controllers public DateTime? opentime { get; set; } public string rule_markdown { get; set; } public string status { get; set; } + public string? config { get; set; } } } public class T_events @@ -215,7 +217,7 @@ namespace asg_form.Controllers public Uri? events_rule_uri { get; set; } public string? promChart { get; set; } public string status { get; set; } = "0"; - + public string? config { get; set; } } public class T_events_debug @@ -229,5 +231,6 @@ namespace asg_form.Controllers public string? promChart { get; set; } public string status { get; set; } public string rule_markdown { get; set; } + public string? config { get; set; } } } diff --git a/asg_form/Controllers/schedule.cs b/asg_form/Controllers/schedule.cs index ffbf0a8..59d7874 100644 --- a/asg_form/Controllers/schedule.cs +++ b/asg_form/Controllers/schedule.cs @@ -55,7 +55,7 @@ namespace asg_form.Controllers game.belong = req.belong; game.tag=req.tag; game.judge = req.judge; - game.isAllowChoose = 1; + game.isAllowChoose = req.isAllowChoose; wp = 1; game.commentary = req.commentary; if(req.comLimit != null) @@ -125,7 +125,7 @@ namespace asg_form.Controllers Remarks = req.Remarks, com_limit = req.comLimit, person_type = req.personType, - isAllowChoose = 1, + isAllowChoose = req.isAllowChoose, }; wp = 1; @@ -521,6 +521,7 @@ namespace asg_form.Controllers public string? judge { get; set; } public int comLimit { get; set; } = 2; public string? personType { get; set; } + public int isAllowChoose { get; set; } } public class FinalScore