isAllowChoose和config加入的版本
This commit is contained in:
parent
6f4a8bb894
commit
b8ea7bc750
@ -34,12 +34,12 @@ namespace asg_form.Controllers
|
|||||||
object Event = new object();
|
object Event = new object();
|
||||||
if (get_poem)
|
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
|
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;
|
return Event;
|
||||||
@ -55,7 +55,7 @@ namespace asg_form.Controllers
|
|||||||
public async Task<ActionResult<List<T_events>>> Postevent([FromBody] events_get events)
|
public async Task<ActionResult<List<T_events>>> Postevent([FromBody] events_get events)
|
||||||
{
|
{
|
||||||
TestDbContext testDbContext = new TestDbContext();
|
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.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + $"loge/{events.name}");
|
||||||
System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + $"doc/rule/{events.name}.md", events.rule_markdown);
|
System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + $"doc/rule/{events.name}.md", events.rule_markdown);
|
||||||
await testDbContext.SaveChangesAsync();
|
await testDbContext.SaveChangesAsync();
|
||||||
@ -85,6 +85,7 @@ namespace asg_form.Controllers
|
|||||||
eve.is_over = events.is_over;
|
eve.is_over = events.is_over;
|
||||||
eve.events_rule_uri = events.events_rule_uri;
|
eve.events_rule_uri = events.events_rule_uri;
|
||||||
eve.status = events.status;
|
eve.status = events.status;
|
||||||
|
eve.config = events.config;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(events.rule_markdown))
|
if (!string.IsNullOrEmpty(events.rule_markdown))
|
||||||
{
|
{
|
||||||
@ -202,6 +203,7 @@ namespace asg_form.Controllers
|
|||||||
public DateTime? opentime { get; set; }
|
public DateTime? opentime { get; set; }
|
||||||
public string rule_markdown { get; set; }
|
public string rule_markdown { get; set; }
|
||||||
public string status { get; set; }
|
public string status { get; set; }
|
||||||
|
public string? config { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class T_events
|
public class T_events
|
||||||
@ -215,7 +217,7 @@ namespace asg_form.Controllers
|
|||||||
public Uri? events_rule_uri { get; set; }
|
public Uri? events_rule_uri { get; set; }
|
||||||
public string? promChart { get; set; }
|
public string? promChart { get; set; }
|
||||||
public string status { get; set; } = "0";
|
public string status { get; set; } = "0";
|
||||||
|
public string? config { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class T_events_debug
|
public class T_events_debug
|
||||||
@ -229,5 +231,6 @@ namespace asg_form.Controllers
|
|||||||
public string? promChart { get; set; }
|
public string? promChart { get; set; }
|
||||||
public string status { get; set; }
|
public string status { get; set; }
|
||||||
public string rule_markdown { get; set; }
|
public string rule_markdown { get; set; }
|
||||||
|
public string? config { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ namespace asg_form.Controllers
|
|||||||
game.belong = req.belong;
|
game.belong = req.belong;
|
||||||
game.tag=req.tag;
|
game.tag=req.tag;
|
||||||
game.judge = req.judge;
|
game.judge = req.judge;
|
||||||
game.isAllowChoose = 1;
|
game.isAllowChoose = req.isAllowChoose;
|
||||||
wp = 1;
|
wp = 1;
|
||||||
game.commentary = req.commentary;
|
game.commentary = req.commentary;
|
||||||
if(req.comLimit != null)
|
if(req.comLimit != null)
|
||||||
@ -125,7 +125,7 @@ namespace asg_form.Controllers
|
|||||||
Remarks = req.Remarks,
|
Remarks = req.Remarks,
|
||||||
com_limit = req.comLimit,
|
com_limit = req.comLimit,
|
||||||
person_type = req.personType,
|
person_type = req.personType,
|
||||||
isAllowChoose = 1,
|
isAllowChoose = req.isAllowChoose,
|
||||||
};
|
};
|
||||||
|
|
||||||
wp = 1;
|
wp = 1;
|
||||||
@ -521,6 +521,7 @@ namespace asg_form.Controllers
|
|||||||
public string? judge { get; set; }
|
public string? judge { get; set; }
|
||||||
public int comLimit { get; set; } = 2;
|
public int comLimit { get; set; } = 2;
|
||||||
public string? personType { get; set; }
|
public string? personType { get; set; }
|
||||||
|
public int isAllowChoose { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FinalScore
|
public class FinalScore
|
||||||
|
Loading…
x
Reference in New Issue
Block a user