250501 커밋

This commit is contained in:
2025-05-01 07:23:28 +09:00
parent 98bb2e3c5c
commit 23176551b7
353 changed files with 9972 additions and 6652 deletions

View File

@@ -1,123 +1,7 @@
using PlatformTest.DbQuery;
using ServerCommon;

using ServerCore; using ServerBase;
using USER_GUID = System.String;
// public class DBQUserTest : QueryExecutorBase
// {
// private string m_combination_key_for_pk = string.Empty;
// private string m_combination_key_for_sk = string.Empty;
// private UserTestEntity? m_user_test;
// private DynamoDbClient m_dynamoDbClient;
//
// public DBQUserTest(string combinationKeyForPK, string combinationKeyForSK, DynamoDbClient dynamoDbClient)
// : base(nameof(DBQUserTest))
// {
// m_combination_key_for_pk = combinationKeyForPK;
// m_combination_key_for_sk = combinationKeyForSK;
// m_dynamoDbClient = dynamoDbClient;
// }
//
// //===================================================================================================
// // DB 쿼리 직전에 준비해야 할 로직들을 작성한다.
// //===================================================================================================
// public override async Task<Result> onPrepareQuery()
// {
// var result = new Result();
//
// var user_test = getOwner();
// NullReferenceCheckHelper.throwIfNull(user_test, () => "user is null !!!");
//
// var query_batch = getQueryBatch();
// NullReferenceCheckHelper.throwIfNull(query_batch,
// () => $"query_batch is null !!! - {user_test.toBasicString()}");
//
// var db_connector = query_batch.getDynamoDbConnector();
// NullReferenceCheckHelper.throwIfNull(db_connector,
// () => $"db_connector is null !!! - {user_test.toBasicString()}");
//
// await DynamoDBDocBaseHelper.makePrimaryKey<UserTestDoc>(m_combination_key_for_pk, m_combination_key_for_sk);
//
// // var ctxs = new List<DynamoDbDocumentQueryContext>();
// //
// // (result, var user_doc) = await m_user_test.onCopyToDocument();
//
//
// return Task.FromResult(result);
// }
//
// //===================================================================================================
// // onPrepareQuery()를 성공할 경우 호출된다.
// //===================================================================================================
// public override async Task<Result> onQuery()
// {
// var result = new Result();
// var err_msg = string.Empty;
//
// var user = getOwner();
// NullReferenceCheckHelper.throwIfNull(user, () => "user is null !!!");
//
// var query_batch = getQueryBatch();
// NullReferenceCheckHelper.throwIfNull(query_batch, () => $"query_batch is null !!! - {user.toBasicString()}");
//
// var db_connector = query_batch.getDynamoDbConnector();
//
// var user_doc = new UserTestDoc(m_combination_key_for_pk, m_combination_key_for_sk);
// var user_test_base = new UserTestEntity(EntityType.None);
// var user_test_base_attrib = user_test_base.getEntityAttribute<UserTestEntityAttribute>();
// NullReferenceCheckHelper.throwIfNull(user_test_base_attrib, () => $"user_test_base_attrib is null !!!");
//
// user_test_base_attrib.UserId = m_combination_key_for_pk;
// user_test_base_attrib.Name = m_combination_key_for_sk;
//
// var user_test_base_action = user_test_base.getEntityAction<UserTestInsertAction>();
// NullReferenceCheckHelper.throwIfNull(user_test_base_action, () => $"user_test_base_action is null !!!");
//
// result = await user_test_base_action.tryInsertUser(m_combination_key_for_pk, m_combination_key_for_sk);
// if (result.isFail())
// {
// return result;
// }
//
// var query_context = new DynamoDbDocumentQueryContext(user_doc, QueryType.Insert);
// await query_batch.addQuery(new QueryExecutorBase("InsertUser")
// {
// onPrepareQuery = () => Task.FromResult(new Result()),
// onQuery = () => Task.FromResult(new Result()),
// onQueryResponseCommit = () => Task.CompletedTask,
// onQueryResponseRollback = (errorResult) => Task.CompletedTask
// });
//
// var result = await QueryHelper.sendQueryAndBusinessLog(query_batch);
// if (result.isFail())
// {
// return result;
// }
//
// return result;
// }
//
// //===================================================================================================
// // DB 쿼리를 성공하고, doFnCommit()가 QueryResultType.NotCalledQueryFunc를 반환할 경우 호출된다.
// //===================================================================================================
// public override Task onQueryResponseCommit()
// {
// return Task.CompletedTask;
// }
//
// //===================================================================================================
// // DB 쿼리를 실패하고, doFnRollback()가 QueryResultType.NotCalledQueryFunc를 반환할 경우 호출된다.
// //===================================================================================================
// public override Task onQueryResponseRollback(Result errorResult)
// {
// return Task.CompletedTask;
// }
// }
namespace BrokerTest;
public class UserTestActorLog : ILogActor
{
}

View File

@@ -1,4 +1,3 @@
namespace PlatformTest.DbQuery;
using System.Threading.Tasks;
@@ -13,6 +12,7 @@ using ServerBase;
using ServerCommon;
namespace BrokerTest;
public class DynamoDbClientTests
{
private ServerConfig? m_config;

View File

@@ -1,12 +1,7 @@
namespace PlatformTest.DbQuery;
using Amazon;
using Amazon.DynamoDBv2;
using ServerCommon;
using ServerCore; using ServerBase;
using ServerCore;
using ServerBase;
namespace BrokerTest;
public class EntityBaseTests
{
private readonly DynamoDbClient m_dynamo_db_client;

View File

@@ -3,6 +3,7 @@
using ServerBase;
using ServerCommon;
namespace BrokerTest;
public class UserTestAttrib : AttribBase
{
[JsonProperty("user_id")]

View File

@@ -1,11 +1,10 @@
namespace PlatformTest.DbQuery;

using Microsoft.AspNetCore.Identity;
using ServerCommon;
using ServerCore; using ServerBase;
namespace BrokerTest;
public class UserTestDeleteOneAction : EntityActionBase
{
public UserTestDeleteOneAction(EntityBase owner) : base(owner)

View File

@@ -1,9 +1,7 @@
using ServerCommon;
using ServerCore; using ServerBase;
// DynamoDbDocBase는 리파지토리로 이해하면 편할 듯
// AttribBase: db에 저장될 데이터
namespace BrokerTest;
public sealed class UserTestDoc : DynamoDbDocBase
{
private const string m_prefix_of_pk = "user_test#";

View File

@@ -1,9 +1,7 @@
using PlatformTest.DbQuery;
using ServerCommon;
using ServerCore; using ServerBase;
using ServerCore;
using ServerBase;
namespace BrokerTest;
// EntityBase: EntityAttribute와 EntityAction을 관리하는 컨테이너
public class UserTestEntity : EntityBase, IWithLogActor
{

View File

@@ -4,6 +4,7 @@ using ServerCore; using ServerBase;
using ThirdParty.Json.LitJson;
namespace BrokerTest;
// EntityAttributeBase를 상속 받은 개체는 메모리에 사용될 내용임
// 스토리지에 저장은 UsrTestDoc:DynamoDbDocBase에서 처리함
public class UserTestEntityAttribute : EntityAttributeBase

View File

@@ -1,7 +1,10 @@
using ServerCommon;
using BrokerTest;
using ServerCommon;
using ServerCore; using ServerBase;
namespace BrokerTest;
public class UserTestFindOneAction : EntityActionBase
{
public UserTestFindOneAction(UserTestEntity owner) : base(owner)

View File

@@ -2,6 +2,7 @@
using ServerCore; using ServerBase;
namespace BrokerTest;
public class UserTestInsertAction : EntityActionBase
{
public UserTestInsertAction(EntityBase owner) : base(owner)

View File

@@ -1,4 +1,6 @@
using ServerCommon;
using BrokerTest;
using ServerCommon;
using ServerCore; using ServerBase;