IWeb.cs
2.7 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
76
77
78
79
80
81
82
83
84
85
86
87
88
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Runtime.Serialization;
using System.Collections.Generic;
using CameraVisionLib.Model;
namespace Model
{
[ServiceContract(Name = "Services")]
public interface IWeb
{
[OperationContract]
[WebGet(UriTemplate = "SmartScan/CloseApp", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
void CloseApp();
[OperationContract]
[WebGet(UriTemplate = "SmartScan/WorkWithCamera", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
WebResultCamera WorkWithCamera();
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "SmartScan/WorkWithCode", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
WebResultCode WorkWithCode(Stream json);
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "SmartScan/ProcessBitmap?param={param}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
WebResultCode ProcessBitmap(Stream info, string param);
}
[DataContract]
public class WebResultCamera
{
[DataMember]
public int ErrorCode { get; set; }
[DataMember]
public string Msg { get; set; }
[DataMember]
public WebCodeAll[] Data { get; set; }
public WebResultCamera()
{
ErrorCode = 0;
Msg = "OK";
}
}
[DataContract]
public class WebResultCode
{
[DataMember]
public int ErrorCode { get; set; }
[DataMember]
public string Msg { get; set; }
[DataMember]
public WebCodeText[] Data { get; set; }
[DataMember]
public List<KeyValuePair<string, string>> workCodeKeyword;
[DataMember]
public List<BarcodeInfo> workCodeInfo = new List<BarcodeInfo>();
public WebResultCode()
{
ErrorCode = 0;
Msg = "OK";
}
}
public class WebCodeAll
{
public string Text { get; set; } = "";
public string CodeType { get; set; } = "";
public float CenterX { get; set; } = 0;
public float CenterY { get; set; } = 0;
public float Angle { get; set; } = 0;
public float Width { get; set; } = 0;
public float Height { get; set; } = 0;
public bool IsUsed { get; set; } = false;
}
public class WebCodeText
{
public string Text { get; set; } = "";
public bool IsUsed { get; set; } = false;
}
}