초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,42 @@

using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace BrokerCore.Entity;
public static class EntityHelper
{
public static async Task<(Result, TDoc?)> findDocByPk<TDoc>(string pk, EntityBase owner, DynamoDbClient dynamoDbClient)
where TDoc : DynamoDbDocBase, new()
{
ArgumentNullException.ThrowIfNull(owner, $"owner is null !!!");
var (result, user_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<TDoc>(pk);
if (result.isFail())
{
return (result, null);
}
ArgumentNullException.ThrowIfNull(user_primary_key, $"user_primary_key is null !!! - {owner.toBasicString()}");
var query_config = dynamoDbClient.makeQueryConfigForReadByPKSK(user_primary_key.PK);
(result, var found_doc) =
await dynamoDbClient.simpleQueryDocTypeWithQueryOperationConfig<TDoc>(query_config, false);
if (result.isFail())
{
return (result, null);
}
return (result, found_doc);
}
}