초기커밋
This commit is contained in:
56
ServerCommon/Doc/UserBase/CaliumDoc.cs
Normal file
56
ServerCommon/Doc/UserBase/CaliumDoc.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
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>());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user