Files
parr_api/PARR.API/Contracts/V1/ApiRoutes.cs
Mikhail Kuznetsov 57fe9eff09 API
2023-06-16 15:00:11 +10:00

58 lines
2.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace PARR.API.Contracts.V1
{
// 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";
}
public static class Scheduler
{
public const string GetAll = Base + "/schedulers/";
public const string GetByIp = Base + "/schedulers/ip/";
//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}";
}
//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}";
//
}
}