赛事是否也报名
This commit is contained in:
parent
349bd553df
commit
203a38491d
@ -1415,4 +1415,78 @@ public class UserEventRegistrationService : IDynamicApiController, ITransient
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证用户是否已报名该赛事
|
||||
/// </summary>
|
||||
[DisplayName("验证用户报名状态")]
|
||||
[HttpPost("registration-status/check")]
|
||||
public async Task<CheckRegistrationStatusOutput> CheckRegistrationStatus([FromBody] CheckRegistrationStatusInput input)
|
||||
{
|
||||
var userId = _authManager.UserId;
|
||||
var result = new CheckRegistrationStatusOutput();
|
||||
|
||||
// 查询用户是否已报名该赛事
|
||||
var registration = await _registrationRepository.GetFirstAsync(x =>
|
||||
x.EventId == input.EventId &&
|
||||
x.CreatedUserId == userId &&
|
||||
!x.DeleteMark &&
|
||||
(
|
||||
(x.PaymentMethod == 1 && (x.PaymentStatus == 0 || x.PaymentStatus == 1)) ||
|
||||
(x.PaymentMethod == 2 && x.PaymentStatus == 1)
|
||||
));
|
||||
|
||||
if (registration != null)
|
||||
{
|
||||
result.IsRegistered = true;
|
||||
result.RegistrationId = registration.Id;
|
||||
result.RegistrationStatus = GetPaymentStatusDesc(registration.PaymentStatus);
|
||||
result.Message = "您已报名该赛事,请先取消报名后再重新报名";
|
||||
}
|
||||
else
|
||||
{
|
||||
result.IsRegistered = false;
|
||||
result.Message = "可以报名";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证用户报名状态输入
|
||||
/// </summary>
|
||||
public class CheckRegistrationStatusInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 赛事ID
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long EventId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证用户报名状态输出
|
||||
/// </summary>
|
||||
public class CheckRegistrationStatusOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否已报名
|
||||
/// </summary>
|
||||
public bool IsRegistered { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报名ID (如果已报名)
|
||||
/// </summary>
|
||||
public long? RegistrationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报名状态描述
|
||||
/// </summary>
|
||||
public string? RegistrationStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提示消息
|
||||
/// </summary>
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -8487,6 +8487,46 @@
|
||||
检查组别选择限制
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatus(YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatusInput)">
|
||||
<summary>
|
||||
验证用户是否已报名该赛事
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatusInput">
|
||||
<summary>
|
||||
验证用户报名状态输入
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatusInput.EventId">
|
||||
<summary>
|
||||
赛事ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatusOutput">
|
||||
<summary>
|
||||
验证用户报名状态输出
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatusOutput.IsRegistered">
|
||||
<summary>
|
||||
是否已报名
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatusOutput.RegistrationId">
|
||||
<summary>
|
||||
报名ID (如果已报名)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatusOutput.RegistrationStatus">
|
||||
<summary>
|
||||
报名状态描述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Event.UserEventRegistrationService.CheckRegistrationStatusOutput.Message">
|
||||
<summary>
|
||||
提示消息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Logging.Dtos.LogPageQueryInput">
|
||||
<summary>
|
||||
日志分页查询输入
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user