namespace Hua.Todo.Application.DynamicApi;

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
/// <summary>
/// 标记方法为 HTTP GET。
/// </summary>
public class HttpGetAttribute : Attribute
{
    /// <summary>
    /// 可选路由模板。
    /// </summary>
    public string? Route { get; set; }

    /// <summary>
    /// 创建 <see cref="HttpGetAttribute"/>。
    /// </summary>
    public HttpGetAttribute()
    {
    }

    /// <summary>
    /// 创建 <see cref="HttpGetAttribute"/>。
    /// </summary>
    /// <param name="route">路由模板。</param>
    public HttpGetAttribute(string route)
    {
        Route = route;
    }
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
/// <summary>
/// 标记方法为 HTTP POST。
/// </summary>
public class HttpPostAttribute : Attribute
{
    /// <summary>
    /// 可选路由模板。
    /// </summary>
    public string? Route { get; set; }

    /// <summary>
    /// 创建 <see cref="HttpPostAttribute"/>。
    /// </summary>
    public HttpPostAttribute()
    {
    }

    /// <summary>
    /// 创建 <see cref="HttpPostAttribute"/>。
    /// </summary>
    /// <param name="route">路由模板。</param>
    public HttpPostAttribute(string route)
    {
        Route = route;
    }
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
/// <summary>
/// 标记方法为 HTTP PUT。
/// </summary>
public class HttpPutAttribute : Attribute
{
    /// <summary>
    /// 可选路由模板。
    /// </summary>
    public string? Route { get; set; }

    /// <summary>
    /// 创建 <see cref="HttpPutAttribute"/>。
    /// </summary>
    public HttpPutAttribute()
    {
    }

    /// <summary>
    /// 创建 <see cref="HttpPutAttribute"/>。
    /// </summary>
    /// <param name="route">路由模板。</param>
    public HttpPutAttribute(string route)
    {
        Route = route;
    }
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
/// <summary>
/// 标记方法为 HTTP DELETE。
/// </summary>
public class HttpDeleteAttribute : Attribute
{
    /// <summary>
    /// 可选路由模板。
    /// </summary>
    public string? Route { get; set; }

    /// <summary>
    /// 创建 <see cref="HttpDeleteAttribute"/>。
    /// </summary>
    public HttpDeleteAttribute()
    {
    }

    /// <summary>
    /// 创建 <see cref="HttpDeleteAttribute"/>。
    /// </summary>
    /// <param name="route">路由模板。</param>
    public HttpDeleteAttribute(string route)
    {
        Route = route;
    }
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
/// <summary>
/// 标记方法为 HTTP PATCH。
/// </summary>
public class HttpPatchAttribute : Attribute
{
    /// <summary>
    /// 可选路由模板。
    /// </summary>
    public string? Route { get; set; }

    /// <summary>
    /// 创建 <see cref="HttpPatchAttribute"/>。
    /// </summary>
    public HttpPatchAttribute()
    {
    }

    /// <summary>
    /// 创建 <see cref="HttpPatchAttribute"/>。
    /// </summary>
    /// <param name="route">路由模板。</param>
    public HttpPatchAttribute(string route)
    {
        Route = route;
    }
}
