Refact duty/content

main
ilitirit 3 years ago
parent 236b936c5c
commit 7de765d029

@ -43,7 +43,8 @@ namespace Expedience.Api.Consumers
var completionResult = new DutyCompletionResult var completionResult = new DutyCompletionResult
{ {
Id = message.UploadId, Id = message.UploadId,
DutyId = message.DutyInfo.DutyId, TerritoryId = message.DutyInfo.TerritoryId,
ContentId = message.DutyInfo.ContentId,
UserId = user.UserId, UserId = user.UserId,
HasEcho = message.DutyInfo.HasEcho, HasEcho = message.DutyInfo.HasEcho,
IsUnrestricted = message.DutyInfo.IsUnrestricted, IsUnrestricted = message.DutyInfo.IsUnrestricted,
@ -59,6 +60,7 @@ namespace Expedience.Api.Consumers
PluginVersion = message.ClientInfo.PluginVersion, PluginVersion = message.ClientInfo.PluginVersion,
Lang = message.ClientInfo.GameLanguage, Lang = message.ClientInfo.GameLanguage,
DataCenter = message.DataCenter, DataCenter = message.DataCenter,
UploadedAt = message.UploadDateUtc,
}; };
dbContext.DutyCompletionResults.Add(completionResult); dbContext.DutyCompletionResults.Add(completionResult);

@ -96,7 +96,7 @@ namespace Expedience.Api.Controllers
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error obtaining user name for World Id {worldId} and hash {userHash}: {errorMessage}", ex.Message); _logger.LogError(ex, "Error obtaining user name for World Id {worldId} and hash {userHash}: {errorMessage}", worldId, userHash, ex.Message);
} }
finally finally
{ {
@ -107,6 +107,8 @@ namespace Expedience.Api.Controllers
{ {
_logger.LogError("Could not acquire lock for {lockKey}", lockKey); _logger.LogError("Could not acquire lock for {lockKey}", lockKey);
} }
return StatusCode(500);
} }
} }
} }

@ -9,7 +9,7 @@ namespace Expedience.Infrastructure.Models
public class Duty public class Duty
{ {
public int Id { get; set; } public int Id { get; set; }
public string DutyName { get; set; } public string ContentName { get; set; }
public string DutyType { get; set; } public string DutyType { get; set; }
} }

@ -4,7 +4,8 @@
{ {
public Guid Id { get; set; } public Guid Id { get; set; }
public int UserId { get; set; } public int UserId { get; set; }
public int DutyId { get; set; } public int TerritoryId { get; set; }
public int ContentId { get; set; }
public bool HasEcho { get; set; } public bool HasEcho { get; set; }
public bool IsUnrestricted { get; set; } public bool IsUnrestricted { get; set; }
public bool IsMinILevel { get; set; } public bool IsMinILevel { get; set; }
@ -20,6 +21,7 @@
public string Lang { get; set; } public string Lang { get; set; }
public List<DutyMember> DutyMembers { get; set; } public List<DutyMember> DutyMembers { get; set; }
public string DataCenter { get; set; } public string DataCenter { get; set; }
public DateTime UploadedAt { get; set; }
} }
} }

@ -13,8 +13,9 @@ namespace Expedience.Models
private Stopwatch _stopwatch; private Stopwatch _stopwatch;
public PlayerInfo Player { get; set; } public PlayerInfo Player { get; set; }
public int DutyId { get; set; } public int TerritoryId { get; set; }
public string DutyName { get; set; } public int ContentId { get; set; }
public string ContentName { get; set; }
public List<GroupMemberInfo> PartyMembers { get; set; } = new(); public List<GroupMemberInfo> PartyMembers { get; set; } = new();
public DateTime StartTime { get; } public DateTime StartTime { get; }
public DateTime EndTime { get; private set; } public DateTime EndTime { get; private set; }

@ -15,8 +15,9 @@ namespace Expedience.Models
{ {
DutyInfo = new DutyInfo DutyInfo = new DutyInfo
{ {
DutyId = currentDuty.DutyId, TerritoryId = currentDuty.TerritoryId,
DutyName = currentDuty.DutyName, ContentName = currentDuty.ContentName,
ContentId = currentDuty.ContentId,
IsUnrestricted = currentDuty.IsUnrestricted, IsUnrestricted = currentDuty.IsUnrestricted,
IsMinILevel = currentDuty.IsMinILevel, IsMinILevel = currentDuty.IsMinILevel,
IsNpcSupported = currentDuty.PartyMembers.Any(p => p.IsNpc), IsNpcSupported = currentDuty.PartyMembers.Any(p => p.IsNpc),

@ -8,8 +8,9 @@ namespace Expedience.Models
{ {
public class DutyInfo public class DutyInfo
{ {
public int DutyId { get; set; } public int TerritoryId { get; set; }
public string DutyName { get; set; } public int ContentId { get; internal set; }
public string ContentName { get; set; }
public bool IsUnrestricted { get; set; } public bool IsUnrestricted { get; set; }
public bool HasEcho { get; set; } public bool HasEcho { get; set; }
public bool IsNpcSupported { get; set; } public bool IsNpcSupported { get; set; }

Loading…
Cancel
Save