[feature] python兼容层基本完成
This commit is contained in:
@@ -1,8 +1,30 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SiteManagementSystem_SoftwareEngineering_.Entity;
|
||||
using SiteManagementSystem_SoftwareEngineering_.Extension;
|
||||
using SiteManagementSystem_SoftwareEngineering_.Interface;
|
||||
using SiteManagementSystem_SoftwareEngineering_.Service;
|
||||
|
||||
namespace SiteManagementSystem_SoftwareEngineering_.Controllers
|
||||
{
|
||||
[Route("Field")]
|
||||
public class FieldController : ControllerBase
|
||||
{
|
||||
IFieldService _fieldService;
|
||||
SQLService _sql;
|
||||
public FieldController(IFieldService fieldService,SQLService sql) { _fieldService = fieldService; _sql = sql; }
|
||||
[HttpPost("AddField")]
|
||||
public IActionResult AddField()
|
||||
{
|
||||
_sql.Fields.Add(new Field());
|
||||
_sql.SaveChanges();
|
||||
return Ok();
|
||||
}
|
||||
[HttpGet("test")]
|
||||
public IActionResult test()
|
||||
{
|
||||
_fieldService.AddField("", "");
|
||||
return this.Success();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user