2023-05-17 16:30:13 +10:00
|
|
|
|
namespace PARR.API.Contracts.V1
|
2023-05-17 16:00:50 +10:00
|
|
|
|
{
|
|
|
|
|
|
// https://tproger.ru/translations/luchshie-praktiki-razrabotki-rest-api-20-sovetov/
|
|
|
|
|
|
|
|
|
|
|
|
//----------URL должен отражать структуру вложенных ресурсов----------
|
|
|
|
|
|
// GET /shops/2/products получить список продуктов из магазина 2.
|
|
|
|
|
|
// GET /shops/2/products/31 получить детали продукта 31 из магазина 2.
|
|
|
|
|
|
// DELETE /shops/2/products/31 удалить продукт 31 из магазина 2.
|
|
|
|
|
|
// PUT /shops/2/products/31 обновить данные о продукте 31. Используйте PUT на URL ресурса, а не коллекции.
|
|
|
|
|
|
// POST /shops создать новый магазин и вернуть данные о нём.Используйте POST на URL коллекции.
|
|
|
|
|
|
|
|
|
|
|
|
//---------URL должен начинаться с коллекции и заканчиваться идентификатором---------
|
|
|
|
|
|
// GET /shops/:shopId/ или GET /category/:categoryId
|
|
|
|
|
|
|
|
|
|
|
|
public static class ApiRoutes
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string Root = "api";
|
|
|
|
|
|
|
|
|
|
|
|
public const string Version = "v1";
|
|
|
|
|
|
|
|
|
|
|
|
public const string Base = Root + "/" + Version;
|
|
|
|
|
|
|
|
|
|
|
|
public static class ApiStatus
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string Version = Base + "/version";
|
|
|
|
|
|
public const string Health = Base + "/health";
|
|
|
|
|
|
public const string Metrics = Base + "/metrics";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-06-20 12:29:58 +10:00
|
|
|
|
public static class Jobs
|
2023-06-16 15:00:11 +10:00
|
|
|
|
{
|
2023-06-20 12:29:58 +10:00
|
|
|
|
public const string GetAll = Base + "/jobs/";
|
2023-06-16 15:00:11 +10:00
|
|
|
|
|
2023-06-20 12:29:58 +10:00
|
|
|
|
public const string GetByIp = Base + "/jobs/ip/";
|
2023-06-16 15:00:11 +10:00
|
|
|
|
//public const string Get = Base + "/schedulers/" + getParam;
|
|
|
|
|
|
|
|
|
|
|
|
//public const string GetAreas = Base + "/schedulers/" + getParam + "/areas";
|
|
|
|
|
|
//public const string GetPlaces = Base + "/schedulers/" + getParam + "/places";
|
|
|
|
|
|
//public const string GetTemplates = Base + "/schedulers/" + getParam + "/templates";
|
|
|
|
|
|
|
|
|
|
|
|
public const string getParam = "{id}";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 16:32:46 +10:00
|
|
|
|
//public static class EsppData
|
|
|
|
|
|
//{
|
|
|
|
|
|
// public const string UploadTemplates = Base + "/espp-data/templates";
|
2023-08-24 17:03:12 +10:00
|
|
|
|
|
2023-09-15 16:32:46 +10:00
|
|
|
|
//}
|
2023-08-24 17:03:12 +10:00
|
|
|
|
|
2023-08-01 16:00:33 +10:00
|
|
|
|
public static class Test
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string GetMyIp = Base + "/tests/my-ip";
|
2023-09-15 16:32:46 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static class Template
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string GetAll = Base + "/templates/";
|
2023-10-11 15:28:37 +10:00
|
|
|
|
//public const string Get = Base + "/templates/" + getParam;
|
|
|
|
|
|
//public const string SetOkStatus = Base + "/templates/" + getParam + "/status/ok";
|
|
|
|
|
|
//public const string GetByStatusCode = Base + "/templates/status/{statusCode}";
|
2023-08-01 16:00:33 +10:00
|
|
|
|
|
2023-09-15 16:32:46 +10:00
|
|
|
|
|
|
|
|
|
|
public const string getParam = "{id}";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-11 15:28:37 +10:00
|
|
|
|
public static class TemplateScheduleEspp
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string Get = Base + "/templates/" + templateId + "/schedule-esppid";
|
|
|
|
|
|
|
|
|
|
|
|
public const string Create = Base + "/templates/" + templateId + "/schedule-esppid";
|
|
|
|
|
|
|
|
|
|
|
|
public const string templateId = "{templateId}";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-06 13:58:10 +10:00
|
|
|
|
public static class RobotHistory
|
2023-10-04 15:22:06 +10:00
|
|
|
|
{
|
2023-10-06 13:58:10 +10:00
|
|
|
|
//public const string GetAll = Base + "/robot-histories/";
|
|
|
|
|
|
public const string Create = Base + "/robot-histories/";
|
2023-10-04 15:22:06 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-06 14:24:58 +10:00
|
|
|
|
public static class TaskStatus
|
2023-09-15 16:32:46 +10:00
|
|
|
|
{
|
2023-10-06 14:24:58 +10:00
|
|
|
|
public const string GetAll = Base + "/task-statuses/";
|
2023-08-01 16:00:33 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-20 11:59:09 +10:00
|
|
|
|
public static class GeneratorTemplate
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string Create = Base + "/generator-templates/";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-26 12:26:37 +10:00
|
|
|
|
public static class Host
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string GetAll = Base + "/hosts/";
|
|
|
|
|
|
}
|
2023-08-01 16:00:33 +10:00
|
|
|
|
|
2023-10-04 15:22:06 +10:00
|
|
|
|
public static class RobotHistoryLevel
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string GetAll = Base + "/robot-history-levels/";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-05 16:56:02 +10:00
|
|
|
|
public static class RobotTask
|
|
|
|
|
|
{
|
2023-10-06 11:38:33 +10:00
|
|
|
|
public const string GetByRobotAndStatusTask = Base + "/robot-tasks/robots/" + robotCode + "/statuses/" + taskStatusCode;
|
2023-10-05 16:56:02 +10:00
|
|
|
|
|
|
|
|
|
|
public const string robotCode = "{robotCode}";
|
|
|
|
|
|
public const string taskStatusCode = "{taskStatusCode}";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-06 11:38:33 +10:00
|
|
|
|
public static class RobotTaskRobotStatus
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string ChangeRobotStatus = Base + "/robot-tasks/" + taskId + "/robot-status";
|
|
|
|
|
|
|
|
|
|
|
|
public const string taskId = "{taskId}";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-04 15:22:06 +10:00
|
|
|
|
|
2023-05-17 16:00:50 +10:00
|
|
|
|
//public static class Layer
|
|
|
|
|
|
//{
|
|
|
|
|
|
// public const string GetAll = Base + "/layers/";
|
|
|
|
|
|
// public const string Get = Base + "/layers/" + getParam;
|
|
|
|
|
|
|
|
|
|
|
|
// public const string GetAreas = Base + "/layers/" + getParam + "/areas";
|
|
|
|
|
|
// public const string GetPlaces = Base + "/layers/" + getParam + "/places";
|
|
|
|
|
|
// public const string GetTemplates = Base + "/layers/" + getParam + "/templates";
|
|
|
|
|
|
|
|
|
|
|
|
// public const string getParam = "{id}";
|
2023-06-16 15:00:11 +10:00
|
|
|
|
//
|
2023-05-17 16:00:50 +10:00
|
|
|
|
}
|
2023-08-01 16:00:33 +10:00
|
|
|
|
|
|
|
|
|
|
}
|