Обнновлено до .net10
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
public class YApiRequestAttribute : YBasePathRequestAttribute
|
||||
{
|
||||
public class YApiRequestAttribute : YBasePathRequestAttribute
|
||||
public YApiRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
public YApiRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
basePath = "https://api.music.yandex.net";
|
||||
}
|
||||
basePath = "https://api.music.yandex.net";
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,31 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Атрибут запроса относительно базового адреса
|
||||
/// </summary>
|
||||
public class YBasePathRequestAttribute : YRequestAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Атрибут запроса относительно базового адреса
|
||||
/// </summary>
|
||||
public class YBasePathRequestAttribute : YRequestAttribute
|
||||
#region Поля
|
||||
|
||||
protected string basePath;
|
||||
|
||||
#endregion Поля
|
||||
|
||||
#region Свойства
|
||||
public override string Url => GetFullUrl();
|
||||
|
||||
#endregion Свойства
|
||||
|
||||
#region Вспомогательные функции
|
||||
|
||||
private string GetFullUrl()
|
||||
{
|
||||
#region Поля
|
||||
return $"{basePath.TrimEnd('/')}/{path.TrimStart('/')}";
|
||||
}
|
||||
|
||||
protected string basePath;
|
||||
#endregion Вспомогательные функции
|
||||
|
||||
#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)
|
||||
{
|
||||
}
|
||||
public YBasePathRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
public class YLoginRequestAttribute : YBasePathRequestAttribute
|
||||
{
|
||||
public class YLoginRequestAttribute : YBasePathRequestAttribute
|
||||
public YLoginRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
public YLoginRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
basePath = "https://login.yandex.ru";
|
||||
}
|
||||
basePath = "https://login.yandex.ru";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
public class YMobileProxyRequestAttribute : YBasePathRequestAttribute
|
||||
{
|
||||
public class YMobileProxyRequestAttribute : YBasePathRequestAttribute
|
||||
public YMobileProxyRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
public YMobileProxyRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
basePath = "https://mobileproxy.passport.yandex.net";
|
||||
}
|
||||
basePath = "https://mobileproxy.passport.yandex.net";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
public class YOAuthMobileAttribute : YBasePathRequestAttribute
|
||||
{
|
||||
public class YOAuthMobileAttribute : YBasePathRequestAttribute
|
||||
public YOAuthMobileAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
public YOAuthMobileAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
basePath = "https://oauth.mobile.yandex.net";
|
||||
}
|
||||
basePath = "https://oauth.mobile.yandex.net";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
public class YOAuthRequestAttribute : YBasePathRequestAttribute
|
||||
{
|
||||
public class YOAuthRequestAttribute : YBasePathRequestAttribute
|
||||
public YOAuthRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
public YOAuthRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
basePath = "https://oauth.yandex.ru";
|
||||
}
|
||||
basePath = "https://oauth.yandex.ru";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
public class YPassportRequestAttribute : YBasePathRequestAttribute
|
||||
{
|
||||
public class YPassportRequestAttribute : YBasePathRequestAttribute
|
||||
public YPassportRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
public YPassportRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
basePath = "https://passport.yandex.ru";
|
||||
}
|
||||
basePath = "https://passport.yandex.ru";
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,26 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Атрибут запроса без привязки к базовому адресу
|
||||
/// </summary>
|
||||
public class YRequestAttribute : Attribute
|
||||
{
|
||||
/// <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)
|
||||
{
|
||||
#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;
|
||||
}
|
||||
Method = method;
|
||||
path = url;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace YandexMusic.API.Requests.Common.Attributes
|
||||
namespace YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
public class YWebApiRequestAttribute : YBasePathRequestAttribute
|
||||
{
|
||||
public class YWebApiRequestAttribute : YBasePathRequestAttribute
|
||||
public YWebApiRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
public YWebApiRequestAttribute(string method, string url) : base(method, url)
|
||||
{
|
||||
basePath = "https://music.yandex.ru";
|
||||
}
|
||||
basePath = "https://music.yandex.ru";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user