using System.ComponentModel.DataAnnotations;
using Yi.Framework.AiHub.Domain.Shared.Enums;

namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Announcement;

/// <summary>
/// 创建公告输入
/// </summary>
public class AnnouncementCreateInput
{
    /// <summary>
    /// 标题
    /// </summary>
    [Required(ErrorMessage = "标题不能为空")]
    [StringLength(200, ErrorMessage = "标题不能超过200个字符")]
    public string Title { get; set; }

    /// <summary>
    /// 内容列表
    /// </summary>
    [Required(ErrorMessage = "内容不能为空")]
    [MinLength(1, ErrorMessage = "至少需要一条内容")]
    public List<string> Content { get; set; } = new List<string>();

    /// <summary>
    /// 备注
    /// </summary>
    [StringLength(500, ErrorMessage = "备注不能超过500个字符")]
    public string? Remark { get; set; }

    /// <summary>
    /// 图片url
    /// </summary>
    [StringLength(500, ErrorMessage = "图片URL不能超过500个字符")]
    public string? ImageUrl { get; set; }

    /// <summary>
    /// 开始时间
    /// </summary>
    [Required(ErrorMessage = "开始时间不能为空")]
    public DateTime StartTime { get; set; }

    /// <summary>
    /// 活动结束时间
    /// </summary>
    public DateTime? EndTime { get; set; }

    /// <summary>
    /// 公告类型
    /// </summary>
    [Required(ErrorMessage = "公告类型不能为空")]
    public AnnouncementTypeEnum Type { get; set; }

    /// <summary>
    /// 跳转链接
    /// </summary>
    [StringLength(500, ErrorMessage = "跳转链接不能超过500个字符")]
    public string? Url { get; set; }
}
