BasicDataController.cs
2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using WebApp;
using WebRepository;
namespace WebMvc.Areas.Api.Controllers
{
/// <summary>
/// 基础数据同步接口(WMS被动推送 ERP ==> WMS)
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class BasicDataController : ControllerBase
{
private readonly BasicDataApp _app;
/// <summary>
/// 控制器构造函数
/// </summary>
/// <param name="unitWork">注入工作单元</param>
/// <param name="auth">注入授权信息</param>
/// <param name="context">EF上下文</param>
public BasicDataController(IUnitWork unitWork, IAuth auth, BaseDBContext context)
{
_app = new BasicDataApp(unitWork, auth, context);
}
/// <summary>
/// 客户添加公共接口
/// </summary>
/// <param name="Customers">客户数据列表</param>
/// <returns></returns>
[HttpPost("Customer")]
[ServiceFilter(typeof(InterfaceLogFilter))]
public string Customer([FromBody]CustomersModel Customers)
{
return JsonHelper.Instance.Serialize(_app.Customer(Customers));
}
/// <summary>
/// 物料添加公共接口
/// </summary>
/// <param name="Materials">物料数据列表</param>
/// <returns></returns>
[HttpPost("Material")]
[ServiceFilter(typeof(InterfaceLogFilter))]
public string Material([FromBody]MaterialsModel Materials)
{
return JsonHelper.Instance.Serialize(_app.Material(Materials));
}
/// <summary>
/// 供应商添加公共接口
/// </summary>
/// <param name="Suppliers">供应商数据列表</param>
/// <returns></returns>
[HttpPost("Supplier")]
[ServiceFilter(typeof(InterfaceLogFilter))]
public string Supplier([FromBody]SuppliersModel Suppliers)
{
return JsonHelper.Instance.Serialize(_app.Supplier(Suppliers));
}
}
}