51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace UVC.Data
|
|
{
|
|
public class HttpPipeLineInfo
|
|
{
|
|
public string url;
|
|
public string method;
|
|
public Dictionary<string, string> headers;
|
|
public string body;
|
|
public Action<IDataObject> handler = null;
|
|
public bool repeat = false; // 반복 실행 여부
|
|
public int repeatCount = 0; // 반복 횟수, 0은 무한 반복
|
|
public int repeatInterval = 1000; // 반복 간격 (ms)
|
|
|
|
public DataMapper dataMapper = null; // 데이터 매퍼
|
|
|
|
public HttpPipeLineInfo(string url, string method = "post", Dictionary<string, string> headers = null, string body = null)
|
|
{
|
|
this.url = url;
|
|
this.method = method;
|
|
this.headers = headers;
|
|
this.body = body;
|
|
}
|
|
|
|
public HttpPipeLineInfo setDataMapper(DataMapper dataMapper)
|
|
{
|
|
this.dataMapper = dataMapper;
|
|
return this;
|
|
}
|
|
|
|
public HttpPipeLineInfo setHandler(Action<IDataObject> handler)
|
|
{
|
|
this.handler = handler;
|
|
return this;
|
|
}
|
|
|
|
public HttpPipeLineInfo setRepeat(bool repeat, int count = 0, int interval = 1000)
|
|
{
|
|
this.repeat = repeat;
|
|
this.repeatCount = count;
|
|
this.repeatInterval = interval;
|
|
return this;
|
|
}
|
|
|
|
|
|
}
|
|
}
|