赛事详情
This commit is contained in:
parent
3b53312c27
commit
9beafeb1b0
@ -134,14 +134,14 @@ public class UserEventDetailOutput
|
|||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 赛事类型
|
/// 赛事类型 (int: 0-线上, 1-线下)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Type { get; set; }
|
public int Type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 报名方式
|
/// 报名方式 (int: 0-个人报名, 1-团队报名, 2-个人/团队报名)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string RegistrationType { get; set; }
|
public int RegistrationType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 积分规则名称
|
/// 积分规则名称
|
||||||
@ -189,7 +189,22 @@ public class UserEventDetailOutput
|
|||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 地址
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 城市名称
|
||||||
|
/// </summary>
|
||||||
|
public string CityName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 区县名称
|
||||||
|
/// </summary>
|
||||||
|
public string DistrictName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 详细地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Address { get; set; }
|
public string Address { get; set; }
|
||||||
|
|
||||||
@ -251,9 +266,9 @@ public class UserEventLimitOutput
|
|||||||
public class UserEventFeeOutput
|
public class UserEventFeeOutput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 收费模式
|
/// 收费模式 (int: 0-免费, 1-定价(赛事), 2-单价(赛事), 3-单价(项目))
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ChargeMode { get; set; }
|
public int ChargeMode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 价格
|
/// 价格
|
||||||
@ -897,6 +912,7 @@ public class UploadVoucherInput
|
|||||||
/// 支付金额
|
/// 支付金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
|
[Range(0.01, double.MaxValue, ErrorMessage = "支付金额必须大于0")]
|
||||||
public decimal PayAmount { get; set; }
|
public decimal PayAmount { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -904,13 +920,6 @@ public class UploadVoucherInput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public DateTime PayTime { get; set; }
|
public DateTime PayTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 交易流水号 (可选)
|
|
||||||
/// </summary>
|
|
||||||
public string? TransactionId { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -160,7 +160,7 @@ public class UnifiedRegistrationService : ITransient
|
|||||||
private async Task<EventRegistration> GetOrCreateRegistrationAsync(UnifiedRegistrationInput input)
|
private async Task<EventRegistration> GetOrCreateRegistrationAsync(UnifiedRegistrationInput input)
|
||||||
{
|
{
|
||||||
var existingRegistration = await _registrationRepository.GetFirstAsync(
|
var existingRegistration = await _registrationRepository.GetFirstAsync(
|
||||||
r => r.EventId == input.EventId && r.CreatedUserId == input.CreatedUserId && (r.PaymentStatus != 4 || r.PaymentStatus != 3));
|
r => r.EventId == input.EventId && r.CreatedUserId == input.CreatedUserId && r.PaymentStatus != 4 && r.PaymentStatus != 3);
|
||||||
|
|
||||||
if (existingRegistration != null)
|
if (existingRegistration != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -273,7 +273,33 @@ public class UserEventRecordService : IDynamicApiController, ITransient
|
|||||||
var registration = await _registrationRepository.GetFirstAsync(x => x.Id == registrationId && x.CreatedUserId == userId);
|
var registration = await _registrationRepository.GetFirstAsync(x => x.Id == registrationId && x.CreatedUserId == userId);
|
||||||
if (registration == null) throw Oops.Bah("报名记录不存在");
|
if (registration == null) throw Oops.Bah("报名记录不存在");
|
||||||
|
|
||||||
|
// 允许的文件类型
|
||||||
|
var allowedFileTypes = new[] { "image/jpeg", "image/jpg", "image/png", "application/pdf" };
|
||||||
|
// 允许的文件扩展名
|
||||||
|
var allowedFileExtensions = new[] { ".jpg", ".jpeg", ".png", ".pdf" };
|
||||||
|
// 最大文件大小 5MB
|
||||||
|
const long maxFileSize = 5 * 1024 * 1024;
|
||||||
|
|
||||||
|
// 验证文件类型
|
||||||
|
var fileName = input.File.FileName.ToLower();
|
||||||
|
var hasValidExtension = allowedFileExtensions.Any(ext => fileName.EndsWith(ext));
|
||||||
|
var hasValidType = allowedFileTypes.Contains(input.File.ContentType);
|
||||||
|
if (!hasValidExtension && !hasValidType)
|
||||||
|
{
|
||||||
|
throw Oops.Bah("仅支持jpg、jpeg、png、pdf格式的文件");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证文件大小
|
||||||
|
if (input.File.Length > maxFileSize)
|
||||||
|
{
|
||||||
|
throw Oops.Bah("文件大小不能超过5MB");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证支付金额
|
||||||
|
if (input.PayAmount <= 0)
|
||||||
|
{
|
||||||
|
throw Oops.Bah("支付金额必须大于0");
|
||||||
|
}
|
||||||
|
|
||||||
var uploadResult = await _fileService.Upload(input.File);
|
var uploadResult = await _fileService.Upload(input.File);
|
||||||
var fileInfo = uploadResult.First();
|
var fileInfo = uploadResult.First();
|
||||||
|
|||||||
@ -209,11 +209,32 @@ public class UserEventRegistrationService : IDynamicApiController, ITransient
|
|||||||
output.Description = eventInfo.EventIntroduction;
|
output.Description = eventInfo.EventIntroduction;
|
||||||
output.Address = eventInfo.DetailAddress;
|
output.Address = eventInfo.DetailAddress;
|
||||||
output.EventVideo = eventInfo.EventVideo;
|
output.EventVideo = eventInfo.EventVideo;
|
||||||
output.RegistrationType = eventInfo.RegistrationType.ToString();
|
|
||||||
|
// 直接赋值 int 类型
|
||||||
|
output.Type = (int)eventInfo.EventType;
|
||||||
|
output.RegistrationType = (int)eventInfo.RegistrationType;
|
||||||
|
|
||||||
output.IsNeedMaterial = eventInfo.IsNeedMaterial;
|
output.IsNeedMaterial = eventInfo.IsNeedMaterial;
|
||||||
output.MaterialRemark = eventInfo.MaterialRemark;
|
output.MaterialRemark = eventInfo.MaterialRemark;
|
||||||
output.MaterialUploadEndTime = eventInfo.MaterialUploadEndTime;
|
output.MaterialUploadEndTime = eventInfo.MaterialUploadEndTime;
|
||||||
|
|
||||||
|
// 查询省市区名称
|
||||||
|
if (eventInfo.ProvinceId.HasValue)
|
||||||
|
{
|
||||||
|
var province = await _db.Queryable<SysProvince>().FirstAsync(x => x.Id == eventInfo.ProvinceId.Value && !x.DeleteMark);
|
||||||
|
output.ProvinceName = province?.ProvinceName ?? "";
|
||||||
|
}
|
||||||
|
if (eventInfo.CityId.HasValue)
|
||||||
|
{
|
||||||
|
var city = await _db.Queryable<SysCity>().FirstAsync(x => x.Id == eventInfo.CityId.Value && !x.DeleteMark);
|
||||||
|
output.CityName = city?.CityName ?? "";
|
||||||
|
}
|
||||||
|
if (eventInfo.DistrictId.HasValue)
|
||||||
|
{
|
||||||
|
var district = await _db.Queryable<SysDistrict>().FirstAsync(x => x.Id == eventInfo.DistrictId.Value && !x.DeleteMark);
|
||||||
|
output.DistrictName = district?.DistrictName ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
if (eventInfo.PointsRuleId.HasValue)
|
if (eventInfo.PointsRuleId.HasValue)
|
||||||
{
|
{
|
||||||
var rule = await _pointsRuleRepository.GetByIdAsync(eventInfo.PointsRuleId.Value);
|
var rule = await _pointsRuleRepository.GetByIdAsync(eventInfo.PointsRuleId.Value);
|
||||||
@ -238,7 +259,7 @@ public class UserEventRegistrationService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
var feeConfig = new UserEventFeeOutput
|
var feeConfig = new UserEventFeeOutput
|
||||||
{
|
{
|
||||||
ChargeMode = fee.ChargeMode.ToString(),
|
ChargeMode = (int)fee.ChargeMode,
|
||||||
Price = fee.Price
|
Price = fee.Price
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -6623,12 +6623,12 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.Type">
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.Type">
|
||||||
<summary>
|
<summary>
|
||||||
赛事类型
|
赛事类型 (int: 0-线上, 1-线下)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.RegistrationType">
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.RegistrationType">
|
||||||
<summary>
|
<summary>
|
||||||
报名方式
|
报名方式 (int: 0-个人报名, 1-团队报名, 2-个人/团队报名)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.PointsRuleName">
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.PointsRuleName">
|
||||||
@ -6676,9 +6676,24 @@
|
|||||||
赛事简介/规则
|
赛事简介/规则
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.ProvinceName">
|
||||||
|
<summary>
|
||||||
|
省份名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.CityName">
|
||||||
|
<summary>
|
||||||
|
城市名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.DistrictName">
|
||||||
|
<summary>
|
||||||
|
区县名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.Address">
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.Address">
|
||||||
<summary>
|
<summary>
|
||||||
地址
|
详细地址
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.Remark">
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventDetailOutput.Remark">
|
||||||
@ -6738,7 +6753,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.UserEventFeeOutput.ChargeMode">
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventFeeOutput.ChargeMode">
|
||||||
<summary>
|
<summary>
|
||||||
收费模式
|
收费模式 (int: 0-免费, 1-定价(赛事), 2-单价(赛事), 3-单价(项目))
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.UserEventFeeOutput.Price">
|
<member name="P:YD_Event.Application.Event.Dtos.UserEventFeeOutput.Price">
|
||||||
@ -7366,11 +7381,6 @@
|
|||||||
支付时间
|
支付时间
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:YD_Event.Application.Event.Dtos.UploadVoucherInput.TransactionId">
|
|
||||||
<summary>
|
|
||||||
交易流水号 (可选)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="T:YD_Event.Application.Event.Dtos.VoucherDTO">
|
<member name="T:YD_Event.Application.Event.Dtos.VoucherDTO">
|
||||||
<summary>
|
<summary>
|
||||||
支付凭证输出
|
支付凭证输出
|
||||||
|
|||||||
@ -37,8 +37,8 @@
|
|||||||
{
|
{
|
||||||
"ConfigId": 1,
|
"ConfigId": 1,
|
||||||
"DbType": "SqlServer", // MySql、SqlServer、Sqlite、Oracle、PostgreSQL、Dm、Kdbndp、Oscar、MySqlConnector、Access、OpenGauss、QuestDB、HG、ClickHouse、GBase、Odbc、Custom
|
"DbType": "SqlServer", // MySql、SqlServer、Sqlite、Oracle、PostgreSQL、Dm、Kdbndp、Oscar、MySqlConnector、Access、OpenGauss、QuestDB、HG、ClickHouse、GBase、Odbc、Custom
|
||||||
//"ConnectionString": "Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=EventServerDB_QA;User ID=qa;Password=Admin@123;Connect Timeout=500;Encrypt=True;TrustServerCertificate=True;",
|
"ConnectionString": "Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=EventServerDB_QA;User ID=qa;Password=Admin@123;Connect Timeout=500;Encrypt=True;TrustServerCertificate=True;",
|
||||||
"ConnectionString": "Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=EventServerDB;User ID=yd;Password=Admin@123456;Connect Timeout=500;Encrypt=True;TrustServerCertificate=True;",
|
//"ConnectionString": "Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=EventServerDB;User ID=yd;Password=Admin@123456;Connect Timeout=500;Encrypt=True;TrustServerCertificate=True;",
|
||||||
"IsAutoCloseConnection": true,
|
"IsAutoCloseConnection": true,
|
||||||
"EnableInitDb": false // 启用数据库以及数据表初始化(首次运行项目时开启可以自动创建数据库和初始化项目运行的基础数据)
|
"EnableInitDb": false // 启用数据库以及数据表初始化(首次运行项目时开启可以自动创建数据库和初始化项目运行的基础数据)
|
||||||
}
|
}
|
||||||
@ -53,8 +53,8 @@
|
|||||||
"SleepMs": 300,
|
"SleepMs": 300,
|
||||||
"dbconfig": {
|
"dbconfig": {
|
||||||
"ConnectionStrings": [
|
"ConnectionStrings": [
|
||||||
//"8.153.108.90,Password=yd708090,SyncTimeout=15000,ConnectTimeout=15000,ResponseTimeout=15000,defaultDatabase=7,poolsize=100,ssl=false,writeBuffer=10240,idleTimeout=30000,connectRetry=3,asyncPipeline=false",
|
"8.153.108.90,Password=yd708090,SyncTimeout=15000,ConnectTimeout=15000,ResponseTimeout=15000,defaultDatabase=7,poolsize=100,ssl=false,writeBuffer=10240,idleTimeout=30000,connectRetry=3,asyncPipeline=false",
|
||||||
"8.153.108.90,Password=yd708090,SyncTimeout=15000,ConnectTimeout=15000,ResponseTimeout=15000,defaultDatabase=8,poolsize=100,ssl=false,writeBuffer=10240,idleTimeout=30000,connectRetry=3,asyncPipeline=false"
|
//"8.153.108.90,Password=yd708090,SyncTimeout=15000,ConnectTimeout=15000,ResponseTimeout=15000,defaultDatabase=8,poolsize=100,ssl=false,writeBuffer=10240,idleTimeout=30000,connectRetry=3,asyncPipeline=false"
|
||||||
],
|
],
|
||||||
//"Sentinels": [
|
//"Sentinels": [
|
||||||
// "192.169.1.10:26379",
|
// "192.169.1.10:26379",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user