56 lines
1.5 KiB
C#
56 lines
1.5 KiB
C#
using Newtonsoft.Json;
|
|
|
|
|
|
using ServerCore;
|
|
using ServerBase;
|
|
|
|
using USER_GUID = System.String;
|
|
|
|
namespace ServerCommon;
|
|
|
|
public class CaliumAttrib : AttribBase
|
|
{
|
|
[JsonProperty("daily_calium")]
|
|
[JsonConverter(typeof(StringToDoubleEpsilonRoundConverter))]
|
|
public double DailyCalium { get; set; } = 0.0;
|
|
|
|
[JsonProperty("provided_date")]
|
|
public DateTime ProvidedDate { get; set; } = DateTimeHelper.MinTime;
|
|
|
|
public CaliumAttrib() : base(nameof(CaliumAttrib), false) {}
|
|
}
|
|
|
|
//=============================================================================================
|
|
// PK(Partition Key) : "calium#user_guid"
|
|
// SK(Sort Key) : ""
|
|
// DocType : CaliumDoc
|
|
// CaliumAttrib : {}
|
|
// ...
|
|
//=============================================================================================
|
|
public class CaliumDoc : DynamoDbDocBase
|
|
{
|
|
private static string getPrefixOfPK() { return "calium#"; }
|
|
private static string getPrefixOfSK() { return ""; }
|
|
|
|
public CaliumDoc() : base(nameof(CaliumDoc))
|
|
{
|
|
appendAttribWrapperAll();
|
|
}
|
|
|
|
public CaliumDoc(USER_GUID userGuid) : base(nameof(CaliumDoc))
|
|
{
|
|
setCombinationKeyForPK(userGuid);
|
|
appendAttribWrapperAll();
|
|
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
|
}
|
|
|
|
protected override string onGetPrefixOfPK()
|
|
{
|
|
return getPrefixOfPK();
|
|
}
|
|
|
|
private void appendAttribWrapperAll()
|
|
{
|
|
appendAttribWrapper(new AttribWrapper<CaliumAttrib>());
|
|
}
|
|
} |