129 lines
3.6 KiB
C#
129 lines
3.6 KiB
C#
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
using ServerCore;
|
|
using ServerBase;
|
|
|
|
|
|
namespace ServerCommon;
|
|
|
|
|
|
public class CaliumConverterInfo
|
|
{
|
|
// 잔여 수량
|
|
[JsonProperty("converter_total_calium")]
|
|
public double TotalCalium { get; set; } = 0.0;
|
|
|
|
// 마지막 누적 시간
|
|
[JsonProperty("converter_last_fill_up_date")]
|
|
public DateTime LastFillUpDate { get; set; } = DateTimeHelper.MinTime;
|
|
|
|
// Daily 누적 Calium 수
|
|
[JsonProperty("converter_daily_fill_up_standard_calium")]
|
|
public double DailyFillUpStandardCalium { get; set; } = 0.0;
|
|
|
|
// 컨버터 칼리움 전환 비율
|
|
[JsonProperty("converter_daily_convert_rate")]
|
|
public double DailyConvertRate { get; set; } = 0.0;
|
|
|
|
// 누적 총량
|
|
[JsonProperty("converter_cumulative_calium")]
|
|
public double ConverterCumulativeCalium { get; set; } = 0.0;
|
|
}
|
|
|
|
public class CaliumExchangerInfo
|
|
{
|
|
// 인플레이션 가중치
|
|
[JsonProperty("exchanger_daily_inflation_rate")]
|
|
public double DailyInflationRate { get; set; } = 0.0;
|
|
}
|
|
|
|
public class CaliumOperatorInfo
|
|
{
|
|
// 운영 승인 누적량
|
|
[JsonProperty("operator_total_calium")]
|
|
public double TotalCalium { get; set; } = 0.0;
|
|
|
|
// 운영 승인 누적 날짜
|
|
[JsonProperty("operator_calium_fill_up_date")]
|
|
public DateTime FillUpDate { get; set; } = DateTimeHelper.MinTime;
|
|
|
|
// 운영용 사용 가능량
|
|
[JsonProperty("operator_calium")]
|
|
public double OperatorCalium { get; set; } = 0.0;
|
|
}
|
|
|
|
public class CaliumStorageAttrib : AttribBase
|
|
{
|
|
// RollUp 순번
|
|
[JsonProperty("daily_epoch")]
|
|
public int DailyEpoch { get; set; } = 0;
|
|
|
|
// RollUp 실패 Epoch Count
|
|
[JsonProperty("mis_epoch")]
|
|
public int MisEpoch { get; set; } = 0;
|
|
|
|
// RollUp Check 시작
|
|
[JsonProperty("daily_rollup_check_date")]
|
|
public DateTime DailyRollUpCheckDate { get; set; } = DateTimeHelper.MinTime;
|
|
|
|
// RollUp 시간
|
|
[JsonProperty("daily_pivot_date")]
|
|
public DateTime DailyPivotDate { get; set; } = DateTimeHelper.MinTime;
|
|
|
|
// 컨버터 저장 정보
|
|
[JsonProperty("calium_converter_storage")]
|
|
public CaliumConverterInfo ConverterStorage { get; set; } = new();
|
|
|
|
// 교환소 저장 정보
|
|
[JsonProperty("calium_exchanger_storage")]
|
|
public CaliumExchangerInfo ExchangerStorage { get; set; } = new();
|
|
|
|
// 운영 저장 정보
|
|
[JsonProperty("calium_operator_storage")]
|
|
public CaliumOperatorInfo OperatorStorage { get; set; } = new();
|
|
|
|
public CaliumStorageAttrib() : base(nameof(CaliumStorageAttrib), false) {}
|
|
}
|
|
|
|
//=============================================================================================
|
|
// PK(Partition Key) : "calium#storage"
|
|
// SK(Sort Key) : ""
|
|
// DocType : CaliumStorageDoc
|
|
// CaliumStorageAttrib : {}
|
|
// ...
|
|
//=============================================================================================
|
|
public class CaliumStorageDoc : DynamoDbDocBase
|
|
{
|
|
public static string pk = "calium#storage";
|
|
|
|
private static string getPrefixOfPK() { return ""; }
|
|
private static string getPrefixOfSK() { return ""; }
|
|
|
|
public CaliumStorageDoc() : base(nameof(CaliumStorageDoc))
|
|
{
|
|
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
|
appendAttribWrapperAll();
|
|
}
|
|
|
|
private void appendAttribWrapperAll()
|
|
{
|
|
appendAttribWrapper(new AttribWrapper<CaliumStorageAttrib>());
|
|
}
|
|
|
|
protected override string onGetPrefixOfPK()
|
|
{
|
|
return getPrefixOfPK();
|
|
}
|
|
|
|
protected override string onMakePK()
|
|
{
|
|
return pk;
|
|
}
|
|
|
|
protected override string onMakeSK()
|
|
{
|
|
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
|
}
|
|
} |