using System.ComponentModel.DataAnnotations;
using BookmarkApi.Shared.Enums;

namespace BookmarkApi.Shared.DTOs.Bookmark;

/// <summary>
/// 创建书签请求
/// </summary>
public class CreateBookmarkRequest
{
    /// <summary>
    /// 书签标题
    /// </summary>
    [Required(ErrorMessage = "标题不能为空")]
    [StringLength(500, ErrorMessage = "标题长度不能超过500个字符")]
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 书签URL
    /// </summary>
    [Required(ErrorMessage = "URL不能为空")]
    [Url(ErrorMessage = "URL格式不正确")]
    [StringLength(2000, ErrorMessage = "URL长度不能超过2000个字符")]
    public string Url { get; set; } = string.Empty;

    /// <summary>
    /// 书签描述
    /// </summary>
    [StringLength(2000, ErrorMessage = "描述长度不能超过2000个字符")]
    public string? Description { get; set; }

    /// <summary>
    /// 网站图标
    /// </summary>
    public string? Icon { get; set; }

    /// <summary>
    /// 标签数组
    /// </summary>
    public string[]? Tags { get; set; }

    /// <summary>
    /// 可见性类型
    /// </summary>
    public VisibilityType Visibility { get; set; } = VisibilityType.Public;

    /// <summary>
    /// 允许查看的设备ID列表
    /// </summary>
    public Guid[]? AllowedDevices { get; set; }
}

