服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-05-31 d4c326deaa51e7d4897a84afc339684012b8cfbe
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
using Rhea.Common;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Tiger.Model.SeaStone.Shelf;
 
namespace Tiger.Business.WMS.Seastone
{
    /// <summary>
    /// 智能料架数据接口
    /// </summary>
    public class RackApi
    {
        public static async Task<RackApiResult> RunAsync(string url, object obj = null)
        {
            try
            {
                return await HttpHelper.PostAsync<RackApiResult>(url, obj);
                //return await HttpHelper.HttpPost<RackApiResult>(url, obj);
            }
            catch (System.Exception ex)
            {
                Logger.Default.Fatal(ex, $"货架访问异常[{url}]");
                return new RackApiResult(999, $"货架访问异常[{url}]: {ex.Message}", Guid.NewGuid().ToString("N"));
            }
        }
 
        /// <summary>
        /// 获取当前系统信息与运行状态
        /// </summary>
        public class APIStatus
        {
            public const string Url = "/api/APIStatus";
            public const string Method = "Get";
        }
 
        /// <summary>
        /// 二维码料架
        /// </summary>
        public class QRCodeRack
        {
            /// <summary>
            /// 设置全部储位灯状态
            /// </summary>
            public class SetAllSlotLightStatus
            {
                public const string Url = "/api/QRCodeRack/SetAllSlotLightStatus";
                public const string Method = "Post";
            }
            /// <summary>
            /// 设置警示灯状态
            /// </summary>
            public class SetIndicatorStatus
            {
                public const string Url = "/api/QRCodeRack/SetIndicatorStatus";
                public const string Method = "Post";
            }
            /// <summary>
            /// 批量设置储位灯状态
            /// </summary>
            public class SetSlotLightStatusList
            {
                public const string Url = "/api/QRCodeRack/SetSlotLightStatusList";
                public const string Method = "Post";
            }
            /// <summary>
            /// 设置储位灯状态
            /// </summary>
            public class SetSlotLightStatus
            {
                public const string Url = "/api/QRCodeRack/SetSlotLightStatus";
                public const string Method = "Post";
            }
            /// <summary>
            /// 关闭所有储位灯
            /// </summary>
            public class TurnOffAllSlotLightStatus
            {
                public const string Url = "/api/QRCodeRack/TurnOffAllSlotLightStatus";
                public const string Method = "Post";
            }
            /// <summary>
            /// 关闭全部警示灯
            /// </summary>
            public class TurnOffIndicatorStatus
            {
                public const string Url = "/api/QRCodeRack/TurnOffIndicatorStatus";
                public const string Method = "Post";
            }
        }
 
        /// <summary>
        /// 感应式智能料架
        /// </summary>
        public class SmartRack
        {
            /// <summary>
            /// 料架控制接口
            /// </summary>
            public class SetRackStatus
            {
                public const string Url = "/api/SmartRack/SetRackStatus";
                public const string Method = "Post";
            }
            /// <summary>
            /// 设置上报WebHook
            /// </summary>
            public class WebHook
            {
                public const string Url = "/api/SmartRack/WebHook";
                public const string Method = "Post";
            }
            /// <summary>
            /// 料架测试
            /// </summary>
            public class RackTest
            {
                public const string Url = "/api/SmartRack/RackTest";
                public const string Method = "Post";
            }
 
        }
    }
}