초기커밋
This commit is contained in:
130
ServerCommon/Doc/GameZone/FarmingEffectLocationInTargetDoc.cs
Normal file
130
ServerCommon/Doc/GameZone/FarmingEffectLocationInTargetDoc.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using WORLD_ID = System.UInt32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using USER_NICKNAME = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using ENTITY_UNIQUE_ID = System.String;
|
||||
using ANCHOR_META_GUID = System.String;
|
||||
using LOCATION_UNIQUE_ID = System.String;
|
||||
using NPC_UNIQUE_ID = System.String;
|
||||
using FARMING_ENTITY_GUID = System.String;
|
||||
using FARMING_EFFECT_DOC_LINK_PKSK = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class FarmingEffectLocationInTargetAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("location_unique_id")] //[PK 참조]
|
||||
public LOCATION_UNIQUE_ID LocationUniqueId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("anchor_meta_guid")]
|
||||
public ANCHOR_META_GUID AnchorMetaGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_user_nickname")]
|
||||
public USER_NICKNAME UserNickname { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("farming_effect_doc_link_pk_sk")]
|
||||
public FARMING_EFFECT_DOC_LINK_PKSK FarmingEffectDocLinkPKSK { get; set; } = string.Empty;
|
||||
|
||||
public FarmingEffectLocationInTargetAttrib()
|
||||
: base(typeof(FarmingEffectLocationInTargetAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "farming_effect_location#{LOCATION_UNIQUE_ID}" [LOCATION_UNIQUE_ID.InstanceNumber: ChannelNo, RoomId]
|
||||
// SK(Sort Key) : "FARMING_EFFECT_DOC_LINK_PKSK"
|
||||
// DocType : "FarmingEffectLocationInTargetDoc"
|
||||
// FarmingLocationInTargetAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class FarmingEffectLocationInTargetDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getDocTypeName() { return typeof(FarmingEffectLocationInTargetDoc).Name; }
|
||||
private string getPrefixOfPK() { return $"farming_effect_location#"; }
|
||||
private string getPrefixOfSK() { return ""; }
|
||||
|
||||
public FarmingEffectLocationInTargetDoc()
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public FarmingEffectLocationInTargetDoc(LOCATION_UNIQUE_ID locationUniqueId, FARMING_EFFECT_DOC_LINK_PKSK farmingEffectDocLinkPKSK = "")
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(locationUniqueId);
|
||||
setCombinationKeyForSK(farmingEffectDocLinkPKSK);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public FarmingEffectLocationInTargetDoc( LOCATION_UNIQUE_ID locationUniqueId
|
||||
, ANCHOR_META_GUID anchorMetaGuid, USER_GUID userGuid, USER_NICKNAME userNickname
|
||||
, FARMING_EFFECT_DOC_LINK_PKSK farmingEffectDocLinkPKSK )
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(locationUniqueId);
|
||||
setCombinationKeyForSK(farmingEffectDocLinkPKSK);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var farming_effect_location_in_target_attrib = getAttrib<FarmingEffectLocationInTargetAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(farming_effect_location_in_target_attrib, () => $"farming_effect_location_in_target_attrib is null !!!");
|
||||
|
||||
farming_effect_location_in_target_attrib.LocationUniqueId = locationUniqueId;
|
||||
farming_effect_location_in_target_attrib.AnchorMetaGuid = anchorMetaGuid;
|
||||
farming_effect_location_in_target_attrib.UserGuid = userGuid;
|
||||
farming_effect_location_in_target_attrib.UserNickname = userNickname;
|
||||
farming_effect_location_in_target_attrib.FarmingEffectDocLinkPKSK = farmingEffectDocLinkPKSK;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<FarmingEffectLocationInTargetAttrib>());
|
||||
}
|
||||
|
||||
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