ldj/DNLightSvr/ILightService.cs

88 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;
namespace DNLightSvr
{
[ServiceContract]
public interface ILightService
{
[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json,
UriTemplate = "lightLabels")]
string lightLabels(ELabel[] labels);
[OperationContract]
[WebInvoke(
Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "testpost"
)]
string testPost(ELabel label);
[OperationContract]
[WebInvoke(
Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "clearOrder"
)]
string clearOrder(ClearOrder clearOrder);
[OperationContract]
[WebInvoke(
Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "test"
)]
string test();
[OperationContract]
[WebInvoke(
Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "getLabels"
)]
List<ELabel> getLabels();
}
[DataContract]
public class ELabel
{
[DataMember]
public int labelId { get; set; }
[DataMember]
public int address { get; set; }
[DataMember]
public int count { get; set; }
[DataMember]
public int color { get; set; }
[DataMember]
public int port { get; set; }
[DataMember]
public int orderNo { get; set; }
}
[DataContract]
public class ClearOrder
{
[DataMember]
public int orderNo { get; set; }
[DataMember]
public int[] ports { get; set; }
}
}