321
This commit is contained in:
parent
57d5d5a610
commit
3f24b57e8c
|
|
@ -160,7 +160,6 @@ public class QuanYiService : IQuanYiService
|
||||||
|
|
||||||
// Note: PHP code allows re-claiming, so we don't check for existing claims
|
// Note: PHP code allows re-claiming, so we don't check for existing claims
|
||||||
|
|
||||||
var response = new QuanYiLingResponse();
|
|
||||||
var rewards = new List<QuanYiLingRewardDto>();
|
var rewards = new List<QuanYiLingRewardDto>();
|
||||||
|
|
||||||
using var transaction = await _dbContext.Database.BeginTransactionAsync();
|
using var transaction = await _dbContext.Database.BeginTransactionAsync();
|
||||||
|
|
@ -347,9 +346,8 @@ public class QuanYiService : IQuanYiService
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
|
|
||||||
response.Rewards = rewards;
|
|
||||||
_logger.LogInformation("User {UserId} claimed VIP level {LevelId} rewards", userId, levelId);
|
_logger.LogInformation("User {UserId} claimed VIP level {LevelId} rewards", userId, levelId);
|
||||||
return response;
|
return new QuanYiLingResponse(rewards);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -177,15 +177,12 @@ public class QuanYiLingRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 权益领取响应
|
/// 权益领取响应 - 直接返回奖品数组以兼容前端
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class QuanYiLingResponse
|
public class QuanYiLingResponse : List<QuanYiLingRewardDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
public QuanYiLingResponse() : base() { }
|
||||||
/// 领取的奖品列表
|
public QuanYiLingResponse(IEnumerable<QuanYiLingRewardDto> collection) : base(collection) { }
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("rewards")]
|
|
||||||
public List<QuanYiLingRewardDto> Rewards { get; set; } = new();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user