102 lines
3.0 KiB
C#
102 lines
3.0 KiB
C#
using Google.Protobuf.WellKnownTypes;
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using ServerCore;
|
|
using ServerBase;
|
|
|
|
|
|
using BEACON_GUID = System.String;
|
|
using META_ID = System.UInt32;
|
|
using USER_GUID = System.String;
|
|
|
|
|
|
namespace ServerCommon;
|
|
|
|
public class BeaconShopSoldPriceAttrib : AttribBase
|
|
{
|
|
[JsonProperty("user_guid")]
|
|
public USER_GUID UserGuid { get; set; } = string.Empty;
|
|
|
|
[JsonProperty("beacon_guid")]
|
|
public BEACON_GUID BeaconGuid { get; set; } = string.Empty;
|
|
|
|
[JsonProperty("given_price")]
|
|
public double GivenPrice { get; set; } = 0;
|
|
|
|
[JsonProperty("tax_price")]
|
|
public double TaxPrice { get; set; } = 0;
|
|
|
|
[JsonProperty("num_of_receipt_not_received")]
|
|
public int NumOfReceiptNotReceived { get; set; } = 0;
|
|
|
|
public BeaconShopSoldPriceAttrib()
|
|
: base(typeof(BeaconShopSoldPriceAttrib).Name, false)
|
|
{ }
|
|
}
|
|
|
|
// 해당 doc은 타유저가 insert 해당 유저가 조회 및 삭제
|
|
//=============================================================================================
|
|
// PK(Partition Key) : "beacon_shop_sold_price#user_guid"
|
|
// SK(Sort Key) : "beacon_guid"
|
|
// DocType : BeaconShopSoldPriceDoc
|
|
// Attrib : BeaconShopSoldPriceAttrib
|
|
// ...
|
|
//=============================================================================================
|
|
public class BeaconShopSoldPriceDoc : DynamoDbDocBase
|
|
{
|
|
private static string getPrefixOfPK() { return "beacon_shop_sold_price#"; }
|
|
private static string getPrefixOfSK() { return ""; }
|
|
|
|
public BeaconShopSoldPriceDoc()
|
|
: base(typeof(BeaconShopSoldPriceDoc).Name)
|
|
{
|
|
appendAttribWrapperAll();
|
|
}
|
|
|
|
public BeaconShopSoldPriceDoc(string userGuid)
|
|
: base(typeof(BeaconShopSoldPriceDoc).Name)
|
|
{
|
|
setCombinationKeyForPK(userGuid);
|
|
|
|
appendAttribWrapperAll();
|
|
|
|
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
|
|
|
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopSoldPriceException));
|
|
}
|
|
|
|
public BeaconShopSoldPriceDoc(string userGuid, string beaconGuid)
|
|
: base(typeof(BeaconShopSoldPriceDoc).Name)
|
|
{
|
|
setCombinationKeyForPKSK(userGuid, beaconGuid);
|
|
|
|
appendAttribWrapperAll();
|
|
|
|
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
|
|
|
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopSoldPriceException));
|
|
}
|
|
|
|
private void appendAttribWrapperAll()
|
|
{
|
|
appendAttribWrapper(new AttribWrapper<BeaconShopSoldPriceAttrib>());
|
|
}
|
|
|
|
protected override string onGetPrefixOfPK()
|
|
{
|
|
return getPrefixOfPK();
|
|
}
|
|
protected override string onGetPrefixOfSK()
|
|
{
|
|
return getPrefixOfSK();
|
|
}
|
|
|
|
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
|
{
|
|
getPrimaryKey().fillUpSK(sortKey);
|
|
setCombinationKeyForSK(sortKey);
|
|
return ServerErrorCode.Success;
|
|
}
|
|
}
|