IService.cs
2.2 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
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Threading.Tasks;
using System.Web.UI;
using System.Xml.Linq;
using System.Runtime.Serialization;
namespace OnlineStore.DeviceLibrary.ESS
{
[ServiceContract(Name = "Service")]
internal interface IService
{
[OperationContract]
[WebInvoke(UriTemplate = "/conveyor/loadContainerFinish", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result loadContainerFinish(Stream stream);
[OperationContract]
[WebInvoke(UriTemplate = "/conveyor/unloadContainerFinish", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result unloadContainerFinish(Stream stream);
[OperationContract]
[WebInvoke(UriTemplate = "/conveyor/unloadContainerReq", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result unloadContainerReq(Stream stream);
[OperationContract]
[WebInvoke(UriTemplate = "task/callback", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result taskCallBack(Stream stream);
[OperationContract]
[WebInvoke(UriTemplate = "/exception/callback", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result exceptionCallBack(Stream stream);
}
[DataContract]
internal class Result
{
/// <summary>
/// 状态码,0为正常
/// </summary>
[DataMember]
public int code { get; set; } = 0;
/// <summary>
/// 返回数据
/// </summary>
[DataMember]
public Allow data { get; set; }
/// <summary>
/// 提示信息
/// </summary>
[DataMember]
public string msg { get; set; } = "ok";
}
public class Allow
{
public bool allow { get; set; }
}
}