[성현모] CPMeta 라이브러리, 예제 추가
This commit is contained in:
44
Projects/NetStandard/CPMeta/CPMeta.cs
Normal file
44
Projects/NetStandard/CPMeta/CPMeta.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using CPMeta.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CPMeta
|
||||
{
|
||||
public class CPMeta
|
||||
{
|
||||
public static int Port { get; set; } = 9000;
|
||||
|
||||
public static async Task<Response_SetWbmsMeta> SetWbmsMetaAsync(string host, Request_SetWbmsMeta request)
|
||||
{
|
||||
string url = $"https://{host}:{Port}/CPMeta/SetWbmsMeta";
|
||||
|
||||
Response_SetWbmsMeta res = await RestAPI.PostAsync<Request_SetWbmsMeta,Response_SetWbmsMeta>(url, request);
|
||||
return res;
|
||||
}
|
||||
|
||||
public static async Task<Response_GetWbmsMeta> GetWbmsMetaByProductId(string host, string productID, int shardID = 1)
|
||||
{
|
||||
string url = $"https://{host}:{Port}/CPMeta/GetWbmsMetaByProductID?";
|
||||
url += $"ProductID={productID}&";
|
||||
url += $"ShardID={shardID}";
|
||||
|
||||
Response_GetWbmsMeta res = await RestAPI.GetAsync<Response_GetWbmsMeta>(url);
|
||||
return res;
|
||||
}
|
||||
|
||||
public static async Task<Response_GetWbmsMeta> GetWbmsMetaByMacAddress(string host, string macAddress, int shardID = 1)
|
||||
{
|
||||
string url = $"https://{host}:{Port}/CPMeta/GetWbmsMetaByMacAddress?";
|
||||
url += $"MacAddress={macAddress}&";
|
||||
url += $"ShardID={shardID}";
|
||||
|
||||
Response_GetWbmsMeta res = await RestAPI.GetAsync<Response_GetWbmsMeta>(url);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user