isAllowChoose和config加入的版本

This commit is contained in:
王炜翔 2025-01-22 22:57:50 +08:00
parent 6f4a8bb894
commit b8ea7bc750
2 changed files with 10 additions and 6 deletions

View File

@ -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<ActionResult<List<T_events>>> 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; }
}
}

View File

@ -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