IWeb.cs
1.6 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
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Runtime.Serialization;
using System.Collections.Generic;
namespace ScanCodeServer
{
[ServiceContract(Name = "Services")]
internal interface IWeb
{
[OperationContract]
[WebGet(UriTemplate = "StealAgv/takeOld?Place={place}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result TakeOldGet(string place);
[OperationContract]
[WebGet(UriTemplate = "alive", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string alive();
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "Process?param={param}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string Process(Stream info,string param);
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "ProcessBitmap?param={param}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string ProcessBitmap(Stream info, string param);
}
[DataContract]
internal class Result
{
[DataMember]
public int Code { get; set; }
[DataMember]
public string Msg { get; set; }
[DataMember]
public List<CodeInfo> CodeInfos { get; set; }
public Result()
{
Code = 0;
Msg = "OK";
CodeInfos = new List<CodeInfo>();
}
}
}