namespace IStation.Application
|
{
|
/// <summary>
|
/// Open
|
/// </summary>
|
[Route("Open/ChenHang")]
|
[ApiDescriptionSettings("ChenHang", Name = "陈行", Order = 10000)]
|
public class ChenHang_Controller : IDynamicApiController
|
{
|
private readonly Service.ChengHang _service = new();
|
|
/// <summary>
|
/// 获取
|
/// </summary>
|
[Route("Get@V1.0")]
|
[HttpGet]
|
public string Get()
|
{
|
return "okkkk";
|
/* var model = _service.GetDefault();
|
return model == null ? null : new ChenHangDto(model);*/
|
}
|
|
/// <summary>
|
/// 设置
|
/// </summary>
|
/// <param name="input"></param>
|
[Route("Set@V1.0")]
|
[HttpPost]
|
public bool Set([Required] ChenHangInput input)
|
{
|
var ds = _service.GetDefault();
|
if (ds == null)
|
{
|
var model = input.Adapt<ChenHangInput, Model.ChengHang>();
|
var id = _service.Insert(model);
|
return id > 0;
|
}
|
else
|
{
|
var rhs = new Model.ChengHang(ds);
|
input.Adapt(rhs);
|
var bol = _service.Update(rhs);
|
return bol;
|
}
|
}
|
|
}
|
}
|