Files
XRLib/Assets/Scripts/UVC/Data/HttpPipeLineInfo.cs

52 lines
1.4 KiB
C#
Raw Normal View History

#nullable enable
2025-06-05 20:09:28 +09:00
using System;
using System.Collections.Generic;
namespace UVC.Data
{
public class HttpPipeLineInfo
{
public string url;
public string method;
public Dictionary<string, string>? headers = null;
public string? body = null;
public Action<IDataObject?>? handler = null;
2025-06-05 20:09:28 +09:00
public bool repeat = false; // 반복 실행 여부
public int repeatCount = 0; // 반복 횟수, 0은 무한 반복
public int repeatInterval = 1000; // 반복 간격 (ms)
public DataMapper? dataMapper = null; // 데이터 매퍼
2025-06-05 20:09:28 +09:00
public HttpPipeLineInfo(string url, string method = "post", Dictionary<string, string>? headers = null, string? body = null)
2025-06-05 20:09:28 +09:00
{
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;
}
}
}