分支自 SuZhouGuanHong/TaiYuanTaiZhong

PCS
dengjunjie
2023-12-13 113d1d4262d8f9e78a9d92123713c41669ad6c87
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
76
77
78
79
80
81
82
83
84
85
/*
 *接口编写处...
*如果接口需要做Action的权限验证,请在Action上使用属性
*如: [ApiActionPermission("VV_Dispatch",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IServices;
using WIDESEA_Core.Utilities;
using Microsoft.AspNetCore.Authorization;
 
namespace WIDESEA_WCS.Controllers
{
    public partial class VV_DispatchController
    {
        private readonly IVV_DispatchService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
 
        [ActivatorUtilitiesConstructor]
        public VV_DispatchController(
            IVV_DispatchService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
 
        /// <summary>
        /// 启动服务
        /// </summary>
        /// <returns></returns>
        [HttpPost, Route("StartServe"), AllowAnonymous]
        public WebResponseContent StartServe()
        {
            return _service.StartServe();
        }
 
        /// <summary>
        /// 关闭服务
        /// </summary>
        /// <returns></returns>
        [HttpPost, Route("CloseServe"), AllowAnonymous]
        public WebResponseContent CloseServe()
        {
            return _service.CloseServe();
        }
 
        /// <summary>
        /// 启动指定job
        /// </summary>
        /// <returns></returns>
        [HttpPost, Route("StartJob"), AllowAnonymous]
        public WebResponseContent StartJob(string jobName)
        {
            return _service.StartJob(jobName);
        }
 
        /// <summary>
        /// 关闭指定job
        /// </summary>
        /// <returns></returns>
        [HttpPost, Route("CloseJob"), AllowAnonymous]
        public WebResponseContent CloseJob(string jobName)
        {
            return _service.CloseJob(jobName);
        }
 
        /// <summary>
        /// 检查服务状态
        /// </summary>
        /// <returns></returns>
        [HttpPost, Route("CheckServeState"), AllowAnonymous]
        public WebResponseContent CheckServeState()
        {
            return _service.CheckServeState();
        }
    }
}