2026-03-14 05:19:40 +08:00

374 lines
9.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.ComponentModel.DataAnnotations;
using YD_Event.Application.Event.Dtos;
using YD_Event.Core.Entities;
using YD_Event.Core.Enum;
using Microsoft.AspNetCore.Http;
namespace YD_Event.Application.Event.Dtos;
/// <summary>
/// 用户端赛事查询输入
/// </summary>
public class UserEventQueryInput : Pagination
{
/// <summary>
/// 赛事状态 (0-全部, 1-报名中, 2-比赛中, 3-已结束)
/// </summary>
public EventStatus? Status { get; set; }
/// <summary>
/// 赛事类型
/// </summary>
public EventFormat? Type { get; set; }
/// <summary>
/// 时间范围开始
/// </summary>
public DateTime? StartTime { get; set; }
/// <summary>
/// 时间范围结束
/// </summary>
public DateTime? EndTime { get; set; }
/// <summary>
/// 关键字搜索(赛事名称)
/// </summary>
public string? Keyword { get; set; }
}
/// <summary>
/// 用户端赛事列表输出
/// </summary>
public class UserEventListOutput
{
public long Id { get; set; }
public string Name { get; set; }
public string CoverImage { get; set; }
public string Status { get; set; } // 报名中/比赛中/已结束
public string Type { get; set; } // 线上/线下
public DateTime RegistrationEndTime { get; set; }
public DateTime MatchStartTime { get; set; }
public DateTime MatchEndTime { get; set; }
}
/// <summary>
/// 用户端赛事详情输出
/// </summary>
public class UserEventDetailOutput
{
public long Id { get; set; }
public string Name { get; set; }
public string CoverImage { get; set; }
public string? EventVideo { get; set; } // 赛事视频
public string Status { get; set; }
public string Type { get; set; }
public string RegistrationType { get; set; } // 报名方式
public string PointsRuleName { get; set; } // 积分规则名称
public DateTime RegistrationStartTime { get; set; }
public DateTime RegistrationEndTime { get; set; }
public bool IsNeedMaterial { get; set; } // 是否上传素材
public string? MaterialRemark { get; set; } // 素材备注
public DateTime? MaterialUploadEndTime { get; set; } // 上传素材截止时间
public DateTime MatchStartTime { get; set; }
public DateTime MatchEndTime { get; set; }
public string Description { get; set; } // 赛事简介/规则
public string Address { get; set; }
public string? Remark { get; set; } // 备注
public List<EventUnitDto> Units { get; set; } // 主办/承办单位
// 配置信息
public UserEventLimitOutput? LimitConfig { get; set; }
public UserEventFeeOutput? FeeConfig { get; set; }
public List<UserEventProjectListOutput>? Projects { get; set; } // 项目列表(可选返回)
/// <summary>
/// 当前用户报名状态 (未报名/已报名/审核中)
/// </summary>
public string UserRegistrationStatus { get; set; }
public long? RegistrationId { get; set; } // 如果已报名,返回报名ID
}
public class UserEventLimitOutput
{
public int IndividualProjectLimit { get; set; }
public int TeamProjectLimit { get; set; }
}
public class UserEventFeeOutput
{
public string ChargeMode { get; set; }
public decimal Price { get; set; }
}
/// <summary>
/// 报名项目选择输出
/// </summary>
public class UserEventProjectListOutput
{
public long Id { get; set; }
public string Name { get; set; }
public string GroupName { get; set; } // 组别名称
public decimal Fee { get; set; }
public int? LimitCount { get; set; } // 人数限制
public int RegisteredCount { get; set; } // 已报名人数
public string Requirements { get; set; } // 报名要求描述
public int TeamSize { get; set; } // 团队人数要求 (1为个人)
public int CompletionCount { get; set; } // 完成人数
}
/// <summary>
/// 团队成员搜索输入
/// </summary>
public class UserMemberSearchInput
{
public string Keyword { get; set; } // 手机号或ID
}
/// <summary>
/// 团队成员信息输出
/// </summary>
public class UserTeamMemberOutput
{
public long UserId { get; set; }
public string Name { get; set; }
public string Mobile { get; set; }
public string IdCard { get; set; } // 脱敏显示
public string Gender { get; set; }
public bool IsEligible { get; set; } // 是否符合参赛资格
public string IneligibilityReason { get; set; } // 不符合原因
}
/// <summary>
/// 提交报名输入 (草稿或正式提交)
/// </summary>
public class UserSubmitRegistrationInput
{
public long EventId { get; set; }
/// <summary>
/// 选中的项目ID列表
/// </summary>
public List<long> ProjectIds { get; set; }
/// <summary>
/// 队员列表
/// </summary>
public List<long> MemberIds { get; set; }
/// <summary>
/// 是否保存草稿
/// </summary>
public bool IsDraft { get; set; }
}
/// <summary>
/// 订单预览输出
/// </summary>
public class UserOrderPreviewOutput
{
public long EventId { get; set; }
public string EventName { get; set; }
public List<UserEventProjectListOutput> Projects { get; set; }
public List<UserTeamMemberOutput> Members { get; set; }
public decimal TotalAmount { get; set; }
public Dictionary<string, decimal> FeeDetails { get; set; } // 费用明细
}
/// <summary>
/// 创建支付订单输入
/// </summary>
public class UserCreateOrderInput
{
public long RegistrationId { get; set; }
public int PaymentMethod { get; set; } // 1-微信, 2-支付宝, 3-银行卡
}
/// <summary>
/// 支付结果输出
/// </summary>
public class UserPaymentResultOutput
{
public string OrderNo { get; set; }
public string PayUrl { get; set; } // 支付链接或二维码内容
public int Status { get; set; } // 0-待支付
}
#region 参赛记录相关 DTOs
/// <summary>
/// 参赛记录查询输入
/// </summary>
public class RegistrationListQueryInput : Pagination
{
/// <summary>
/// 赛事ID (可选)
/// </summary>
public long? EventId { get; set; }
/// <summary>
/// 状态 (可选)
/// </summary>
public string? Status { get; set; } // 对应 RegistrationStatus 或 PaymentStatus 组合状态
/// <summary>
/// 关键字搜索 (队伍名/赛事名)
/// </summary>
public string? Keyword { get; set; }
}
/// <summary>
/// 参赛记录列表项输出
/// </summary>
public class RegistrationItemDTO
{
public long RegistrationId { get; set; }
public string EventName { get; set; }
public string TeamName { get; set; }
public string Status { get; set; } // 综合状态描述: 待付款, 待上传素材, 已取消, 已报名, 待审核
public DateTime CreateTime { get; set; }
public DateTime? UpdateTime { get; set; }
public string PayStatus { get; set; }
public string CertStatus { get; set; } // 证书状态
public bool HasMaterial { get; set; }
public bool HasVoucher { get; set; }
public int MemberCount { get; set; }
public int MaxMember { get; set; } // 允许的最大人数
public DateTime? ExpireTime { get; set; } // 支付或素材上传截止时间
}
/// <summary>
/// 上传素材输入
/// </summary>
public class UploadMaterialInput
{
/// <summary>
/// 文件列表 (最多5个)
/// </summary>
[Required]
public List<IFormFile> Files { get; set; }
/// <summary>
/// 素材类型 (图片/视频/其他)
/// </summary>
[Required]
public string MaterialType { get; set; }
/// <summary>
/// 描述 (可选)
/// </summary>
public string? Description { get; set; }
}
/// <summary>
/// 素材信息输出
/// </summary>
public class MaterialDTO
{
public string MaterialId { get; set; }
public string OssUrl { get; set; }
public string FileName { get; set; }
public long FileSize { get; set; }
public DateTime UploadTime { get; set; }
}
/// <summary>
/// 上传支付凭证输入
/// </summary>
public class UploadVoucherInput
{
/// <summary>
/// 凭证图片 (单张)
/// </summary>
[Required]
public IFormFile File { get; set; }
/// <summary>
/// 支付金额
/// </summary>
[Required]
public decimal PayAmount { get; set; }
/// <summary>
/// 支付时间
/// </summary>
[Required]
public DateTime PayTime { get; set; }
/// <summary>
/// 支付渠道 (微信/支付宝/银行转账)
/// </summary>
[Required]
public string PayChannel { get; set; }
/// <summary>
/// 交易流水号 (可选)
/// </summary>
public string? TransactionId { get; set; }
}
/// <summary>
/// 支付凭证输出
/// </summary>
public class VoucherDTO
{
public string VoucherId { get; set; }
public string OssUrl { get; set; }
public string AuditStatus { get; set; }
}
/// <summary>
/// 队员信息 DTO
/// </summary>
public class TeamMemberDTO
{
public long UserId { get; set; }
public string RealName { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string Role { get; set; } // 队长/队员
public string InviteStatus { get; set; } // 邀请状态
public DateTime JoinTime { get; set; }
}
/// <summary>
/// 更换队员输入
/// </summary>
public class ReplaceMemberInput
{
/// <summary>
/// 新队员用户ID
/// </summary>
[Required]
public long NewUserId { get; set; }
/// <summary>
/// 更换原因 (可选)
/// </summary>
public string? ReplaceReason { get; set; }
}
/// <summary>
/// 证书信息输出
/// </summary>
public class CertificateDTO
{
public string CertUrl { get; set; }
public string CertNumber { get; set; }
public DateTime IssueTime { get; set; }
public DateTime? ExpireTime { get; set; }
}
/// <summary>
/// 统一响应 DTO (泛型)
/// </summary>
public class ResponseDTO<T>
{
public int Code { get; set; }
public string Message { get; set; }
public T Data { get; set; }
public bool Success { get; set; }
}
#endregion