Добавьте файлы проекта.

This commit is contained in:
FrigaT
2026-04-10 12:12:33 +03:00
parent 9615cf42ee
commit 11d0b0d72f
383 changed files with 9661 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
public class YApiRequestAttribute : YBasePathRequestAttribute
{
public YApiRequestAttribute(string method, string url) : base(method, url)
{
basePath = "https://api.music.yandex.net";
}
}
}

View File

@@ -0,0 +1,32 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
/// <summary>
/// Атрибут запроса относительно базового адреса
/// </summary>
public class YBasePathRequestAttribute : YRequestAttribute
{
#region Поля
protected string basePath;
#endregion Поля
#region Свойства
public override string Url => GetFullUrl();
#endregion Свойства
#region Вспомогательные функции
private string GetFullUrl()
{
return $"{basePath.TrimEnd('/')}/{path.TrimStart('/')}";
}
#endregion Вспомогательные функции
public YBasePathRequestAttribute(string method, string url) : base(method, url)
{
}
}
}

View File

@@ -0,0 +1,10 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
public class YLoginRequestAttribute : YBasePathRequestAttribute
{
public YLoginRequestAttribute(string method, string url) : base(method, url)
{
basePath = "https://login.yandex.ru";
}
}
}

View File

@@ -0,0 +1,10 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
public class YMobileProxyRequestAttribute : YBasePathRequestAttribute
{
public YMobileProxyRequestAttribute(string method, string url) : base(method, url)
{
basePath = "https://mobileproxy.passport.yandex.net";
}
}
}

View File

@@ -0,0 +1,10 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
public class YOAuthMobileAttribute : YBasePathRequestAttribute
{
public YOAuthMobileAttribute(string method, string url) : base(method, url)
{
basePath = "https://oauth.mobile.yandex.net";
}
}
}

View File

@@ -0,0 +1,10 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
public class YOAuthRequestAttribute : YBasePathRequestAttribute
{
public YOAuthRequestAttribute(string method, string url) : base(method, url)
{
basePath = "https://oauth.yandex.ru";
}
}
}

View File

@@ -0,0 +1,10 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
public class YPassportRequestAttribute : YBasePathRequestAttribute
{
public YPassportRequestAttribute(string method, string url) : base(method, url)
{
basePath = "https://passport.yandex.ru";
}
}
}

View File

@@ -0,0 +1,27 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
/// <summary>
/// Атрибут запроса без привязки к базовому адресу
/// </summary>
public class YRequestAttribute : Attribute
{
#region Поля
protected string path;
#endregion Поля
#region Свойства
public string Method { get; }
public virtual string Url => path;
#endregion Свойства
public YRequestAttribute(string method, string url)
{
Method = method;
path = url;
}
}
}

View File

@@ -0,0 +1,10 @@
namespace YandexMusic.API.Requests.Common.Attributes
{
public class YWebApiRequestAttribute : YBasePathRequestAttribute
{
public YWebApiRequestAttribute(string method, string url) : base(method, url)
{
basePath = "https://music.yandex.ru";
}
}
}