ACSController.cs
1.99 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
65
66
67
68
69
70
71
72
73
74
75
using System;
using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using WebApp;
using WebRepository;
namespace WebMvc.Areas.Api.Controllers
{
/// <summary>
/// RCS回调接口
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class ACSController : ControllerBase
{
private readonly AcsApiApp _app;
/// <summary>
/// 控制器构造函数
/// </summary>
/// <param name="unitWork">注入工作单元</param>
/// <param name="auth">注入授权信息</param>
/// <param name="context">EF上下文</param>
public ACSController(IUnitWork unitWork, IAuth auth, BaseDbContext context)
{
_app = new AcsApiApp(unitWork, auth, context);
}
/// <summary>
/// 任务状态刷新
/// </summary>
/// <param name="taskRefreshModel"></param>
/// <returns></returns>
[HttpPost("TaskRefresh")]
public string TaskRefresh(TaskRefreshModel taskRefreshModel)
{
var resp = new Response();
try
{
_app.TaskRefresh(taskRefreshModel);
}
catch (Exception e)
{
resp.Code = 500;
resp.Message = e.Message;
}
return JsonHelper.Instance.Serialize(resp);
}
/// <summary>
/// 对接/自动任务返回
/// </summary>
/// <param name="toWebTaskReturnModel"></param>
/// <returns></returns>
[HttpPost("ToWebTaskReturn")]
public string ToWebTaskReturn(ToWebTaskReturnModel toWebTaskReturnModel)
{
var resp = new Response();
try
{
_app.ToWebTaskReturn(toWebTaskReturnModel);
}
catch (Exception e)
{
resp.Code = 500;
resp.Message = e.Message;
}
return JsonHelper.Instance.Serialize(resp);
}
}
}