2026-03-14 07:11:25 +08:00

252 lines
6.6 KiB
C#

using System.ComponentModel.DataAnnotations;
using YD_Event.Core.Enum;
namespace YD_Event.Application.Client.Dtos;
/// <summary>
/// 赛事列表项DTO
/// </summary>
public class EventListDto
{
public long Id { get; set; }
public string EventName { get; set; }
public string CoverImage { get; set; }
public EventStatus EventStatus { get; set; }
public DateTime RegistrationStartTime { get; set; }
public DateTime RegistrationEndTime { get; set; }
public DateTime MatchStartTime { get; set; }
public DateTime MatchEndTime { get; set; }
public string Address { get; set; } // 省市区+详细地址
}
/// <summary>
/// 轮播图DTO
/// </summary>
public class BannerDto
{
public string Title { get; set; }
public string ImageUrl { get; set; }
public LinkType LinkType { get; set; }
public string LinkUrl { get; set; }
public long? EventId { get; set; }
}
/// <summary>
/// 赛事单位DTO
/// </summary>
public class EventUnitDto
{
public UnitType UnitType { get; set; }
public string UnitName { get; set; }
public string LogoUrl { get; set; }
}
/// <summary>
/// 赛事详情DTO
/// </summary>
public class EventDetailDto : EventListDto
{
public string EventVideo { get; set; }
public EventFormat EventType { get; set; }
public ChargeMode ChargeMode { get; set; }
public RegistrationType RegistrationType { get; set; }
public string EventIntroduction { get; set; }
public string MaterialRemark { get; set; }
public DateTime? MaterialUploadStartTime { get; set; }
public DateTime? MaterialUploadEndTime { get; set; }
// 额外规则字段
public string RefundRule { get; set; } // 退款规则文本
public string PointsRule { get; set; } // 积分规则文本
// 限制条件
public int IndividualProjectLimit { get; set; } // 个人项目限报数量
public int TeamProjectLimit { get; set; } // 团队项目限报数量
// 单位列表
public List<EventUnitDto> Units { get; set; }
// 项目列表
public List<EventProjectDto> Projects { get; set; }
}
/// <summary>
/// 赛事项目DTO
/// </summary>
public class EventProjectDto
{
public long Id { get; set; }
public string Name { get; set; }
public string TypeName { get; set; } // 个人/团队
public decimal Fee { get; set; }
public List<EventProjectGroupDto> Groups { get; set; }
}
/// <summary>
/// 项目组别DTO
/// </summary>
public class EventProjectGroupDto
{
public long Id { get; set; }
public string GroupName { get; set; }
public string GenderRequirement { get; set; } // 性别要求文本
public string AgeRequirement { get; set; } // 年龄要求文本
}
/// <summary>
/// 赛事报名提交DTO
/// </summary>
public class SubmitRegistrationInput
{
[Required]
public long EventId { get; set; }
[Required]
public int RegistrationMode { get; set; } // 1-个人 2-团队
public string? TeamName { get; set; } // 团队报名必填
[Required]
public string ContactName { get; set; }
[Required]
public string ContactPhone { get; set; }
// 报名项目列表
[Required]
public List<SubmitRegistrationItemInput> Items { get; set; }
}
public class SubmitRegistrationItemInput
{
public long ProjectId { get; set; }
public string GroupName { get; set; } // 冗余存储,也可传 GroupId
public long? GroupId { get; set; } // 建议传ID
// 参赛人员列表
public List<PersonInput> Persons { get; set; }
}
public class PersonInput
{
[Required]
public string Name { get; set; }
[Required]
public string IdCard { get; set; }
public Gender Gender { get; set; }
public string Phone { get; set; }
public DateTime BirthDate { get; set; }
}
/// <summary>
/// 支付信息DTO
/// </summary>
public class PaymentInfoDto
{
public long RegistrationId { get; set; }
public decimal Amount { get; set; }
public int PaymentMethod { get; set; } // 1-线下 2-线上
// 线下支付信息
public string? BankAccountName { get; set; }
public string? BankAccountNo { get; set; }
public string? BankName { get; set; }
// 线上支付参数 (模拟微信支付参数)
public object? WechatPayParams { get; set; }
}
/// <summary>
/// 上传凭证输入DTO
/// </summary>
public class UploadVoucherInput
{
[Required]
public string VoucherUrl { get; set; }
}
/// <summary>
/// 更新参赛人输入DTO
/// </summary>
public class UpdatePlayerInput
{
[Required]
public long PersonId { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string IdCard { get; set; }
public Gender Gender { get; set; }
public string Phone { get; set; }
}
/// <summary>
/// 已报赛事列表DTO
/// </summary>
public class MyEventListDto
{
public long RegistrationId { get; set; }
public long EventId { get; set; }
public string EventName { get; set; }
public string CoverImage { get; set; }
public int RegistrationStatus { get; set; } // 报名状态
public int PaymentStatus { get; set; } // 支付状态
public DateTime RegistrationTime { get; set; }
public int ProjectCount { get; set; } // 报名项目数
}
public class RegistrationDetailDto
{
public long RegistrationId { get; set; }
public long EventId { get; set; }
public string EventName { get; set; }
public string CoverImage { get; set; }
public EventStatus EventStatus { get; set; } // 赛事状态
public int RegistrationStatus { get; set; }
public int PaymentStatus { get; set; }
public decimal TotalAmount { get; set; }
public string OrderNo { get; set; }
public DateTime RegistrationTime { get; set; }
public string? ReviewRemark { get; set; }
// 报名项目及人员
public List<RegistrationItemDto> Items { get; set; }
}
public class RegistrationItemDto
{
public long Id { get; set; }
public string ProjectName { get; set; }
public string GroupName { get; set; }
public decimal Price { get; set; }
public List<RegistrationPersonDto> Persons { get; set; }
}
public class RegistrationPersonDto
{
public long Id { get; set; }
public string Name { get; set; }
public string IdCard { get; set; }
public Gender Gender { get; set; }
public string Phone { get; set; }
}
/// <summary>
/// 报名状态查询DTO
/// </summary>
public class RegistrationStatusDto
{
public long RegistrationId { get; set; }
public int RegistrationStatus { get; set; }
public int PaymentStatus { get; set; }
public string RejectReason { get; set; } // 拒绝/取消原因
}