초기커밋
This commit is contained in:
76
ServerCommon/Doc/OwnerContents/BeaconShopProfileDoc.cs
Normal file
76
ServerCommon/Doc/OwnerContents/BeaconShopProfileDoc.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using BEACON_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class BeaconShopProfileAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("beacon_guid")]
|
||||
public BEACON_GUID BeaconGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("daily_register_count")]
|
||||
public Int32 DailyRegisterCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty("register_update_day")]
|
||||
public DateTime RegisterUpdateDay { get; set; } = new();
|
||||
|
||||
public BeaconShopProfileAttrib()
|
||||
: base(typeof(BeaconShopProfileAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "beacon_shop_profile#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : BeaconShopProfileDoc
|
||||
// Attrib : BeaconShopProfileAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class BeaconShopProfileDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "beacon_shop_profile#"; }
|
||||
|
||||
public BeaconShopProfileDoc()
|
||||
: base(typeof(BeaconShopProfileDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BeaconShopProfileDoc(string ownerGuid)
|
||||
: base(typeof(BeaconShopProfileDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopProfileException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BeaconShopProfileAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user