초기커밋
This commit is contained in:
54
BrokerApiTest/BrokerApiTest.csproj
Normal file
54
BrokerApiTest/BrokerApiTest.csproj
Normal file
@@ -0,0 +1,54 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<RootNamespace>BrokerTest</RootNamespace>
|
||||
<OutputType>Library</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<NoWarn>1591</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<NoWarn>1591</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Xunit" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Config\**\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<!-- <Content Update="Config\ServerConfig-Local.json">-->
|
||||
<!-- <ExcludeFromSingleFile>true</ExcludeFromSingleFile>-->
|
||||
<!-- <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>-->
|
||||
<!-- </Content>-->
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="Moq" />
|
||||
<PackageReference Include="xunit" />
|
||||
<PackageReference Include="xunit.runner.visualstudio">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BrokerApiServer\BrokerApiServer.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
162
BrokerApiTest/Config/ServerConfig-Dev.json
Normal file
162
BrokerApiTest/Config/ServerConfig-Dev.json
Normal file
@@ -0,0 +1,162 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": true,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Dev",
|
||||
"StandaloneMode": true,
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 500,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
"SessionKeepAliveTimeSec": 3600,
|
||||
"MinWorkerThreadCount": 100,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
|
||||
"Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
|
||||
|
||||
"Dynamodb": "http://localhost:8000",
|
||||
|
||||
"MongoDb": {
|
||||
"ConnectionString": "mongodb://devmetaversemongoconnect:dev#$943cali@localhost:27017",
|
||||
"DatabaseName": "Metaverse",
|
||||
"MinConnectionPoolSize": 0,
|
||||
"MaxConnectionPoolSize": 100,
|
||||
"WaitQueueTimeoutSecs": 120
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
"Enable": true,
|
||||
"LocalDynamoDB": false,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": false,
|
||||
"LogGroup": "MetaverseLog-Dev",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"server": "${event-properties:server}",
|
||||
"ip/port": "${event-properties:ip/port}",
|
||||
"threadId": "${threadid}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Dev",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-test",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": false,
|
||||
"PlatformTypeAllows": ""
|
||||
},
|
||||
|
||||
"LoadBalancingRule": {
|
||||
"AuthToGameRule": {
|
||||
"Rule": "WeightedRoundRobin",
|
||||
"MinRate": 0,
|
||||
"MaxRate": 100,
|
||||
"UserLanguageBased": true
|
||||
}
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": { "Ko": "https://caliverse.io/shop" } },
|
||||
{ "ChatAiApiServerUrl": { "Ko": "https://ai-dev-api.caliverse.io" } },
|
||||
{ "S3ResourceImageUrl": { "Ko": "https://d3s9natejb9ydz.cloudfront.net/Dev" } }
|
||||
],
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": false,
|
||||
"CPNftForOwnerAllGetUrl": "https://dev-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-dev-rollup-admin-api.caliverse.io",
|
||||
"SlackAddress": "https://hooks.slack.com/services/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"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://ai-dev-api.caliverse.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://dev-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "https://dev-ugqapi.caliverse.io:11000",
|
||||
//"ApiServerAddress": "http://localhost:1000",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "localhost",
|
||||
"Port": 5672,
|
||||
"UserName": "admin",
|
||||
"Password": "admin",
|
||||
"SSL": false
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 1200000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 3600000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": false,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable": true,
|
||||
|
||||
"MetaverseBroker": {
|
||||
"JwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
"ExpireMinutes": 1440,
|
||||
"SsoAccountDb": "Server=dev-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"MetaverseBrokerDb": "Server=metaverse-broker-dev.cdn6gxjy33pu.us-west-2.rds.amazonaws.com;Port=3306;User ID=broker_user;Password=Apxkqjtmqmfhzj;Database=metaverse-broker",
|
||||
"MetaverseBrokerDbLocal": "Server=localhost;Port=3307;User ID=broker_user;Password=qmfhzjdbwj;Database=metaverse-broker"
|
||||
}
|
||||
}
|
||||
|
||||
150
BrokerApiTest/Config/ServerConfig-QA.json
Normal file
150
BrokerApiTest/Config/ServerConfig-QA.json
Normal file
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": false,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Qa",
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 600,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
|
||||
"SessionKeepAliveTimeSec": 3600,
|
||||
"MinWorkerThreadCount": 200,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=qa-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=k0RantM9gOAg5ATecBTFXzbCYDnvXi;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=qa-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=k0RantM9gOAg5ATecBTFXzbCYDnvXi;Database=caliverse",
|
||||
|
||||
"Redis": "clustercfg.metaverse-qa-cluster.ocif0u.usw2.cache.amazonaws.com:6379,password=wiUaVvNwX4PhBj&8,ssl=true,abortConnect=false",
|
||||
"Dynamodb": "",
|
||||
|
||||
"MongoDb": {
|
||||
"ConnectionString": "mongodb://qrwugqmongoconnect:qrw#$943cali@ip-172-40-141-201.us-west-2.compute.internal:27017/Metaverse",
|
||||
"DatabaseName": "Metaverse",
|
||||
"MinConnectionPoolSize": 0,
|
||||
"MaxConnectionPoolSize": 100,
|
||||
"WaitQueueTimeoutSecs": 120
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
"Enable": true,
|
||||
"LocalDynamoDB": false,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": true,
|
||||
"LogGroup": "MetaverseLog-QA",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"server": "${event-properties:server}",
|
||||
"ip/port": "${event-properties:ip/port}",
|
||||
"threadId": "${threadid}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Qa",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-qa",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": true,
|
||||
"PlatformTypeAllows": "WindowsPc"
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": { "Ko": "https://qa.caliverse.io/shop" } },
|
||||
{ "ChatAiApiServerUrl": { "Ko": "https://ai-qa-api.caliverse.io" } },
|
||||
{ "S3ResourceImageUrl": { "Ko": "https://d3s9natejb9ydz.cloudfront.net/QA" } }
|
||||
],
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": true,
|
||||
"CPNftForOwnerAllGetUrl": "https://qa-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://ai-qa-api.caliverse.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-qa-rollup-admin-api.caliverse.io",
|
||||
"SlackAddress": "https://hooks.slack.com/services/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"
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://qa-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "http://internal-Metaverse-QA-UGQAPI-Game-1559632298.us-west-2.elb.amazonaws.com:11201",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "b-d7c76a76-156d-4d55-8614-d4ce122a47c3.mq.us-west-2.amazonaws.com",
|
||||
"Port": 5671,
|
||||
"UserName": "serveruser",
|
||||
"Password": "Zkfflqjtm!33&*(",
|
||||
"SSL": true
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 120000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 300000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": true,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable": true,
|
||||
|
||||
"MetaverseBroker": {
|
||||
"JwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
"ExpireMinutes": 1440,
|
||||
"SsoAccountDb": "Server=qa-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=k0RantM9gOAg5ATecBTFXzbCYDnvXi;Database=caliverse",
|
||||
"MetaverseBrokerDb": "Server=metaverse-broker-qa.cdn6gxjy33pu.us-west-2.rds.amazonaws.com;Port=3306;User ID=broker_user;Password=06M67cKVhHDpVipisA2g;Database=metaverse-broker",
|
||||
"MetaverseBrokerDbLocal": "Server=localhost;Port=3307;User ID=root;Password=root;Database=metaverse-broker"
|
||||
}
|
||||
}
|
||||
|
||||
151
BrokerApiTest/Config/ServerConfig-Stage.json
Normal file
151
BrokerApiTest/Config/ServerConfig-Stage.json
Normal file
@@ -0,0 +1,151 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": false,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Stage",
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 600,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
|
||||
"SessionKeepAliveTimeSec": 600,
|
||||
"MinWorkerThreadCount": 200,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=stage-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=caliverse;Password=XjEDXb8fi9ZXP5PaxDCxPWeXK03mzk;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=stage-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=caliverse;Password=XjEDXb8fi9ZXP5PaxDCxPWeXK03mzk;Database=caliverse",
|
||||
|
||||
"Redis": "clustercfg.metaverse-stage-cluster.ocif0u.usw2.cache.amazonaws.com:6379,password=wiUaVvNwX4PhBj&8,ssl=true,abortConnect=false",
|
||||
"Dynamodb": "",
|
||||
|
||||
"MongoDb": {
|
||||
"ConnectionString": "mongodb+srv://stageugqapirw:uY3xQzVURk59S7Vu@stage-ugqapi.7d0do.mongodb.net/?retryWrites=true&w=majority&appName=stage-ugqapi",
|
||||
"DatabaseName": "Metaverse",
|
||||
"MinConnectionPoolSize": 0,
|
||||
"MaxConnectionPoolSize": 100,
|
||||
"WaitQueueTimeoutSecs": 120
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
"Enable": true,
|
||||
"LocalDynamoDB": false,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": true,
|
||||
"LogGroup": "MetaverseLog-Stage",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"server": "${event-properties:server}",
|
||||
"ip/port": "${event-properties:ip/port}",
|
||||
"threadId": "${threadid}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Stage",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-stage",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": true,
|
||||
"PlatformTypeAllows": "WindowsPc"
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": { "Ko": "https://stage.caliverse.io/shop" } },
|
||||
{ "ChatAiApiServerUrl": { "Ko": "https://ai-stage-api.caliverse.io" } },
|
||||
{ "S3ResourceImageUrl": { "Ko": "https://d3s9natejb9ydz.cloudfront.net/Stage" } }
|
||||
],
|
||||
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": true,
|
||||
"CPNftForOwnerAllGetUrl": "https://stage-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://ai-stage-api.caliverse.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-stage-rollup-admin-api.caliverse.io",
|
||||
"SlackAddress": "https://hooks.slack.com/services/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"
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://stage-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "http://internal-Metaverse-Stage-UGQAPI-Game-88775700.us-west-2.elb.amazonaws.com:11201",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "b-d0e44de3-7fb3-4120-b851-4566002eaf8e.mq.us-west-2.amazonaws.com",
|
||||
"Port": 5671,
|
||||
"UserName": "serveruser",
|
||||
"Password": "Zkfflqjtm!33&*(",
|
||||
"SSL": true
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 120000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 300000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": true,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable": true,
|
||||
|
||||
"MetaverseBroker": {
|
||||
"JwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
"ExpireMinutes": 1440,
|
||||
"SsoAccountDb": "Server=stage-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=caliverse;Password=XjEDXb8fi9ZXP5PaxDCxPWeXK03mzk;Database=caliverse",
|
||||
"MetaverseBrokerDb": "Server=metaverse-broker-stage.cdn6gxjy33pu.us-west-2.rds.amazonaws.com;Port=3306;User ID=broker_user;Password=WkH44p4KiUDVzk5aPfANGtpCu6;Database=metaverse-broker",
|
||||
"MetaverseBrokerDbLocal": "Server=localhost;Port=3307;User ID=root;Password=root;Database=metaverse-broker"
|
||||
}
|
||||
}
|
||||
|
||||
216
BrokerApiTest/Config/ServerConfig.json
Normal file
216
BrokerApiTest/Config/ServerConfig.json
Normal file
@@ -0,0 +1,216 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": true,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Dev",
|
||||
"StandaloneMode": true,
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 500,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
"SessionKeepAliveTimeSec": 3600,
|
||||
"MinWorkerThreadCount": 100,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
|
||||
"Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
|
||||
|
||||
"Dynamodb": "http://localhost:8000",
|
||||
|
||||
"AWS": {
|
||||
"Enable": false,
|
||||
"LocalDynamoDB": false,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": false,
|
||||
"LogGroup": "MetaverseLog-Dev",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"player": "${event-properties:player}",
|
||||
"properties": "{event-properties:properties}",
|
||||
"threadId": "${threadid}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}",
|
||||
"server": "${event-properties:server}",
|
||||
"ipport": "${event-properties:ipport}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Dev",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-test",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": false,
|
||||
"PlatformTypeAllows": ""
|
||||
},
|
||||
|
||||
"LoadBalancingRule": {
|
||||
"AuthToGameRule": {
|
||||
"Rule": "WeightedRoundRobin",
|
||||
"MinRate": 0,
|
||||
"MaxRate": 100,
|
||||
"UserLanguageBased": true
|
||||
}
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": "https://caliverse.io/shop" },
|
||||
{ "ChatAiApiServerUrl": "https://ai-dev-api.caliverse.io" },
|
||||
{ "S3ResourceImageUrl": "https://d3s9natejb9ydz.cloudfront.net/Dev" },
|
||||
{
|
||||
"RentalGuideURL": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/land/land-rental",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/land/land-rental",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/land/land-rental"
|
||||
}
|
||||
},
|
||||
{
|
||||
"LandAuctionWebGuide": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/land/land-rental",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/land/land-rental",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/land/land-rental"
|
||||
}
|
||||
},
|
||||
{
|
||||
"LandManageGuideURL": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/land/land-management",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/land/land-management",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/land/land-management"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Calium_Exchange_Web1": {
|
||||
"ko": "https://calidocu.gitbook.io/calium-eco-system/calium-inflation-system-and-its-principles",
|
||||
"en": "https://calidocu.gitbook.io/calium-eco-system/en/calium-inflation-system-and-its-principles",
|
||||
"jp": "https://calidocu.gitbook.io/calium-eco-system/jp/calium-inflation-system-and-its-principles"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Calium_Exchange_Web2": {
|
||||
"ko": "https://calium.caliverse.io/onchain",
|
||||
"en": "https://calium.caliverse.io/onchain",
|
||||
"jp": "https://calium.caliverse.io/onchain"
|
||||
}
|
||||
},
|
||||
{
|
||||
"MyhomeEditGuideUrl": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/caliverse-feature-guide/interior",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/caliverse-feature-guide/interior",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/caliverse-feature-guide/interior"
|
||||
}
|
||||
},
|
||||
{
|
||||
"WebLinkUrlSeasonPass": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/pass-and-claim/season-pass",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/pass-and-claim/season-pass",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/pass-and-claim/season-pass"
|
||||
}
|
||||
},
|
||||
{
|
||||
"WebLinkURLCurrency": {
|
||||
"ko": "https://caliverse.io/shop",
|
||||
"en": "https://caliverse.io/en/shop",
|
||||
"jp": "https://caliverse.io/en/shop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CaliumConverterWebGuide": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/calium/calium-converter",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/calium/calium-converter",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/calium/calium-converter"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": false,
|
||||
"CPNftForOwnerAllGetUrl": "https://dev-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-dev-rollup-admin-api.caliverse.io"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://ai-dev-api.caliverse.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://dev-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "https://dev-ugqapi.caliverse.io:11000",
|
||||
//"ApiServerAddress": "http://localhost:1000",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "localhost",
|
||||
"Port": 5672,
|
||||
"UserName": "admin",
|
||||
"Password": "admin",
|
||||
"SSL": false
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 1200000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 3600000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": false,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable" : true,
|
||||
|
||||
"MetaverseBroker": {
|
||||
"JwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
"ExpireMinutes": 1440,
|
||||
"SsoAccountDb": "Server=dev-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"MetaverseBrokerDb": "Server=metaverse-broker-dev.cdn6gxjy33pu.us-west-2.rds.amazonaws.com;Port=3306;User ID=caliverse;Password=Apxkqjtmqmfhzj;Database=metaverse-broker",
|
||||
"MetaverseBrokerDbLocal": "Server=localhost;Port=3307;User ID=broker;Password=broker;Database=metaverse-broker"
|
||||
}
|
||||
}
|
||||
95
BrokerApiTest/Config/nlog.config
Normal file
95
BrokerApiTest/Config/nlog.config
Normal file
@@ -0,0 +1,95 @@
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
throwConfigExceptions="true"
|
||||
autoReload="true"
|
||||
internalLogLevel="Error"
|
||||
internalLogToConsole="true">
|
||||
|
||||
<extensions>
|
||||
<add assembly="NLog.AWS.Logger" />
|
||||
</extensions>
|
||||
|
||||
<targets async="true">
|
||||
<!--
|
||||
<target name="logconsole" xsi:type="Console"
|
||||
layout="${longdate:universalTime=true} ${level} [${threadid}] [${event-properties:memberName}] ${message}" />
|
||||
-->
|
||||
<target name="logfile" xsi:type="File"
|
||||
fileName="${basedir}/logs/${ProcessName}.log"
|
||||
archiveFileName="${basedir}/logs/${ProcessName}_{###}.log"
|
||||
archiveAboveSize="10240000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveDays= "2"
|
||||
maxArchiveFiles= "5"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm"
|
||||
layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}|${level:uppercase=true}|${threadid}|${message}|${event-properties:memberName}|${event-properties:filePath}:${event-properties:lineNumber}"/>
|
||||
|
||||
<target name="businessLogFile" xsi:type="File"
|
||||
fileName="${basedir}/logs/Business_${ProcessName}.json"
|
||||
archiveFileName="${basedir}/logs/archive/business/Business_${ProcessName}_{###}.json"
|
||||
archiveAboveSize="1024000000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveDays= "4"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm">
|
||||
<layout xsi:type="JsonLayout" includeEventProperties="true" excludeProperties="Comma-separated list (string)">
|
||||
<attribute name="logTime" layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}" />
|
||||
<attribute name="level" layout="${level:upperCase=true}"/>
|
||||
<attribute name="message" layout="${message}" />
|
||||
</layout>
|
||||
</target>
|
||||
|
||||
<target name="developLogFile" xsi:type="File"
|
||||
fileName="${basedir}/logs/${ProcessName}.json"
|
||||
archiveFileName="${basedir}/logs/archive/develop/${ProcessName}_{###}.json"
|
||||
archiveAboveSize="1024000000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveDays= "2"
|
||||
maxArchiveFiles= "5"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm">
|
||||
<layout xsi:type="JsonLayout" includeEventProperties="true" excludeProperties="Comma-separated list (string)">
|
||||
<attribute name="logTime" layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}" />
|
||||
<attribute name="threadid" layout="${threadid}" />
|
||||
<attribute name="level" layout="${level:upperCase=true}"/>
|
||||
<attribute name="message" layout="${message}" />
|
||||
</layout>
|
||||
</target>
|
||||
|
||||
<target name="logconsole" xsi:type="ColoredConsole"
|
||||
layout="${longdate:universalTime=true}|${level:uppercase=true}|${threadid}|${message}|${event-properties:filePath}:${event-properties:lineNumber}">
|
||||
<highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" />
|
||||
<highlight-row condition="level == LogLevel.Info" foregroundColor="DarkGray" />
|
||||
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
|
||||
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
|
||||
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" />
|
||||
</target>
|
||||
|
||||
<target name="logSeqFile" xsi:type="File"
|
||||
fileName="${basedir}/../../bin/LogSequence/${ProcessName}.log"
|
||||
archiveFileName="${basedir}/../../bin/LogSequence/${ProcessName}_{#}.Sequence.bak"
|
||||
archiveAboveSize="10240000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveFiles= "1000"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd"
|
||||
layout="${ticks},${event-properties:sender},${event-properties:receiver},${message}:${event-properties:errordesc}"/>
|
||||
|
||||
</targets>
|
||||
<rules>
|
||||
<logger name="Developer" minlevel="Info" writeTo="logconsole"/>
|
||||
<logger name="Developer" minlevel="Debug" writeTo="developLogFile"/>
|
||||
<logger name="BusinessLogger" minlevel="Info" writeTo="businessLogFile"/>
|
||||
<!-->logger name="*" minlevel="Error" writeTo="logfile"/-->
|
||||
<logger name="SequenceLogger" minlevel="Debug" writeTo="logSeqFile"/>
|
||||
</rules>
|
||||
</nlog>
|
||||
163
BrokerApiTest/ControllerTests/AccontControllerTests.cs
Normal file
163
BrokerApiTest/ControllerTests/AccontControllerTests.cs
Normal file
@@ -0,0 +1,163 @@
|
||||
namespace BrokerTest.Controllers;
|
||||
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text.Json;
|
||||
|
||||
using BrokerCore.ApiModels;
|
||||
using Helper;
|
||||
using Xunit;
|
||||
|
||||
public class AccountControllerTests
|
||||
{
|
||||
private readonly BrokerTestServer m_server = new BrokerTestServer();
|
||||
|
||||
[Fact]
|
||||
public async Task initializeAsync()
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Login_ValidRequest_ReturnsOkWithLoginResponse()
|
||||
{
|
||||
// Arrange
|
||||
const string validToken = "valid_web_portal_token";
|
||||
const string userGuid = "test_user_guid";
|
||||
const string nickname = "test_nickname";
|
||||
|
||||
var client = m_server.getTestClient();
|
||||
Assert.NotNull(client);
|
||||
var request = new LoginRequest { WebPortalToken = validToken };
|
||||
// Act
|
||||
var response = await client.PostAsJsonAsync("/api/v1/account/login", request);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
|
||||
// ReadFromJsonAsync 사용 시, 올바른 options 주입
|
||||
var login_response = await response.Content.ReadFromJsonAsync<LoginResponse>();
|
||||
|
||||
Assert.NotNull(login_response);
|
||||
Assert.Equal(userGuid, login_response.UserGuid);
|
||||
Assert.Equal(nickname, login_response.Nickname);
|
||||
|
||||
// mockUserAuthService.Verify(m => m.authByWebPortalToken(validToken), Times.Once); //정확히 한번 호출되었는지 확인
|
||||
// mockUserAuthService.VerifyGet(x=>x.UserGuid, Times.AtLeastOnce); //최소 한번 호출되었는지 확인
|
||||
// mockUserAuthService.VerifyGet(x=>x.Nickname, Times.AtLeastOnce);
|
||||
}
|
||||
|
||||
// [Fact]
|
||||
// public async Task Login_InvalidRequest_EmptyToken_ReturnsBadRequest()
|
||||
// {
|
||||
// // Arrange
|
||||
// var client = _factory.CreateClient();
|
||||
// var request = new LoginRequest { WebPortalToken = "" }; // Empty token
|
||||
//
|
||||
// // Act
|
||||
// var response = await client.PostAsJsonAsync("/api/v1/account/login", request);
|
||||
//
|
||||
// // Assert
|
||||
// Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
//
|
||||
// //응답 내용 확인 (선택)
|
||||
// var errorResponse = await response.Content.ReadFromJsonAsync<ApiErrorResponse>(_jsonOptions);
|
||||
// Assert.NotNull(errorResponse);
|
||||
// Assert.Equal((int)ServerErrorCode.InvalidRequest, errorResponse.Code);
|
||||
// Assert.Contains("WebPortalToken does not exist", errorResponse.Message);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// [Fact]
|
||||
// public async Task Login_InvalidRequest_NullToken_ReturnsBadRequest()
|
||||
// {
|
||||
// // Arrange
|
||||
// var client = _factory.CreateClient();
|
||||
// var request = new LoginRequest { WebPortalToken = null }; // null token
|
||||
//
|
||||
// // Act
|
||||
// var response = await client.PostAsJsonAsync("/api/v1/account/login", request);
|
||||
//
|
||||
//
|
||||
// // Assert
|
||||
// Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
//
|
||||
// //응답 내용 확인 (선택)
|
||||
// var errorResponse = await response.Content.ReadFromJsonAsync<ApiErrorResponse>(_jsonOptions);
|
||||
// Assert.NotNull(errorResponse);
|
||||
// Assert.Equal((int)ServerErrorCode.InvalidRequest, errorResponse.Code);
|
||||
// Assert.Contains("WebPortalToken does not exist", errorResponse.Message);
|
||||
// }
|
||||
// [Fact]
|
||||
// public async Task Login_InvalidRequest_NullRequest_ReturnsBadRequest()
|
||||
// {
|
||||
// // Arrange
|
||||
// var client = _factory.CreateClient();
|
||||
// LoginRequest? request = null; // Null request
|
||||
//
|
||||
// // Act
|
||||
// var response = await client.PostAsJsonAsync("/api/v1/account/login", request);
|
||||
//
|
||||
// // Assert
|
||||
// Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
//
|
||||
// //응답 내용 확인 (선택)
|
||||
// var errorResponse = await response.Content.ReadFromJsonAsync<ApiErrorResponse>(_jsonOptions);
|
||||
// Assert.NotNull(errorResponse);
|
||||
// Assert.Equal((int)ServerErrorCode.InvalidRequest, errorResponse.Code);
|
||||
// Assert.Contains("Request is empty", errorResponse.Message);
|
||||
// }
|
||||
//
|
||||
// [Fact]
|
||||
// public async Task Login_AuthServiceReturnsFail_ReturnsBadRequest()
|
||||
// {
|
||||
// // Arrange
|
||||
// const string invalidToken = "invalid_token";
|
||||
//
|
||||
// // Mock UserAuthService
|
||||
// var mockUserAuthService = new Mock<UserAuthService>(MockBehavior.Strict, null, null,null,null,null);
|
||||
// mockUserAuthService.Setup(m => m.authByWebPortalToken(invalidToken))
|
||||
// .ReturnsAsync(Result.Fail(ServerErrorCode.InvalidToken, "Invalid token"));
|
||||
//
|
||||
//
|
||||
// var client = _factory.WithWebHostBuilder(builder =>
|
||||
// {
|
||||
// builder.ConfigureTestServices(services =>
|
||||
// {
|
||||
// services.AddScoped<UserAuthService>(_ => mockUserAuthService.Object);
|
||||
// });
|
||||
// }).CreateClient();
|
||||
//
|
||||
//
|
||||
// var request = new LoginRequest { WebPortalToken = invalidToken };
|
||||
//
|
||||
// // Act
|
||||
// var response = await client.PostAsJsonAsync("/api/v1/account/login", request);
|
||||
//
|
||||
// // Assert
|
||||
// Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
// var errorResponse = await response.Content.ReadFromJsonAsync<ApiErrorResponse>(_jsonOptions);
|
||||
// Assert.NotNull(errorResponse);
|
||||
// Assert.Equal((int)ServerErrorCode.InvalidToken, errorResponse.Code);
|
||||
// Assert.Equal("Invalid token", errorResponse.Message);
|
||||
//
|
||||
// mockUserAuthService.Verify(m=>m.authByWebPortalToken(invalidToken), Times.Once);
|
||||
// }
|
||||
//
|
||||
// [Fact]
|
||||
// public async Task Dummy_ValidRequest_ReturnsOk()
|
||||
// {
|
||||
// // Arrange
|
||||
// var client = _factory.CreateClient();
|
||||
// var request = new DummyRequest { Dummy = "test" };
|
||||
//
|
||||
// // Act
|
||||
// var response = await client.PostAsJsonAsync("/api/v1/account/dummy", request);
|
||||
//
|
||||
// // Assert
|
||||
// Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
// var dummyResponse = await response.Content.ReadFromJsonAsync<DummyResponse>();
|
||||
// Assert.NotNull(dummyResponse);
|
||||
// Assert.Equal("test", dummyResponse.Dummy);
|
||||
// }
|
||||
}
|
||||
99
BrokerApiTest/ControllerTests/CurrencyControllerTests.cs
Normal file
99
BrokerApiTest/ControllerTests/CurrencyControllerTests.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Net.Http.Json;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Json;
|
||||
|
||||
using BrokerCore.ApiModels;
|
||||
using BrokerCore.Common;
|
||||
using BrokerCore.DbEntity;
|
||||
using BrokerCore.Services;
|
||||
|
||||
using BrokerTest.Helper;
|
||||
|
||||
namespace BrokerTest.Controllers;
|
||||
|
||||
public class CurrencyControllerTests
|
||||
{
|
||||
private readonly BrokerTestServer m_server = new BrokerTestServer();
|
||||
|
||||
[Fact]
|
||||
public async Task initializeAsync()
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private HttpClient getTestClient()
|
||||
{
|
||||
return m_server.getTestClient();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Auth_ValidRequest_ReturnsOkWithAccessToken()
|
||||
{
|
||||
// Arrange
|
||||
const string planet_id = "new_earth";
|
||||
const string planet_secret_key = "A8h$KmP3sWxZqL5vYnR7uTgBdEjHkMlQoT1wXzCv";
|
||||
var planet_token = string.Empty;
|
||||
var order_id = string.Empty;
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new PlanetAuthRequest { PlanetId = planet_id, PlanetSecretKey = planet_secret_key };
|
||||
|
||||
// Act
|
||||
var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
|
||||
// Assert
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<PlanetAuthResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
planet_token = response_body.AccessToken;
|
||||
}
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new ExchangeOrderRequest
|
||||
{
|
||||
UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", Sapphire = 10, Emerald = 10
|
||||
};
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/create", request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.OrderId);
|
||||
order_id = response_body.OrderId;
|
||||
// Assert
|
||||
}
|
||||
|
||||
//UserGuid:1052b08b52ef4d69a27ee1f40911a72f
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new ExchangeOrderListRequest
|
||||
{
|
||||
UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", Option = FindOption.All
|
||||
};
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/list", request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderListResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.Orders);
|
||||
// Assert
|
||||
}
|
||||
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request =
|
||||
new ExchangeOrderCompleteRequest { UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", OrderId = order_id };
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/complete", request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderCompleteResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.OrderId);
|
||||
Assert.Equal(order_id, response_body.OrderId);
|
||||
Assert.Equal(ExchangeOrderStatus.Completed, response_body.Status);
|
||||
// Assert
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
98
BrokerApiTest/ControllerTests/DevCurrencyControllerTests.cs
Normal file
98
BrokerApiTest/ControllerTests/DevCurrencyControllerTests.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Net.Http.Json;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Json;
|
||||
|
||||
using BrokerCore.ApiModels;
|
||||
using BrokerCore.Common;
|
||||
using BrokerCore.DbEntity;
|
||||
using BrokerCore.Services;
|
||||
|
||||
using BrokerTest.Helper;
|
||||
|
||||
namespace BrokerTest.Controllers;
|
||||
|
||||
public class DevCurrencyControllerTests
|
||||
{
|
||||
// private readonly BrokerTestServer m_server = new BrokerTestServer();
|
||||
|
||||
public HttpClient getTestClient()
|
||||
{
|
||||
return new HttpClient { BaseAddress = new Uri("https://dev.planethub.caliverse.io:12000") };
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task initializeAsync()
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Auth_ValidRequest_ReturnsOkWithAccessToken()
|
||||
{
|
||||
// Arrange
|
||||
const string planet_id = "new_earth";
|
||||
const string planet_secret_key = "A8h$KmP3sWxZqL5vYnR7uTgBdEjHkMlQoT1wXzCv";
|
||||
var planet_token = string.Empty;
|
||||
var order_id = string.Empty;
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new PlanetAuthRequest { PlanetId = planet_id, PlanetSecretKey = planet_secret_key };
|
||||
|
||||
// Act
|
||||
var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
|
||||
// Assert
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<PlanetAuthResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
planet_token = response_body.AccessToken;
|
||||
}
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new ExchangeOrderRequest
|
||||
{
|
||||
UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", Sapphire = 10, Emerald = 10
|
||||
};
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/create", request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.OrderId);
|
||||
order_id = response_body.OrderId;
|
||||
// Assert
|
||||
}
|
||||
|
||||
//UserGuid:1052b08b52ef4d69a27ee1f40911a72f
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new ExchangeOrderListRequest
|
||||
{
|
||||
UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", Option = FindOption.All
|
||||
};
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/list", request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderListResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.Orders);
|
||||
// Assert
|
||||
}
|
||||
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request =
|
||||
new ExchangeOrderCompleteRequest { UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", OrderId = order_id };
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/complete", request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderCompleteResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.OrderId);
|
||||
Assert.Equal(order_id, response_body.OrderId);
|
||||
Assert.Equal(ExchangeOrderStatus.Completed, response_body.Status);
|
||||
// Assert
|
||||
}
|
||||
}
|
||||
}
|
||||
179
BrokerApiTest/ControllerTests/Dev_PlanetUserControllerTests.cs
Normal file
179
BrokerApiTest/ControllerTests/Dev_PlanetUserControllerTests.cs
Normal file
@@ -0,0 +1,179 @@
|
||||
// using System.Net;
|
||||
// using System.Net.Http.Json;
|
||||
//
|
||||
// using BrokerCore.ApiModels;
|
||||
// using BrokerCore.DbEntity;
|
||||
//
|
||||
// using BrokerTest.Helper;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// using Xunit.Abstractions;
|
||||
//
|
||||
// namespace BrokerTest.Controllers;
|
||||
//
|
||||
// public class DevPlanetUserControllerTests : IAsyncLifetime
|
||||
// {
|
||||
// private readonly ITestOutputHelper m_test_output_helper;
|
||||
// const string m_planet_id = "new_earth";
|
||||
// const string m_planet_secret_key = "A8h$KmP3sWxZqL5vYnR7uTgBdEjHkMlQoT1wXzCv";
|
||||
// const string m_user_guid = "1052b08b52ef4d69a27ee1f40911a72f";
|
||||
// private string m_planet_token = string.Empty;
|
||||
// const string m_remote_server_url = "https://dev.planethub.caliverse.io:12000";
|
||||
// private readonly MetaTableTestHelper m_meta_table_test_helper = new();
|
||||
//
|
||||
// private readonly IBrokerTestServer m_server = new BrokerTestRemoteServer(m_remote_server_url);
|
||||
//
|
||||
// public DevPlanetUserControllerTests(ITestOutputHelper testOutputHelper)
|
||||
// {
|
||||
// m_test_output_helper = testOutputHelper;
|
||||
// }
|
||||
//
|
||||
// private HttpClient getTestClient()
|
||||
// {
|
||||
// var client = m_server.getTestClient();
|
||||
// if (m_planet_token != string.Empty)
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Add("Authorization", $"Bearer {m_planet_token}");
|
||||
// }
|
||||
//
|
||||
// return client;
|
||||
// }
|
||||
//
|
||||
// private HttpClient getTestClientWithBearer()
|
||||
// {
|
||||
// var client = m_server.getTestClient();
|
||||
// if (m_planet_token != string.Empty)
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Add("Authorization", $"Bearer {m_planet_token}");
|
||||
// }
|
||||
//
|
||||
// return client;
|
||||
// }
|
||||
//
|
||||
// public async Task InitializeAsync()
|
||||
// {
|
||||
// m_meta_table_test_helper.load();
|
||||
//
|
||||
// // Arrange
|
||||
// var client = getTestClient();
|
||||
// var request = new PlanetAuthRequest { PlanetId = m_planet_id, PlanetSecretKey = m_planet_secret_key };
|
||||
//
|
||||
// // Act
|
||||
// var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
//
|
||||
// // Assert
|
||||
// response.EnsureSuccessStatusCode();
|
||||
// var response_body = await response.Content.ReadFromJsonAsync<PlanetAuthResponse>();
|
||||
// Assert.NotNull(response_body);
|
||||
// Assert.NotEmpty(response_body.AccessToken);
|
||||
// m_planet_token = response_body.AccessToken;
|
||||
// }
|
||||
//
|
||||
// public async Task DisposeAsync()
|
||||
// {
|
||||
// await Task.CompletedTask;
|
||||
// }
|
||||
//
|
||||
// private bool checkError(HttpResponseMessage responseMessage)
|
||||
// {
|
||||
// if (responseMessage.StatusCode != HttpStatusCode.OK)
|
||||
// {
|
||||
// var error_body = responseMessage.Content.ReadFromJsonAsync<ApiErrorResponse>().Result;
|
||||
// Assert.NotNull(error_body);
|
||||
// m_test_output_helper.WriteLine(error_body.ErrorMessage ?? string.Empty);
|
||||
// Assert.True(false);
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// [Fact(DisplayName = "아이템 교환 주문 컨트롤러 테스트 모든 Meta")]
|
||||
// public async Task allMetaTests()
|
||||
// {
|
||||
// var meta = m_meta_table_test_helper.getMetaTableRef();
|
||||
// var meta_tuples = meta.MetaTable.PlanetItemExchangePolicyMetaTable.PlanetItemExchangePolicyDataList
|
||||
// .Select(x =>
|
||||
// string.Equals(x.CaliverseItemType, CaliverseItemType.Currency.ToString(),
|
||||
// StringComparison.CurrentCultureIgnoreCase)
|
||||
// ? (x.ID, Random.Shared.Next(10, 201))
|
||||
// : (x.ID, 1));
|
||||
// foreach (var meta_tuple in meta_tuples)
|
||||
// {
|
||||
// await orderTest(meta_tuple.Item1, meta_tuple.Item2);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private async Task orderTest(string metaId, int metaAmount)
|
||||
// {
|
||||
// string order_id;
|
||||
// {
|
||||
// // Arrange
|
||||
// var request_uri = "/api/v1/planet/user/exchange/order/create";
|
||||
// var client = getTestClientWithBearer();
|
||||
// var exchange_request = new PlanetItemExchangeRequest
|
||||
// {
|
||||
// SeasonId = "TEST_SEASON_ID",
|
||||
// UserGuid = m_user_guid, ExchangeMetaId = metaId, ExchangeMetaAmount = metaAmount,
|
||||
// };
|
||||
//
|
||||
// // Act
|
||||
// var exchange_response = await client.PostAsJsonAsync(request_uri, exchange_request);
|
||||
//
|
||||
// // Assert
|
||||
// checkError(exchange_response);
|
||||
// var exchange_response_body =
|
||||
// await exchange_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
// Assert.NotNull(exchange_response_body);
|
||||
// Assert.NotNull(exchange_response_body.ExchangeOrder.OrderId);
|
||||
// order_id = exchange_response_body.ExchangeOrder.OrderId;
|
||||
// }
|
||||
// {
|
||||
// // Arrange
|
||||
// var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
// var client = getTestClientWithBearer();
|
||||
// var list_request = new PlanetItemExchangeOrderListRequest
|
||||
// {
|
||||
// UserGuid = m_user_guid, Option = FindOption.All, ExchangeMetaId = metaId,
|
||||
// };
|
||||
//
|
||||
// // Act
|
||||
// var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
// checkError(list_response);
|
||||
//
|
||||
// // Assert
|
||||
// list_response.EnsureSuccessStatusCode();
|
||||
// var list_response_body =
|
||||
// await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
// Assert.NotNull(list_response_body);
|
||||
// Assert.NotNull(list_response_body.Orders);
|
||||
//
|
||||
// var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
// Assert.NotNull(order);
|
||||
// Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
// }
|
||||
// {
|
||||
// // Arrange
|
||||
// var request_uri = "/api/v1/planet/user/exchange/order/complete";
|
||||
// var client = getTestClientWithBearer();
|
||||
//
|
||||
// // Act
|
||||
// var complete_request = new PlanetItemExchangeCompleteRequest
|
||||
// {
|
||||
// UserGuid = m_user_guid, ExchangeOrderId = order_id
|
||||
// };
|
||||
// var complete_response =
|
||||
// await client.PostAsJsonAsync(request_uri, complete_request);
|
||||
// checkError(complete_response);
|
||||
//
|
||||
// // Assert
|
||||
// complete_response.EnsureSuccessStatusCode();
|
||||
// var complete_response_body =
|
||||
// await complete_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
// Assert.NotNull(complete_response_body);
|
||||
// Assert.NotNull(complete_response_body.ExchangeOrder);
|
||||
// Assert.Equal(order_id, complete_response_body.ExchangeOrder.OrderId);
|
||||
// Assert.Equal(ExchangeOrderStatus.Completed, complete_response_body.ExchangeOrder.OrderStatus);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
88
BrokerApiTest/ControllerTests/PlanetControllerTests.cs
Normal file
88
BrokerApiTest/ControllerTests/PlanetControllerTests.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
namespace BrokerTest.Controllers;
|
||||
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Json;
|
||||
using BrokerCore.ApiModels;
|
||||
using BrokerCore.Common;
|
||||
using BrokerCore.Services;
|
||||
using Helper;
|
||||
using Xunit;
|
||||
|
||||
public class PlanetControllerTests
|
||||
{
|
||||
private readonly BrokerTestServer m_server = new();
|
||||
private readonly JsonSerializerOptions m_json_options = new()
|
||||
{
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public async Task Auth_ValidRequest_ReturnsOkWithAccessToken()
|
||||
{
|
||||
// Arrange
|
||||
const string planet_id = "new_earth";
|
||||
const string planet_secret_key = "A8h$KmP3sWxZqL5vYnR7uTgBdEjHkMlQoT1wXzCv";
|
||||
|
||||
var client = m_server.getTestClient();
|
||||
var request = new PlanetAuthRequest { PlanetId = planet_id, PlanetSecretKey = planet_secret_key };
|
||||
|
||||
// Act
|
||||
var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
|
||||
// Assert
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
var auth_response = await response.Content.ReadFromJsonAsync<PlanetAuthResponse>(m_json_options);
|
||||
Assert.NotNull(auth_response);
|
||||
var jwt_option = m_server.getRequiredService<JwtOption>();
|
||||
Assert.NotNull(jwt_option);
|
||||
var jwt_service = new JwtParser(jwt_option);
|
||||
var claims = jwt_service.parseToken(auth_response.AccessToken);
|
||||
Assert.NotNull(claims);
|
||||
var id = claims.FindFirstValue(JwtRegisteredClaimNames.Sid);
|
||||
Assert.NotNull(id);
|
||||
Assert.Equal(planet_id, id);
|
||||
Assert.NotNull(auth_response.AccessToken);
|
||||
Assert.NotEqual(auth_response.AccessToken, string.Empty);
|
||||
}
|
||||
|
||||
// [Fact]
|
||||
// public async Task Auth_InvalidRequest_EmptyPlanetId_ReturnsBadRequest()
|
||||
// {
|
||||
// // Arrange
|
||||
// var client = m_server.getTestClient();
|
||||
// var request = new PlanetAuthRequest { PlanetId = "", PlanetSecretKey = "test_secret_key" };
|
||||
//
|
||||
// // Act
|
||||
// var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
//
|
||||
// // Assert
|
||||
// Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
// var error_response = await response.Content.ReadFromJsonAsync<ApiErrorResponse>(m_json_options);
|
||||
// Assert.NotNull(error_response);
|
||||
// Assert.Equal((int)ServerErrorCode.InvalidRequest, error_response.Code);
|
||||
// Assert.Contains("planet id is required", error_response.Message);
|
||||
// }
|
||||
//
|
||||
// [Fact]
|
||||
// public async Task Auth_InvalidRequest_NullPlanetSecretKey_ReturnsBadRequest()
|
||||
// {
|
||||
// // Arrange
|
||||
// var client = m_server.getTestClient();
|
||||
// var request = new PlanetAuthRequest { PlanetId = "test_planet_id", PlanetSecretKey = null };
|
||||
//
|
||||
// // Act
|
||||
// var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
//
|
||||
// // Assert
|
||||
// Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
// var error_response = await response.Content.ReadFromJsonAsync<ApiErrorResponse>(m_json_options);
|
||||
// Assert.NotNull(error_response);
|
||||
// Assert.Equal((int)ServerErrorCode.InvalidRequest, error_response.Code);
|
||||
// Assert.Contains("planet access key is required", error_response.Message);
|
||||
// }
|
||||
}
|
||||
302
BrokerApiTest/ControllerTests/PlanetUserControllerTests.cs
Normal file
302
BrokerApiTest/ControllerTests/PlanetUserControllerTests.cs
Normal file
@@ -0,0 +1,302 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
|
||||
using BrokerCore.ApiModels;
|
||||
using BrokerCore.DbEntity;
|
||||
|
||||
using BrokerTest.Helper;
|
||||
|
||||
using ServerCommon;
|
||||
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace BrokerTest.Controllers;
|
||||
|
||||
public class PlanetUserControllerTests : IAsyncLifetime
|
||||
{
|
||||
private readonly ITestOutputHelper m_test_output_helper;
|
||||
// const string m_planet_id = "new_earth";
|
||||
const string m_planet_id = "igm26_iggymob";
|
||||
const string m_planet_secret_key = "A8h$KmP3sWxZqL5vYnR7uTgBdEjHkMlQoT1wXzCv";
|
||||
const string m_user_guid = "1052b08b52ef4d69a27ee1f40911a72f"; //park chan heon
|
||||
const string m_account_id = "20462";
|
||||
|
||||
//40dbf485dc5b41508b7d53aa77819201
|
||||
// const string m_account_id = "20437";
|
||||
// const string m_user_guid = "40dbf485dc5b41508b7d53aa77819201";
|
||||
|
||||
private string m_planet_token = string.Empty;
|
||||
private readonly MetaTableTestHelper m_meta_table_test_helper = new();
|
||||
|
||||
// private readonly IBrokerTestServer m_server = new BrokerTestServer();
|
||||
private readonly IBrokerTestServer m_server = new BrokerTestRemoteServer("https://dev.planethub.caliverse.io:12000");
|
||||
|
||||
public PlanetUserControllerTests(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
m_test_output_helper = testOutputHelper;
|
||||
}
|
||||
|
||||
private HttpClient getTestClient()
|
||||
{
|
||||
var client = m_server.getTestClient();
|
||||
if (m_planet_token != string.Empty)
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {m_planet_token}");
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
private HttpClient getTestClientWithBearer()
|
||||
{
|
||||
var client = m_server.getTestClient();
|
||||
if (m_planet_token != string.Empty)
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {m_planet_token}");
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
m_meta_table_test_helper.load();
|
||||
|
||||
// Arrange
|
||||
var client = getTestClient();
|
||||
var request = new PlanetAuthRequest { PlanetId = m_planet_id, PlanetSecretKey = m_planet_secret_key };
|
||||
|
||||
// Act
|
||||
var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
|
||||
// Assert
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<PlanetAuthResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotEmpty(response_body.AccessToken);
|
||||
m_planet_token = response_body.AccessToken;
|
||||
}
|
||||
|
||||
public async Task DisposeAsync()
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private bool checkError(HttpResponseMessage responseMessage)
|
||||
{
|
||||
if (responseMessage.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
var error_body = responseMessage.Content.ReadFromJsonAsync<ApiErrorResponse>().Result;
|
||||
Assert.NotNull(error_body);
|
||||
m_test_output_helper.WriteLine(error_body.ErrorMessage ?? string.Empty);
|
||||
Assert.True(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "아이템 교환 주문 컨트롤러 테스트 모든 Meta")]
|
||||
public async Task allMetaTests()
|
||||
{
|
||||
MetaTableTestHelper meta_table_test_helper = new();
|
||||
meta_table_test_helper.load();
|
||||
var meta = meta_table_test_helper.getMetaTableRef();
|
||||
Assert.NotNull(meta);
|
||||
var meta_tuples = meta.MetaTable.PlanetItemExchangePolicyMetaTable.PlanetItemExchangePolicyDataList
|
||||
.Select(x =>
|
||||
string.Equals(x.CaliverseItemType, CaliverseItemType.Currency.ToString(),
|
||||
StringComparison.CurrentCultureIgnoreCase)
|
||||
? (x.ID, Random.Shared.Next(10, 201))
|
||||
: (x.ID, 5));
|
||||
// 테스트 이력용
|
||||
foreach (var i in Enumerable.Range(0, 1))
|
||||
{
|
||||
foreach (var meta_tuple in meta_tuples)
|
||||
{
|
||||
await orderTest(meta_tuple.Item1, meta_tuple.Item2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [Fact(DisplayName = "아이템 교환 주문 예외테스트")]
|
||||
// public async Task exceptionTests()
|
||||
// {
|
||||
// MetaTableTestHelper meta_table_test_helper = new();
|
||||
// meta_table_test_helper.load();
|
||||
// var meta = meta_table_test_helper.getMetaTableRef();
|
||||
// Assert.NotNull(meta);
|
||||
// var meta_tuples = meta.MetaTable.PlanetItemExchangePolicyMetaTable.PlanetItemExchangePolicyDataList
|
||||
// .Select(x =>
|
||||
// string.Equals(x.CaliverseItemType, CaliverseItemType.Currency.ToString(),
|
||||
// StringComparison.CurrentCultureIgnoreCase)
|
||||
// ? (x.ID, Random.Shared.Next(10, 201))
|
||||
// : (x.ID, 1));
|
||||
// foreach (var meta_tuple in meta_tuples)
|
||||
// {
|
||||
// await orderTest(meta_tuple.Item1, meta_tuple.Item2);
|
||||
// }
|
||||
// }
|
||||
|
||||
private async Task dailyAmountExceedError(string metaId, int metaAmount, int totalDailyAmount)
|
||||
{
|
||||
const string TEST_SEASON_ID = "TEST_SEASON_ID";
|
||||
string order_id;
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/create";
|
||||
var client = getTestClientWithBearer();
|
||||
var exchange_request = new PlanetItemExchangeRequest
|
||||
{
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, ExchangeMetaId = metaId, ExchangeMetaAmount = metaAmount,
|
||||
};
|
||||
|
||||
// Act
|
||||
var exchange_response = await client.PostAsJsonAsync(request_uri, exchange_request);
|
||||
if (exchange_response.StatusCode == HttpStatusCode.BadRequest)
|
||||
{
|
||||
|
||||
}
|
||||
// Assert
|
||||
checkError(exchange_response);
|
||||
var exchange_response_body =
|
||||
await exchange_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(exchange_response_body);
|
||||
Assert.NotNull(exchange_response_body.ExchangeOrder.OrderId);
|
||||
order_id = exchange_response_body.ExchangeOrder.OrderId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task orderTest(string metaId, int metaAmount)
|
||||
{
|
||||
const string TEST_SEASON_ID = "TEST_SEASON_ID";
|
||||
string order_id;
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/create";
|
||||
var client = getTestClientWithBearer();
|
||||
var exchange_request = new PlanetItemExchangeRequest
|
||||
{
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, ExchangeMetaId = metaId, ExchangeMetaAmount = metaAmount,
|
||||
};
|
||||
|
||||
// Act
|
||||
var exchange_response = await client.PostAsJsonAsync(request_uri, exchange_request);
|
||||
|
||||
// Assert
|
||||
checkError(exchange_response);
|
||||
var exchange_response_body =
|
||||
await exchange_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(exchange_response_body);
|
||||
Assert.NotNull(exchange_response_body.ExchangeOrder.OrderId);
|
||||
order_id = exchange_response_body.ExchangeOrder.OrderId;
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, Option = FindOption.All, ExchangeMetaId = metaId,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
ExchangeMetaId = metaId,
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
SsoAccountId = m_account_id, Option = FindOption.All,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
ExchangeMetaId = "",
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
SsoAccountId = m_account_id, Option = FindOption.All,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
|
||||
Assert.True(list_response_body.TotalCount > 0);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/complete";
|
||||
var client = getTestClientWithBearer();
|
||||
|
||||
// Act
|
||||
var complete_request = new PlanetItemExchangeCompleteRequest
|
||||
{
|
||||
UserGuid = m_user_guid, ExchangeOrderId = order_id
|
||||
};
|
||||
var complete_response =
|
||||
await client.PostAsJsonAsync(request_uri, complete_request);
|
||||
checkError(complete_response);
|
||||
|
||||
// Assert
|
||||
complete_response.EnsureSuccessStatusCode();
|
||||
var complete_response_body =
|
||||
await complete_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(complete_response_body);
|
||||
Assert.NotNull(complete_response_body.ExchangeOrder);
|
||||
Assert.Equal(order_id, complete_response_body.ExchangeOrder.OrderId);
|
||||
Assert.Equal(ExchangeOrderStatus.Completed, complete_response_body.ExchangeOrder.OrderStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
308
BrokerApiTest/ControllerTests/QAPlanetUserControllerTests.cs
Normal file
308
BrokerApiTest/ControllerTests/QAPlanetUserControllerTests.cs
Normal file
@@ -0,0 +1,308 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
|
||||
using BrokerCore.ApiModels;
|
||||
using BrokerCore.DbEntity;
|
||||
|
||||
using BrokerTest.Helper;
|
||||
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
using ServerCommon;
|
||||
using ServerCore;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace BrokerTest.Controllers;
|
||||
|
||||
public class QaPlanetUserControllerTests : IAsyncLifetime
|
||||
{
|
||||
private readonly ITestOutputHelper m_test_output_helper;
|
||||
// const string m_planet_id = "new_earth";
|
||||
const string m_planet_id = "igm26_iggymob";
|
||||
const string m_planet_secret_key = "A8h$KmP3sWxZqL5vYnR7uTgBdEjHkMlQoT1wXzCv";
|
||||
// tenafter71@gmail.com
|
||||
string m_user_guid = "";
|
||||
// tenafter71@gmail.com
|
||||
const string m_account_id = "40305"; // 40305
|
||||
private string m_planet_token = string.Empty;
|
||||
private readonly MetaTableTestHelper m_meta_table_test_helper = new();
|
||||
|
||||
// private readonly IBrokerTestServer m_server = new BrokerTestServer();
|
||||
private readonly IBrokerTestServer m_server = new BrokerTestRemoteServer("https://qa.planethub.caliverse.io:12000");
|
||||
|
||||
public QaPlanetUserControllerTests(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
m_test_output_helper = testOutputHelper;
|
||||
}
|
||||
|
||||
private HttpClient getTestClient()
|
||||
{
|
||||
var client = m_server.getTestClient();
|
||||
if (m_planet_token != string.Empty)
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {m_planet_token}");
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
private HttpClient getTestClientWithBearer()
|
||||
{
|
||||
var client = m_server.getTestClient();
|
||||
if (m_planet_token != string.Empty)
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {m_planet_token}");
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
if (m_user_guid.isNullOrWhiteSpace())
|
||||
{
|
||||
var helper = new TestUserHelper("QA");
|
||||
m_user_guid = await helper.getUserGuidByAccountId(m_account_id);
|
||||
}
|
||||
Assert.NotEmpty(m_user_guid);
|
||||
|
||||
m_meta_table_test_helper.load();
|
||||
|
||||
// Arrange
|
||||
var client = getTestClient();
|
||||
var request = new PlanetAuthRequest { PlanetId = m_planet_id, PlanetSecretKey = m_planet_secret_key };
|
||||
|
||||
// Act
|
||||
var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
|
||||
// Assert
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<PlanetAuthResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotEmpty(response_body.AccessToken);
|
||||
m_planet_token = response_body.AccessToken;
|
||||
}
|
||||
|
||||
public async Task DisposeAsync()
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private bool checkError(HttpResponseMessage responseMessage)
|
||||
{
|
||||
if (responseMessage.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
var error_body = responseMessage.Content.ReadFromJsonAsync<ApiErrorResponse>().Result;
|
||||
Assert.NotNull(error_body);
|
||||
m_test_output_helper.WriteLine(error_body.ErrorMessage ?? string.Empty);
|
||||
Assert.True(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "아이템 교환 주문 컨트롤러 테스트 모든 Meta")]
|
||||
public async Task allMetaTests()
|
||||
{
|
||||
MetaTableTestHelper meta_table_test_helper = new();
|
||||
meta_table_test_helper.load();
|
||||
var meta = meta_table_test_helper.getMetaTableRef();
|
||||
Assert.NotNull(meta);
|
||||
var meta_tuples = meta.MetaTable.PlanetItemExchangePolicyMetaTable.PlanetItemExchangePolicyDataList
|
||||
.Select(x =>
|
||||
string.Equals(x.CaliverseItemType, CaliverseItemType.Currency.ToString(),
|
||||
StringComparison.CurrentCultureIgnoreCase)
|
||||
? (x.ID, Random.Shared.Next(10, 201))
|
||||
: (x.ID, 1));
|
||||
// 테스트 이력용
|
||||
foreach (var i in Enumerable.Range(0, 1))
|
||||
{
|
||||
foreach (var meta_tuple in meta_tuples)
|
||||
{
|
||||
await orderTest(meta_tuple.Item1, meta_tuple.Item2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [Fact(DisplayName = "아이템 교환 주문 예외테스트")]
|
||||
// public async Task exceptionTests()
|
||||
// {
|
||||
// MetaTableTestHelper meta_table_test_helper = new();
|
||||
// meta_table_test_helper.load();
|
||||
// var meta = meta_table_test_helper.getMetaTableRef();
|
||||
// Assert.NotNull(meta);
|
||||
// var meta_tuples = meta.MetaTable.PlanetItemExchangePolicyMetaTable.PlanetItemExchangePolicyDataList
|
||||
// .Select(x =>
|
||||
// string.Equals(x.CaliverseItemType, CaliverseItemType.Currency.ToString(),
|
||||
// StringComparison.CurrentCultureIgnoreCase)
|
||||
// ? (x.ID, Random.Shared.Next(10, 201))
|
||||
// : (x.ID, 1));
|
||||
// foreach (var meta_tuple in meta_tuples)
|
||||
// {
|
||||
// await orderTest(meta_tuple.Item1, meta_tuple.Item2);
|
||||
// }
|
||||
// }
|
||||
|
||||
private async Task dailyAmountExceedError(string metaId, int metaAmount, int totalDailyAmount)
|
||||
{
|
||||
const string TEST_SEASON_ID = "TEST_SEASON_ID";
|
||||
string order_id;
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/create";
|
||||
var client = getTestClientWithBearer();
|
||||
var exchange_request = new PlanetItemExchangeRequest
|
||||
{
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, ExchangeMetaId = metaId, ExchangeMetaAmount = metaAmount,
|
||||
};
|
||||
|
||||
// Act
|
||||
var exchange_response = await client.PostAsJsonAsync(request_uri, exchange_request);
|
||||
if (exchange_response.StatusCode == HttpStatusCode.BadRequest)
|
||||
{
|
||||
|
||||
}
|
||||
// Assert
|
||||
checkError(exchange_response);
|
||||
var exchange_response_body =
|
||||
await exchange_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(exchange_response_body);
|
||||
Assert.NotNull(exchange_response_body.ExchangeOrder.OrderId);
|
||||
order_id = exchange_response_body.ExchangeOrder.OrderId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task orderTest(string metaId, int metaAmount)
|
||||
{
|
||||
const string TEST_SEASON_ID = "TEST_SEASON_ID";
|
||||
string order_id;
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/create";
|
||||
var client = getTestClientWithBearer();
|
||||
var exchange_request = new PlanetItemExchangeRequest
|
||||
{
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, ExchangeMetaId = metaId, ExchangeMetaAmount = metaAmount,
|
||||
};
|
||||
|
||||
// Act
|
||||
var exchange_response = await client.PostAsJsonAsync(request_uri, exchange_request);
|
||||
|
||||
// Assert
|
||||
checkError(exchange_response);
|
||||
var exchange_response_body =
|
||||
await exchange_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(exchange_response_body);
|
||||
Assert.NotNull(exchange_response_body.ExchangeOrder.OrderId);
|
||||
order_id = exchange_response_body.ExchangeOrder.OrderId;
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, Option = FindOption.All, ExchangeMetaId = metaId,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
ExchangeMetaId = metaId,
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
SsoAccountId = m_account_id, Option = FindOption.All,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
ExchangeMetaId = "",
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
SsoAccountId = m_account_id, Option = FindOption.All,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
|
||||
Assert.True(list_response_body.TotalCount > 0);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/complete";
|
||||
var client = getTestClientWithBearer();
|
||||
|
||||
// Act
|
||||
var complete_request = new PlanetItemExchangeCompleteRequest
|
||||
{
|
||||
UserGuid = m_user_guid, ExchangeOrderId = order_id
|
||||
};
|
||||
var complete_response =
|
||||
await client.PostAsJsonAsync(request_uri, complete_request);
|
||||
checkError(complete_response);
|
||||
|
||||
// Assert
|
||||
complete_response.EnsureSuccessStatusCode();
|
||||
var complete_response_body =
|
||||
await complete_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(complete_response_body);
|
||||
Assert.NotNull(complete_response_body.ExchangeOrder);
|
||||
Assert.Equal(order_id, complete_response_body.ExchangeOrder.OrderId);
|
||||
Assert.Equal(ExchangeOrderStatus.Completed, complete_response_body.ExchangeOrder.OrderStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
115
BrokerApiTest/ControllerTests/QaCurrencyControllerTests.cs
Normal file
115
BrokerApiTest/ControllerTests/QaCurrencyControllerTests.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Json;
|
||||
|
||||
using BrokerCore.ApiModels;
|
||||
using BrokerCore.Common;
|
||||
using BrokerCore.DbEntity;
|
||||
using BrokerCore.Services;
|
||||
|
||||
using BrokerTest.Helper;
|
||||
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace BrokerTest.Controllers;
|
||||
|
||||
public class QaCurrencyControllerTests
|
||||
{
|
||||
private readonly ITestOutputHelper m_test_output_helper;
|
||||
|
||||
public QaCurrencyControllerTests(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
m_test_output_helper = testOutputHelper;
|
||||
}
|
||||
// private readonly BrokerTestServer m_server = new BrokerTestServer();
|
||||
|
||||
public HttpClient getTestClient()
|
||||
{
|
||||
return new HttpClient { BaseAddress = new Uri("https://qa.planethub.caliverse.io:12000") };
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task initializeAsync()
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Auth_ValidRequest_ReturnsOkWithAccessToken()
|
||||
{
|
||||
// Arrange
|
||||
const string planet_id = "new_earth";
|
||||
const string planet_secret_key = "A8h$KmP3sWxZqL5vYnR7uTgBdEjHkMlQoT1wXzCv";
|
||||
var planet_token = string.Empty;
|
||||
var order_id = string.Empty;
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new PlanetAuthRequest { PlanetId = planet_id, PlanetSecretKey = planet_secret_key };
|
||||
|
||||
// Act
|
||||
var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
|
||||
// Assert
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<PlanetAuthResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
planet_token = response_body.AccessToken;
|
||||
}
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new ExchangeOrderRequest
|
||||
{
|
||||
UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", Sapphire = 10, Emerald = 10
|
||||
};
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/create", request);
|
||||
if (response.StatusCode == HttpStatusCode.BadRequest)
|
||||
{
|
||||
var response_body_error = await response.Content.ReadFromJsonAsync<ApiErrorResponse>();
|
||||
Assert.NotNull(response_body_error);
|
||||
m_test_output_helper.WriteLine(response_body_error.ErrorMessage);
|
||||
// Assert.Contains("Insufficient balance", response_body_error);
|
||||
return;
|
||||
}
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.OrderId);
|
||||
order_id = response_body.OrderId;
|
||||
// Assert
|
||||
}
|
||||
|
||||
//UserGuid:1052b08b52ef4d69a27ee1f40911a72f
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request = new ExchangeOrderListRequest
|
||||
{
|
||||
UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", Option = FindOption.All
|
||||
};
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/list", request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderListResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.Orders);
|
||||
// Assert
|
||||
}
|
||||
|
||||
{
|
||||
var client = getTestClient();
|
||||
var request =
|
||||
new ExchangeOrderCompleteRequest { UserGuid = "1052b08b52ef4d69a27ee1f40911a72f", OrderId = order_id };
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {planet_token}");
|
||||
var response = await client.PostAsJsonAsync("/api/v1/exchange/order/complete", request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<ExchangeOrderCompleteResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotNull(response_body.OrderId);
|
||||
Assert.Equal(order_id, response_body.OrderId);
|
||||
Assert.Equal(ExchangeOrderStatus.Completed, response_body.Status);
|
||||
// Assert
|
||||
}
|
||||
}
|
||||
}
|
||||
308
BrokerApiTest/ControllerTests/StagePlanetUserControllerTests.cs
Normal file
308
BrokerApiTest/ControllerTests/StagePlanetUserControllerTests.cs
Normal file
@@ -0,0 +1,308 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
|
||||
using BrokerCore.ApiModels;
|
||||
using BrokerCore.DbEntity;
|
||||
|
||||
using BrokerTest.Helper;
|
||||
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
using ServerCommon;
|
||||
using ServerCore;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace BrokerTest.Controllers;
|
||||
|
||||
public class StagePlanetUserControllerTests : IAsyncLifetime
|
||||
{
|
||||
private readonly ITestOutputHelper m_test_output_helper;
|
||||
// const string m_planet_id = "new_earth";
|
||||
const string m_planet_id = "igm26_iggymob";
|
||||
const string m_planet_secret_key = "A8h$KmP3sWxZqL5vYnR7uTgBdEjHkMlQoT1wXzCv";
|
||||
// tenafter71@gmail.com
|
||||
string m_user_guid = "";
|
||||
// tenafter71@gmail.com
|
||||
const string m_account_id = "60"; // 40305
|
||||
private string m_planet_token = string.Empty;
|
||||
private readonly MetaTableTestHelper m_meta_table_test_helper = new();
|
||||
|
||||
// private readonly IBrokerTestServer m_server = new BrokerTestServer();
|
||||
private readonly IBrokerTestServer m_server = new BrokerTestRemoteServer("https://qa.planethub.caliverse.io:12000");
|
||||
|
||||
public StagePlanetUserControllerTests(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
m_test_output_helper = testOutputHelper;
|
||||
}
|
||||
|
||||
private HttpClient getTestClient()
|
||||
{
|
||||
var client = m_server.getTestClient();
|
||||
if (m_planet_token != string.Empty)
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {m_planet_token}");
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
private HttpClient getTestClientWithBearer()
|
||||
{
|
||||
var client = m_server.getTestClient();
|
||||
if (m_planet_token != string.Empty)
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {m_planet_token}");
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
if (m_user_guid.isNullOrWhiteSpace())
|
||||
{
|
||||
var helper = new TestUserHelper("Stage");
|
||||
m_user_guid = await helper.getUserGuidByAccountId(m_account_id);
|
||||
}
|
||||
Assert.NotEmpty(m_user_guid);
|
||||
|
||||
m_meta_table_test_helper.load();
|
||||
|
||||
// Arrange
|
||||
var client = getTestClient();
|
||||
var request = new PlanetAuthRequest { PlanetId = m_planet_id, PlanetSecretKey = m_planet_secret_key };
|
||||
|
||||
// Act
|
||||
var response = await client.PostAsJsonAsync("/api/v1/planet/auth", request);
|
||||
|
||||
// Assert
|
||||
response.EnsureSuccessStatusCode();
|
||||
var response_body = await response.Content.ReadFromJsonAsync<PlanetAuthResponse>();
|
||||
Assert.NotNull(response_body);
|
||||
Assert.NotEmpty(response_body.AccessToken);
|
||||
m_planet_token = response_body.AccessToken;
|
||||
}
|
||||
|
||||
public async Task DisposeAsync()
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private bool checkError(HttpResponseMessage responseMessage)
|
||||
{
|
||||
if (responseMessage.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
var error_body = responseMessage.Content.ReadFromJsonAsync<ApiErrorResponse>().Result;
|
||||
Assert.NotNull(error_body);
|
||||
m_test_output_helper.WriteLine(error_body.ErrorMessage ?? string.Empty);
|
||||
Assert.True(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "아이템 교환 주문 컨트롤러 테스트 모든 Meta")]
|
||||
public async Task allMetaTests()
|
||||
{
|
||||
MetaTableTestHelper meta_table_test_helper = new();
|
||||
meta_table_test_helper.load();
|
||||
var meta = meta_table_test_helper.getMetaTableRef();
|
||||
Assert.NotNull(meta);
|
||||
var meta_tuples = meta.MetaTable.PlanetItemExchangePolicyMetaTable.PlanetItemExchangePolicyDataList
|
||||
.Select(x =>
|
||||
string.Equals(x.CaliverseItemType, CaliverseItemType.Currency.ToString(),
|
||||
StringComparison.CurrentCultureIgnoreCase)
|
||||
? (x.ID, Random.Shared.Next(10, 201))
|
||||
: (x.ID, 1));
|
||||
// 테스트 이력용
|
||||
foreach (var i in Enumerable.Range(0, 1))
|
||||
{
|
||||
foreach (var meta_tuple in meta_tuples)
|
||||
{
|
||||
await orderTest(meta_tuple.Item1, meta_tuple.Item2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [Fact(DisplayName = "아이템 교환 주문 예외테스트")]
|
||||
// public async Task exceptionTests()
|
||||
// {
|
||||
// MetaTableTestHelper meta_table_test_helper = new();
|
||||
// meta_table_test_helper.load();
|
||||
// var meta = meta_table_test_helper.getMetaTableRef();
|
||||
// Assert.NotNull(meta);
|
||||
// var meta_tuples = meta.MetaTable.PlanetItemExchangePolicyMetaTable.PlanetItemExchangePolicyDataList
|
||||
// .Select(x =>
|
||||
// string.Equals(x.CaliverseItemType, CaliverseItemType.Currency.ToString(),
|
||||
// StringComparison.CurrentCultureIgnoreCase)
|
||||
// ? (x.ID, Random.Shared.Next(10, 201))
|
||||
// : (x.ID, 1));
|
||||
// foreach (var meta_tuple in meta_tuples)
|
||||
// {
|
||||
// await orderTest(meta_tuple.Item1, meta_tuple.Item2);
|
||||
// }
|
||||
// }
|
||||
|
||||
private async Task dailyAmountExceedError(string metaId, int metaAmount, int totalDailyAmount)
|
||||
{
|
||||
const string TEST_SEASON_ID = "TEST_SEASON_ID";
|
||||
string order_id;
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/create";
|
||||
var client = getTestClientWithBearer();
|
||||
var exchange_request = new PlanetItemExchangeRequest
|
||||
{
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, ExchangeMetaId = metaId, ExchangeMetaAmount = metaAmount,
|
||||
};
|
||||
|
||||
// Act
|
||||
var exchange_response = await client.PostAsJsonAsync(request_uri, exchange_request);
|
||||
if (exchange_response.StatusCode == HttpStatusCode.BadRequest)
|
||||
{
|
||||
|
||||
}
|
||||
// Assert
|
||||
checkError(exchange_response);
|
||||
var exchange_response_body =
|
||||
await exchange_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(exchange_response_body);
|
||||
Assert.NotNull(exchange_response_body.ExchangeOrder.OrderId);
|
||||
order_id = exchange_response_body.ExchangeOrder.OrderId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task orderTest(string metaId, int metaAmount)
|
||||
{
|
||||
const string TEST_SEASON_ID = "TEST_SEASON_ID";
|
||||
string order_id;
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/create";
|
||||
var client = getTestClientWithBearer();
|
||||
var exchange_request = new PlanetItemExchangeRequest
|
||||
{
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, ExchangeMetaId = metaId, ExchangeMetaAmount = metaAmount,
|
||||
};
|
||||
|
||||
// Act
|
||||
var exchange_response = await client.PostAsJsonAsync(request_uri, exchange_request);
|
||||
|
||||
// Assert
|
||||
checkError(exchange_response);
|
||||
var exchange_response_body =
|
||||
await exchange_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(exchange_response_body);
|
||||
Assert.NotNull(exchange_response_body.ExchangeOrder.OrderId);
|
||||
order_id = exchange_response_body.ExchangeOrder.OrderId;
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
UserGuid = m_user_guid, Option = FindOption.All, ExchangeMetaId = metaId,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
ExchangeMetaId = metaId,
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
SsoAccountId = m_account_id, Option = FindOption.All,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/list";
|
||||
var client = getTestClientWithBearer();
|
||||
var list_request = new PlanetItemExchangeOrderListRequest
|
||||
{
|
||||
PlanetId = m_planet_id,
|
||||
ExchangeMetaId = "",
|
||||
SeasonId = TEST_SEASON_ID,
|
||||
SsoAccountId = m_account_id, Option = FindOption.All,
|
||||
};
|
||||
|
||||
// Act
|
||||
var list_response = await client.PostAsJsonAsync(request_uri, list_request);
|
||||
checkError(list_response);
|
||||
|
||||
// Assert
|
||||
list_response.EnsureSuccessStatusCode();
|
||||
var list_response_body =
|
||||
await list_response.Content.ReadFromJsonAsync<PlanetItemExchangeOrderListResponse>();
|
||||
Assert.NotNull(list_response_body);
|
||||
Assert.NotNull(list_response_body.Orders);
|
||||
|
||||
var order = list_response_body.Orders.FirstOrDefault(x => x.OrderId == order_id);
|
||||
Assert.NotNull(order);
|
||||
Assert.Equal(ExchangeOrderStatus.Pending, order.OrderStatus);
|
||||
|
||||
Assert.True(list_response_body.TotalCount > 0);
|
||||
}
|
||||
{
|
||||
// Arrange
|
||||
var request_uri = "/api/v1/planet/user/exchange/order/complete";
|
||||
var client = getTestClientWithBearer();
|
||||
|
||||
// Act
|
||||
var complete_request = new PlanetItemExchangeCompleteRequest
|
||||
{
|
||||
UserGuid = m_user_guid, ExchangeOrderId = order_id
|
||||
};
|
||||
var complete_response =
|
||||
await client.PostAsJsonAsync(request_uri, complete_request);
|
||||
checkError(complete_response);
|
||||
|
||||
// Assert
|
||||
complete_response.EnsureSuccessStatusCode();
|
||||
var complete_response_body =
|
||||
await complete_response.Content.ReadFromJsonAsync<PlanetItemExchangeResponse>();
|
||||
Assert.NotNull(complete_response_body);
|
||||
Assert.NotNull(complete_response_body.ExchangeOrder);
|
||||
Assert.Equal(order_id, complete_response_body.ExchangeOrder.OrderId);
|
||||
Assert.Equal(ExchangeOrderStatus.Completed, complete_response_body.ExchangeOrder.OrderStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
177
BrokerApiTest/DocQuery/DataExample.cs
Normal file
177
BrokerApiTest/DocQuery/DataExample.cs
Normal file
@@ -0,0 +1,177 @@
|
||||
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;
|
||||
// }
|
||||
// }
|
||||
|
||||
public class UserTestActorLog : ILogActor
|
||||
{
|
||||
}
|
||||
|
||||
// EntityBase를 상속 받은 Entity는 EntityAttributeBase와 EntityActionBase를 상속받아 자동으로 만들어진 Attribute들과 Action들을 가지고 있습니다.
|
||||
// 위 내용은 onInit()에서 직접 생성해서 초기화 한다.
|
||||
|
||||
|
||||
public class DynamoDbExample
|
||||
{
|
||||
private readonly DynamoDbClient m_dynamo_db_client;
|
||||
private readonly UserTestEntity m_user_entity;
|
||||
|
||||
public DynamoDbExample(DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
m_dynamo_db_client = dynamoDbClient;
|
||||
m_user_entity = new UserTestEntity();
|
||||
}
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> insertUser(string userId, string name)
|
||||
{
|
||||
await m_user_entity.onInit();
|
||||
var action = m_user_entity.getEntityAction<UserTestInsertAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(action,
|
||||
() => $"UserTestInsertAction is null !!! - {m_user_entity.toBasicString()}");
|
||||
var (result, user_test_doc) = await action.tryInsertUser(userId, name, m_dynamo_db_client);
|
||||
return (result, user_test_doc);
|
||||
}
|
||||
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> findUserOne(string userId)
|
||||
{
|
||||
await m_user_entity.onInit();
|
||||
var action = m_user_entity.getEntityAction<UserTestFindOneAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(action,
|
||||
() => $"UserTestInsertAction is null !!! - {m_user_entity.toBasicString()}");
|
||||
return await action.findUserOne(userId, m_dynamo_db_client);
|
||||
}
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> updateUser(string userId, string newName)
|
||||
{
|
||||
await m_user_entity.onInit();
|
||||
var action = m_user_entity.getEntityAction<UserTestUpdateOneAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(action,
|
||||
() => $"UserTestUpdateOneAction is null !!! - {m_user_entity.toBasicString()}");
|
||||
return await action.updateOne(userId, newName, m_dynamo_db_client);
|
||||
}
|
||||
|
||||
public async Task<Result> DeleteUserOne(string userId)
|
||||
{
|
||||
await m_user_entity.onInit();
|
||||
var action = m_user_entity.getEntityAction<UserTestDeleteOneAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(action,
|
||||
() => $"UserTestDeleteOneAction is null !!! - {m_user_entity.toBasicString()}");
|
||||
return await action.deleteOne(userId, m_dynamo_db_client);
|
||||
}
|
||||
}
|
||||
92
BrokerApiTest/DocQuery/DynamoDbClientTests.cs
Normal file
92
BrokerApiTest/DocQuery/DynamoDbClientTests.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
namespace PlatformTest.DbQuery;
|
||||
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Xunit;
|
||||
using Amazon.DynamoDBv2;
|
||||
using Amazon.DynamoDBv2.Model;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
|
||||
|
||||
public class DynamoDbClientTests
|
||||
{
|
||||
private ServerConfig? m_config;
|
||||
private string m_config_path = "../Config/Config.json";
|
||||
private string m_nlog_config_path = "../Config/nlog.config";
|
||||
|
||||
public DynamoDbClientTests()
|
||||
{
|
||||
Log.NLogFileName = m_nlog_config_path;
|
||||
m_config = new ServerConfig();
|
||||
m_config_path = Path.GetFullPath(m_config_path);
|
||||
m_config.setConfigFilePath(m_config_path);
|
||||
m_config.tryLoadConfig().GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task connectToDb_ShouldConnectSuccessfully()
|
||||
{
|
||||
NullReferenceCheckHelper.throwIfNull(m_config);
|
||||
var dynamo_db_client = new DynamoDbClient();
|
||||
|
||||
// Act
|
||||
(var error_code, var to_load_table_names) = ServerConfigHelper.getDynamoDbTableNamesWithServiceType(m_config.ServiceType);
|
||||
if (error_code.isFail())
|
||||
{
|
||||
var err_msg = $"Failed to DynamoDbClient.getDynamoDbTableNameWithServiceType() !!!";
|
||||
Log.getLogger().error(err_msg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var result = dynamo_db_client.connectToDb( to_load_table_names
|
||||
, m_config.AWS.LocalDynamoDB, m_config.Dynamodb
|
||||
, m_config.AWS.AccessKey, m_config.AWS.SecretKey, m_config.AWS.Region);
|
||||
if (result.isFail())
|
||||
{
|
||||
Log.getLogger().error($"Failed to connectToDb !!! ");
|
||||
return;
|
||||
}
|
||||
|
||||
// Assert
|
||||
await Task.CompletedTask;
|
||||
Assert.True(result.isSuccess());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CreateDBIfNotExists_ShouldCreateTable()
|
||||
{
|
||||
NullReferenceCheckHelper.throwIfNull(m_config);
|
||||
|
||||
var dynamo_db_client = new DynamoDbClient();
|
||||
|
||||
(var error_code, var to_load_table_names) = ServerConfigHelper.getDynamoDbTableNamesWithServiceType(m_config.ServiceType);
|
||||
if (error_code.isFail())
|
||||
{
|
||||
var err_msg = $"Failed to DynamoDbClient.getDynamoDbTableNameWithServiceType() !!!";
|
||||
Log.getLogger().error(err_msg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var result = dynamo_db_client.connectToDb(to_load_table_names
|
||||
, m_config.AWS.LocalDynamoDB, m_config.Dynamodb
|
||||
, m_config.AWS.AccessKey, m_config.AWS.SecretKey, m_config.AWS.Region);
|
||||
if (result.isFail())
|
||||
{
|
||||
Log.getLogger().error($"Failed to connectToDb !!! ");
|
||||
return;
|
||||
}
|
||||
|
||||
// Act
|
||||
var is_success = await dynamo_db_client.createDBIfNotExists(false);
|
||||
|
||||
// Assert
|
||||
Assert.True(is_success);
|
||||
}
|
||||
}
|
||||
111
BrokerApiTest/DocQuery/EntityBaseTests.cs
Normal file
111
BrokerApiTest/DocQuery/EntityBaseTests.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
namespace PlatformTest.DbQuery;
|
||||
|
||||
using Amazon;
|
||||
using Amazon.DynamoDBv2;
|
||||
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
public class EntityBaseTests
|
||||
{
|
||||
private readonly DynamoDbClient m_dynamo_db_client;
|
||||
|
||||
public EntityBaseTests()
|
||||
{
|
||||
m_dynamo_db_client = new DynamoDbClient();
|
||||
|
||||
(var error_code, var table_names) = ServerConfigHelper.getDynamoDbTableNamesWithServiceType("Dev");
|
||||
ConditionValidCheckHelper.throwIfFalseWithCondition(() => ServerErrorCode.Success == error_code
|
||||
, () => $"Failed to ServerConfigHelper.getDynamoDbTableNamesWithServiceType() !!! : errorCode:{error_code}");
|
||||
|
||||
var result = m_dynamo_db_client.connectToDb(table_names, true, "http://localhost:8000", "local", "local");
|
||||
if (result.isFail())
|
||||
{
|
||||
Log.getLogger().error($"Failed to connectToDb !!! ");
|
||||
return;
|
||||
}
|
||||
Log.getLogger().info($"Success connectToDb !!!");
|
||||
}
|
||||
|
||||
internal async Task initDynamoDbClient()
|
||||
{
|
||||
if (false == await m_dynamo_db_client.createDBIfNotExists(false))
|
||||
{
|
||||
// err_msg = $"Failed to create DB Table !!! - {toBasicString()}";
|
||||
// result.setFail(ServerErrorCode.DynamoDbTableCreateFailed, err_msg);
|
||||
Log.getLogger().fatal("Failed to create DB Table !!!");
|
||||
// return result;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task entityInsertActionTest()
|
||||
{
|
||||
await initDynamoDbClient();
|
||||
var user_entity = new UserTestEntity();
|
||||
await user_entity.onInit();
|
||||
|
||||
user_entity.getEntityAction<UserTestInsertAction>();
|
||||
var user_id = Guid.NewGuid().ToString();
|
||||
var name = $"name_{user_id}";
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EntityFindOneActionTest()
|
||||
{
|
||||
await initDynamoDbClient();
|
||||
var user_entity = new UserTestEntity();
|
||||
await user_entity.onInit();
|
||||
|
||||
user_entity.getEntityAction<UserTestFindOneAction>();
|
||||
|
||||
|
||||
// var example = new DynamoDbExample(m_dynamo_db_client);
|
||||
var user_id = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task entityBaseTest()
|
||||
{
|
||||
await initDynamoDbClient();
|
||||
var example = new DynamoDbExample(m_dynamo_db_client);
|
||||
var user_id = Guid.NewGuid().ToString();
|
||||
var name = $"name_{user_id}";
|
||||
|
||||
//=====================================================================================
|
||||
// Insert
|
||||
//=====================================================================================
|
||||
var (result, user_test_doc) = await example.insertUser(user_id, name);
|
||||
Assert.True(result.isSuccess());
|
||||
var user_test_attrib = user_test_doc?.getAttrib<UserTestAttrib>();
|
||||
Assert.NotNull(user_test_attrib);
|
||||
Assert.True(user_test_attrib.UserId == user_id);
|
||||
Assert.True(user_test_attrib.Name == name);
|
||||
|
||||
|
||||
var (find_result, user_test_find_doc) = await example.findUserOne(user_id);
|
||||
Assert.True(find_result.isSuccess());
|
||||
Assert.NotNull(find_result);
|
||||
Assert.NotNull(user_test_find_doc);
|
||||
Assert.True(user_test_find_doc.getAttrib<UserTestAttrib>()?.UserId == user_id);
|
||||
Assert.True(user_test_find_doc.getAttrib<UserTestAttrib>()?.Name == name);
|
||||
|
||||
var new_name = $"name_{user_id}_2";
|
||||
var (update_result, user_test_update_doc) = await example.updateUser(user_id, new_name);
|
||||
Assert.True(update_result.isSuccess());
|
||||
|
||||
var (find_result2, user_test_update_doc2) = await example.findUserOne(user_id);
|
||||
Assert.True(find_result2.isSuccess());
|
||||
Assert.NotNull(user_test_update_doc2);
|
||||
Assert.True(user_test_update_doc2.getAttrib<UserTestAttrib>()?.UserId == user_id);
|
||||
Assert.True(user_test_update_doc2.getAttrib<UserTestAttrib>()?.Name == new_name);
|
||||
|
||||
var delete_result = await example.DeleteUserOne(user_id);
|
||||
Assert.True(delete_result.isSuccess());
|
||||
|
||||
var (find_result3, user_test_delete_doc) = await example.findUserOne(user_id);
|
||||
Assert.Null(user_test_delete_doc);
|
||||
Assert.True(find_result3.isFail());
|
||||
}
|
||||
}
|
||||
34
BrokerApiTest/DocQuery/UserTestAttrib.cs
Normal file
34
BrokerApiTest/DocQuery/UserTestAttrib.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
|
||||
public class UserTestAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("user_id")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public UserTestAttrib(UserTestEntity owner) : base(nameof(UserTestAttrib))
|
||||
{
|
||||
}
|
||||
|
||||
public UserTestAttrib()
|
||||
: base(nameof(UserTestAttrib))
|
||||
{
|
||||
}
|
||||
|
||||
public UserTestAttrib(string userId, string name) : base(nameof(UserTestAttrib))
|
||||
{
|
||||
UserId = userId;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public void set(UserTestAttrib attrib)
|
||||
{
|
||||
UserId = attrib.UserId;
|
||||
Name = attrib.Name;
|
||||
}
|
||||
}
|
||||
31
BrokerApiTest/DocQuery/UserTestDeleteOneAction.cs
Normal file
31
BrokerApiTest/DocQuery/UserTestDeleteOneAction.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace PlatformTest.DbQuery;
|
||||
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
public class UserTestDeleteOneAction : EntityActionBase
|
||||
{
|
||||
public UserTestDeleteOneAction(EntityBase owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override Task<Result> onInit()
|
||||
{
|
||||
return Task.FromResult(new Result());
|
||||
}
|
||||
|
||||
public override void onClear()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<Result> deleteOne(string userId, DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
var user_test_doc = new UserTestDoc(userId);
|
||||
user_test_doc.setQueryType(QueryType.Delete);
|
||||
var result = await dynamoDbClient.simpleDeleteDocumentWithDocType(user_test_doc);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
92
BrokerApiTest/DocQuery/UserTestDoc.cs
Normal file
92
BrokerApiTest/DocQuery/UserTestDoc.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
// DynamoDbDocBase는 리파지토리로 이해하면 편할 듯
|
||||
// AttribBase: db에 저장될 데이터
|
||||
public sealed class UserTestDoc : DynamoDbDocBase
|
||||
{
|
||||
private const string m_prefix_of_pk = "user_test#";
|
||||
private const string m_prefix_of_sk = "";
|
||||
public UserTestDoc() : base(nameof(UserTestDoc))
|
||||
{
|
||||
// doc에 저장되는 attrib을 생성한다.
|
||||
appendAttribWrapper(new AttribWrapper<UserTestAttrib>());
|
||||
}
|
||||
|
||||
public UserTestDoc(string userId, string name = "") : base(nameof(UserTestDoc))
|
||||
{
|
||||
// doc에 저장되는 attrib을 생성한다.
|
||||
appendAttribWrapper(new AttribWrapper<UserTestAttrib>());
|
||||
|
||||
// prefix를 제외한 key를 설정정한다.
|
||||
setCombinationKeyForPK(userId);
|
||||
|
||||
// 파티션 키와 소트 키를 안전하게 설정한다.
|
||||
// 이 과정에서 onCheckAndSetPK, onCheckAndSetSK 메소드가 호출된다.
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
// 기본 값 설정
|
||||
var attrib = getAttrib<UserTestAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(attrib, () => $"attrib is null !!! - {toBasicString()}");
|
||||
attrib.UserId = userId;
|
||||
attrib.Name = name;
|
||||
}
|
||||
|
||||
public async Task<Result> insertUser(DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
var result = await dynamoDbClient.simpleInsertDocumentWithDocType(this);
|
||||
if (result.isFail())
|
||||
{
|
||||
var err_msg = $"Failed to insertUser() !!! : {result.toBasicString()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.getLogger().info($"Insert User Test !!! - {this.toBasicString()}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> findOne(DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
var config = dynamoDbClient.makeQueryConfigForReadByPKOnly(getPK());
|
||||
var (result, result_doc) = await dynamoDbClient.simpleQueryDocTypeWithQueryOperationConfig<UserTestDoc>(config);
|
||||
if (result.isFail())
|
||||
{
|
||||
var err_msg = $"Failed to simpleQueryDocTypesWithQueryOperationConfig() !!! : {result.toBasicString()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
return (result, null);
|
||||
}
|
||||
return (result, result_doc);
|
||||
}
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> updateOne(DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
setQueryType(QueryType.Update);
|
||||
var result = await dynamoDbClient.simpleUpdateDocumentWithDocType(this);
|
||||
if (result.isFail())
|
||||
{
|
||||
var err_msg = $"Failed to simpleUpdateDocumentWithDocType() !!! : {result.toBasicString()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
return (result, null);
|
||||
}
|
||||
Log.getLogger().info($"Insert User Test !!! - {this.toBasicString()}");
|
||||
return (result, this);
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => m_prefix_of_pk;
|
||||
protected override string onGetPrefixOfSK() => m_prefix_of_sk;
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string partitionKey)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(partitionKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
53
BrokerApiTest/DocQuery/UserTestEntity.cs
Normal file
53
BrokerApiTest/DocQuery/UserTestEntity.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using PlatformTest.DbQuery;
|
||||
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
// EntityBase: EntityAttribute와 EntityAction을 관리하는 컨테이너
|
||||
public class UserTestEntity : EntityBase, IWithLogActor
|
||||
{
|
||||
// EntityType은 어디에 쓰는 걸까? 아마도 로그?
|
||||
|
||||
public UserTestEntity() : base(EntityType.Golbal)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit()
|
||||
{
|
||||
base.onCearAll();
|
||||
// EntityAttribute, EntityAction 생성
|
||||
addEntityAttribute(new UserTestEntityAttribute(this));
|
||||
addEntityAction(new UserTestInsertAction(this));
|
||||
addEntityAction(new UserTestFindOneAction(this));
|
||||
addEntityAction(new UserTestUpdateOneAction(this));
|
||||
addEntityAction(new UserTestDeleteOneAction(this));
|
||||
var result = await base.onInit();
|
||||
if (result.isFail())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public override void onCearAll()
|
||||
{
|
||||
base.onCearAll();
|
||||
}
|
||||
|
||||
public override string toBasicString()
|
||||
{
|
||||
return $"{this.getTypeName()}";
|
||||
}
|
||||
|
||||
public override string toSummaryString()
|
||||
{
|
||||
return $"{this.getTypeName()}";
|
||||
}
|
||||
|
||||
public ILogActor toLogActor()
|
||||
{
|
||||
// 그냥 나중에 로거를 꺼내서 처리하는 듯 하다.
|
||||
return new UserTestActorLog();
|
||||
}
|
||||
}
|
||||
118
BrokerApiTest/DocQuery/UserTestEntityAttribute.cs
Normal file
118
BrokerApiTest/DocQuery/UserTestEntityAttribute.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
using ThirdParty.Json.LitJson;
|
||||
|
||||
// EntityAttributeBase를 상속 받은 개체는 메모리에 사용될 내용임
|
||||
// 스토리지에 저장은 UsrTestDoc:DynamoDbDocBase에서 처리함
|
||||
public class UserTestEntityAttribute : EntityAttributeBase
|
||||
{
|
||||
[JsonProperty] public string UserId { get; set; } = string.Empty;
|
||||
[JsonProperty] public string Name { get; set; } = string.Empty;
|
||||
|
||||
public UserTestEntityAttribute(EntityBase owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override UserTestDoc onCreateDocBase()
|
||||
{
|
||||
return new UserTestDoc(UserId, Name);
|
||||
}
|
||||
|
||||
public override void onClear()
|
||||
{
|
||||
UserId = string.Empty;
|
||||
Name = string.Empty;
|
||||
getAttributeState().reset();
|
||||
}
|
||||
|
||||
public override async Task<(Result, DynamoDbDocBase?)> toDocBase(bool isForQuery = true)
|
||||
{
|
||||
var result = new Result();
|
||||
|
||||
//=====================================================================================
|
||||
// try_pending_doc은 없으면 새로 생성하고 초기화 한다.
|
||||
//=====================================================================================
|
||||
if (getTryPendingDocBase() is not UserTestDoc try_pending_doc)
|
||||
{
|
||||
var new_pending_doc = new UserTestDoc();
|
||||
var origin_doc = getOriginDocBase<UserTestEntityAttribute>();
|
||||
if (origin_doc is not null)
|
||||
{
|
||||
new_pending_doc.copyTimestampsFromOriginDocBase(origin_doc);
|
||||
}
|
||||
|
||||
setTryPendingDocBase(new_pending_doc);
|
||||
try_pending_doc = (getTryPendingDocBase() as UserTestDoc)!;
|
||||
NullReferenceCheckHelper.throwIfNull(try_pending_doc, () => $"try_pending_doc is null !!!");
|
||||
}
|
||||
|
||||
var to_copy_user_test_attrib = try_pending_doc.getAttrib<UserTestAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(to_copy_user_test_attrib, () => $"to_copy_user_test_attrib is null !!!");
|
||||
to_copy_user_test_attrib.UserId = UserId;
|
||||
to_copy_user_test_attrib.Name = Name;
|
||||
|
||||
|
||||
// 읽기 용도가 아닌 경우
|
||||
if (false == isForQuery)
|
||||
{
|
||||
return (result, try_pending_doc);
|
||||
}
|
||||
|
||||
//=====================================================================================
|
||||
// Doc QueryType 반영
|
||||
//=====================================================================================
|
||||
(result, var to_query_doc) = await applyDoc4Query(try_pending_doc);
|
||||
return result.isFail() ? (result, null) : (result, to_query_doc);
|
||||
}
|
||||
|
||||
public override IEntityAttributeTransactor onNewEntityAttributeTransactor()
|
||||
{
|
||||
return new UserTestEntityAttributeTransactor(getOwner());
|
||||
}
|
||||
|
||||
public override EntityAttributeBase onCloned()
|
||||
{
|
||||
var owner = getOwner() as UserTestEntity;
|
||||
NullReferenceCheckHelper.throwIfNull(owner, () => $"owner is null !!!");
|
||||
|
||||
return new UserTestEntityAttribute(owner) { UserId = UserId, Name = Name };
|
||||
}
|
||||
|
||||
private class UserTestEntityAttributeTransactor : EntityAttributeTransactorBase<UserTestEntityAttribute>,
|
||||
ICopyEntityAttributeTransactorFromEntityAttribute
|
||||
{
|
||||
public UserTestEntityAttributeTransactor(EntityBase owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public bool copyEntityAttributeTransactorFromEntityAttribute(EntityAttributeBase? entityAttribute)
|
||||
{
|
||||
var err_msg = string.Empty;
|
||||
|
||||
var to_cast_string = nameof(UserTestEntityAttribute);
|
||||
|
||||
if (entityAttribute is not UserTestEntityAttribute copy_from_user_test_attribute)
|
||||
{
|
||||
err_msg =
|
||||
$"Failed to copyEntityAttributeTransactorBaseFromEntityAttribute() !!!, copy_from_user_test_attribute is null :{to_cast_string}";
|
||||
Log.getLogger().error(err_msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 롤백을 위해 객체를 복사한다.
|
||||
if (getClonedEntityAttribute() is not UserTestEntityAttribute copy_to_user_test_attribute)
|
||||
{
|
||||
err_msg =
|
||||
$"Failed to copyEntityAttributeTransactorBaseFromEntityAttribute() !!!, copy_to_user_test_attribute is null :{to_cast_string}";
|
||||
Log.getLogger().error(err_msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
copy_to_user_test_attribute.UserId = copy_from_user_test_attribute.UserId;
|
||||
copy_to_user_test_attribute.Name = copy_from_user_test_attribute.Name;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
38
BrokerApiTest/DocQuery/UserTestFindOneAction.cs
Normal file
38
BrokerApiTest/DocQuery/UserTestFindOneAction.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
public class UserTestFindOneAction : EntityActionBase
|
||||
{
|
||||
public UserTestFindOneAction(UserTestEntity owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit()
|
||||
{
|
||||
var result = new Result();
|
||||
return await Task.FromResult(result);
|
||||
}
|
||||
|
||||
public override void onClear()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> findUserOne(string userId, DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
ArgumentNullReferenceCheckHelper.throwIfNull(dynamoDbClient,
|
||||
() => $"dynamoDbClient is null !!! - {getOwner().toBasicString()}");
|
||||
var doc = new UserTestDoc(userId);
|
||||
var (result, result_doc) = await doc.findOne(dynamoDbClient);
|
||||
return (result, result_doc);
|
||||
}
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> findUserOne2(string userId, DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
ArgumentNullReferenceCheckHelper.throwIfNull(dynamoDbClient,
|
||||
() => $"dynamoDbClient is null !!! - {getOwner().toBasicString()}");
|
||||
var config = dynamoDbClient.makeQueryConfigForReadByPKOnly(userId);
|
||||
var (result, doc) = await dynamoDbClient.simpleQueryDocTypeWithQueryOperationConfig<UserTestDoc>(config);
|
||||
return (result, doc);
|
||||
}
|
||||
}
|
||||
29
BrokerApiTest/DocQuery/UserTestInsertAction.cs
Normal file
29
BrokerApiTest/DocQuery/UserTestInsertAction.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
public class UserTestInsertAction : EntityActionBase
|
||||
{
|
||||
public UserTestInsertAction(EntityBase owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit()
|
||||
{
|
||||
var result = new Result();
|
||||
return await Task.FromResult(result);
|
||||
}
|
||||
|
||||
public override void onClear()
|
||||
{
|
||||
}
|
||||
|
||||
// 실제 할 일을 정의한다.
|
||||
public async Task<(Result, UserTestDoc)> tryInsertUser(string userId, string name, DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
ArgumentNullReferenceCheckHelper.throwIfNull(dynamoDbClient, () => $"dynamoDbClient is null !!! - {getOwner().toBasicString()}");
|
||||
var doc = new UserTestDoc(userId, name);
|
||||
var result = await doc.insertUser(dynamoDbClient);
|
||||
return (result, doc);
|
||||
}
|
||||
}
|
||||
26
BrokerApiTest/DocQuery/UserTestUpdateOneAction.cs
Normal file
26
BrokerApiTest/DocQuery/UserTestUpdateOneAction.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
public class UserTestUpdateOneAction : EntityActionBase
|
||||
{
|
||||
public UserTestUpdateOneAction(UserTestEntity owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit()
|
||||
{
|
||||
var result = new Result();
|
||||
return await Task.FromResult(result);
|
||||
}
|
||||
|
||||
public override void onClear()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> updateOne(string userId, string userName, DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
var doc = new UserTestDoc(userId, userName);
|
||||
return await doc.updateOne(dynamoDbClient);
|
||||
}
|
||||
}
|
||||
151
BrokerApiTest/EntityTests/EntityMailTests.cs
Normal file
151
BrokerApiTest/EntityTests/EntityMailTests.cs
Normal file
@@ -0,0 +1,151 @@
|
||||
using BrokerCore.Common;
|
||||
using BrokerCore.Entity;
|
||||
using BrokerCore.Entity.Actions;
|
||||
|
||||
using BrokerTest.Helper;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
|
||||
using BrokerApiServer.Extensions;
|
||||
|
||||
namespace BrokerTest.Entity;
|
||||
|
||||
public class EntityMailTests : IAsyncLifetime
|
||||
{
|
||||
private readonly IServiceCollection m_services;
|
||||
|
||||
public EntityMailTests()
|
||||
{
|
||||
AppBuilderExtensions.initGlobalNlog();
|
||||
var config = AppBuilderExtensions.initBrokerServerConfig();
|
||||
m_services = new ServiceCollection();
|
||||
m_services.AddSingleton(config);
|
||||
m_services.addBrokerServerLogic(config);
|
||||
m_services.AddScoped<PlanetUserEntity>();
|
||||
}
|
||||
|
||||
public Task InitializeAsync()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
{
|
||||
var server_logic = m_services.BuildServiceProvider().GetService<IServerLogic>();
|
||||
server_logic?.getDynamoDbClient().getDbClient()?.Dispose();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task testMethod1()
|
||||
{
|
||||
await using var scope = m_services.BuildServiceProvider();
|
||||
var planet_user = scope.GetRequiredService<PlanetUserEntity>();
|
||||
await planet_user.onInit();
|
||||
planet_user.setPlanetId("new_earth");
|
||||
|
||||
var auth_action = planet_user.getEntityAction<UserAuthAction>();
|
||||
Assert.NotNull(auth_action);
|
||||
var result = await auth_action.findAndSetAllAttributeByAccountId("20462");
|
||||
Assert.NotNull(result);
|
||||
Assert.True(result.isSuccess());
|
||||
Assert.Equal("20462", planet_user.getEntityAttributeNotNull<AccountAttribute>().AccountId);
|
||||
|
||||
var server_logic = scope.GetRequiredService<IServerLogic>();
|
||||
|
||||
// 이미 받은 편지 삭제
|
||||
await delAllMails(planet_user, server_logic);
|
||||
|
||||
MetaTableTestHelper meta_table_test_helper = new();
|
||||
meta_table_test_helper.load();
|
||||
var meta_table_ref = meta_table_test_helper.getMetaTableRef();
|
||||
var product_policy_mata =
|
||||
meta_table_ref.MetaTable.PlanetItemExchangePolicyMetaTable.PlanetItemExchangePolicyDataList.FirstOrDefault(x =>
|
||||
x.CaliverseItemType == CaliverseItemType.CaliverseProduct.ToString());
|
||||
Assert.NotNull(product_policy_mata);
|
||||
|
||||
var mail_send_by_product_id = async (int productId) =>
|
||||
{
|
||||
var broker_mail = new BrokerMailEntity(planet_user, server_logic);
|
||||
result = await broker_mail.onInit();
|
||||
Assert.NotNull(result);
|
||||
Assert.True(result.isSuccess());
|
||||
|
||||
meta_table_ref.MetaTable.ProductMetaTable.ProductMetaDataListbyId.TryGetValue(
|
||||
productId, out var product_meta);
|
||||
Assert.NotNull(product_meta);
|
||||
|
||||
meta_table_ref.MetaTable.SystemMailMetaTable.SystemMailMetaDataListbyKey.TryGetValue(
|
||||
product_meta.SystemMail_First, out var mail_meta);
|
||||
Assert.NotNull(mail_meta);
|
||||
|
||||
var mail_send_action = broker_mail.getEntityActionNotNull<BrokerMailSendAction>();
|
||||
var mail_option = mail_send_action.createSystemSendMailOptionByMeta(product_meta, mail_meta, planet_user.UserGuid,
|
||||
planet_user.Nickname, 100);
|
||||
// var mail_option2 =
|
||||
// Helpers.createMailOptionByProductMeta(product_meta, mail_meta, planet_user.UserGuid,
|
||||
// planet_user.Nickname);
|
||||
result = await mail_send_action.sendMail(mail_option, () => Task.CompletedTask, () => Task.CompletedTask);
|
||||
Assert.NotNull(result);
|
||||
Assert.True(result.isSuccess());
|
||||
|
||||
var mail = broker_mail.getEntityAttributeNotNull<MailAttribute>();
|
||||
|
||||
var mail_recv_action = broker_mail.getEntityActionNotNull<BrokerMailRecvAction>();
|
||||
var (mail_recv_result, recv_mail_docs)
|
||||
= await mail_recv_action.findReceivedMailDoc(planet_user.UserGuid);
|
||||
Assert.NotNull(mail_recv_result);
|
||||
Assert.True(mail_recv_result.isSuccess());
|
||||
Assert.NotNull(recv_mail_docs);
|
||||
Assert.True(recv_mail_docs.Count > 0);
|
||||
var result_mail_attrib =
|
||||
recv_mail_docs.FirstOrDefault(x => x.getAttrib<MailAttrib>()?.MailGuid == mail.MailGuid);
|
||||
Assert.NotNull(result_mail_attrib);
|
||||
};
|
||||
|
||||
IEnumerable<int> product_ids = [3001, 3002, 3003, 3004];
|
||||
foreach (var product_id in product_ids)
|
||||
{
|
||||
await mail_send_by_product_id(product_id);
|
||||
await Task.Delay(10);
|
||||
}
|
||||
|
||||
// var product_ids = meta_table_ref.MetaTable.ProductMetaTable.ProductMetaDataList
|
||||
// .Take(10).Select(x => x.Id);
|
||||
// foreach (var product_id in product_ids)
|
||||
// {
|
||||
// await mail_send_by_product_id(product_id);
|
||||
// await Task.Delay(10);
|
||||
// }
|
||||
//
|
||||
// await delAllMails(planet_user, server_logic);
|
||||
}
|
||||
|
||||
private async Task delAllMails(PlanetUserEntity planetUser, IServerLogic serverLogic)
|
||||
{
|
||||
//==========================================
|
||||
// 이미 받은 편지 삭제
|
||||
//==========================================
|
||||
var broker_mail_receiver = new BrokerMailEntity(planetUser, serverLogic);
|
||||
var result = await broker_mail_receiver.onInit();
|
||||
Assert.NotNull(result);
|
||||
Assert.True(result.isSuccess());
|
||||
var mail_recv_action = broker_mail_receiver.getEntityActionNotNull<BrokerMailRecvAction>();
|
||||
{
|
||||
var (recv_result, recv_mails) = await mail_recv_action.findReceivedMailDoc(planetUser.UserGuid);
|
||||
Assert.NotNull(recv_result);
|
||||
Assert.True(recv_result.isSuccess());
|
||||
foreach (var attrib in recv_mails.Select(recvMail => recvMail.getAttrib<MailAttrib>()))
|
||||
{
|
||||
Assert.NotNull(attrib);
|
||||
var result_del = await mail_recv_action.deleteMail(attrib.MailGuid);
|
||||
Assert.NotNull(result_del);
|
||||
Assert.True(result_del.isSuccess());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
90
BrokerApiTest/EntityTests/EntityTests.cs
Normal file
90
BrokerApiTest/EntityTests/EntityTests.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
namespace BrokerTest.Entity;
|
||||
|
||||
|
||||
using BrokerCore;
|
||||
using BrokerCore.Entity;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
|
||||
public class EntityTests
|
||||
{
|
||||
private readonly BrokerServerLogic m_logic;
|
||||
|
||||
// BrokerServerLogic 내에서 초기화 됨
|
||||
private readonly DynamoDbClient m_dynamo_db_client;
|
||||
|
||||
// BrokerServerLogic 내에서 초기화 됨
|
||||
private readonly ServerConfigMetaverseBroker m_server_config;
|
||||
private const string TestAccountId = "20462"; // tenafter71@gmail.com
|
||||
|
||||
public EntityTests()
|
||||
{
|
||||
var server_config = new ServerConfigMetaverseBroker();
|
||||
var server_config_path = "./Config/ServerConfig.json";
|
||||
server_config.setConfigFilePath(server_config_path);
|
||||
var result = server_config.tryLoadConfig().GetAwaiter().GetResult();
|
||||
|
||||
m_server_config = server_config;
|
||||
|
||||
m_logic = new BrokerServerLogic(server_config);
|
||||
m_logic.onInit().Wait();
|
||||
m_dynamo_db_client = m_logic.getDynamoDbClient();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task userBaseTest()
|
||||
{
|
||||
// var server_logic = new BrokerServerLogic();
|
||||
// var user = new UserEntity();
|
||||
// var initializers = new Initializers();
|
||||
// initializers.appendInitializer(user);
|
||||
//
|
||||
// foreach (var user_entity in initializers.getInitializers().Cast<UserEntity?>())
|
||||
// {
|
||||
// _ = user_entity?.onInit();
|
||||
// }
|
||||
//
|
||||
// var action = user.getEntityAction<UserLoginAction>();
|
||||
// var result = await action.onInit();
|
||||
// result = await action.login("account_id");
|
||||
// Assert.True(result.isSuccess());
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task userAuthEntityTest()
|
||||
{
|
||||
await m_logic.onInit();
|
||||
var user_entity = new PlanetUserEntity(m_logic);
|
||||
await user_entity.onInit();
|
||||
|
||||
var user_auth_action = user_entity.getEntityActionNotNull<UserAuthAction>();
|
||||
var (result, account_base_doc) = await user_auth_action.findAccountDoc(TestAccountId);
|
||||
|
||||
var account_attribute = user_entity.getEntityAttributeNotNull<AccountAttribute>();
|
||||
account_attribute.copyEntityAttributeFromDoc(account_base_doc);
|
||||
Assert.Equal(TestAccountId, account_attribute.AccountId);
|
||||
|
||||
var user_attribute = user_entity.getEntityAttributeNotNull<UserAttribute>();
|
||||
|
||||
(result, var user_doc) = await user_auth_action.findUserDoc(account_attribute.UserGuid);
|
||||
Assert.NotNull(user_doc);
|
||||
|
||||
user_attribute.copyEntityAttributeFromDoc(user_doc);
|
||||
Assert.NotEmpty(user_attribute.UserGuid);
|
||||
Assert.Equal(TestAccountId, user_attribute.AccountId);
|
||||
Assert.Equal(account_attribute.UserGuid, user_attribute.UserGuid);
|
||||
|
||||
await user_auth_action.findNicknameDoc(account_attribute.UserGuid);
|
||||
(result, var nickname_doc) = await user_auth_action.findNicknameDoc(account_attribute.UserGuid);
|
||||
Assert.NotNull(nickname_doc);
|
||||
var user_nickname = user_entity.getEntityAttribute<NicknameAttribute>();
|
||||
Assert.NotNull(user_nickname);
|
||||
await user_nickname.onInit();
|
||||
user_nickname.copyEntityAttributeFromDoc(nickname_doc);
|
||||
Assert.NotEmpty(user_nickname.Nickname);
|
||||
}
|
||||
}
|
||||
37
BrokerApiTest/Etc/EnumHelperTest.cs
Normal file
37
BrokerApiTest/Etc/EnumHelperTest.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace BrokerTest.Etc;
|
||||
|
||||
using MetaAssets;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
public class EnumHelperTest
|
||||
{
|
||||
[Fact]
|
||||
public void parseEnum1Test()
|
||||
{
|
||||
{
|
||||
var myhome_edit_guide_url = ServerUrlType.MyhomeEditGuideUrl.ToString();
|
||||
var server_url_type = myhome_edit_guide_url.convertEnumTypeAndValueStringToEnum(ServerUrlType.None);
|
||||
Assert.Equal(ServerUrlType.MyhomeEditGuideUrl, server_url_type);
|
||||
}
|
||||
{
|
||||
var enum_string = EntityType.Quest.ToString().ToLower();
|
||||
var converted_type = enum_string.convertEnumTypeAndValueStringToEnum(EntityType.None);
|
||||
Assert.Equal(EntityType.Quest, converted_type);
|
||||
}
|
||||
{
|
||||
//EQuestType
|
||||
var enum_string = EQuestType.TUTORIAL.ToString().ToLower();
|
||||
var converted_type = enum_string.convertEnumTypeAndValueStringToEnum(EQuestType.NONE);
|
||||
Assert.Equal(EQuestType.TUTORIAL, converted_type);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "enum 형 대소문자 무시 변환 테스트")]
|
||||
public void enumConvertIgnoreCaseTest()
|
||||
{
|
||||
var enum_string = "MYHOMEEDITGuideURL";// ServerUrlType.MyhomeEditGuideUrl.ToString();
|
||||
var server_url_type = enum_string.convertEnumTypeAndValueStringToEnum(ServerUrlType.None);
|
||||
Assert.Equal(ServerUrlType.MyhomeEditGuideUrl, server_url_type);
|
||||
}
|
||||
}
|
||||
35
BrokerApiTest/Etc/SecurityKeyTests.cs
Normal file
35
BrokerApiTest/Etc/SecurityKeyTests.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using BrokerCore.Common;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BrokerTest.Etc;
|
||||
|
||||
public class SecurityKeyTests
|
||||
{
|
||||
// Constructor
|
||||
// public SecurityKeyTests(ILogger<SecurityKeyTests> logger)
|
||||
// {
|
||||
// this.m_logger = logger;
|
||||
// }
|
||||
//
|
||||
// private readonly ILogger<SecurityKeyTests> m_logger;
|
||||
|
||||
// Test method to check if the security key is generated correctly
|
||||
[Fact]
|
||||
public void testSecurityKeyGeneration()
|
||||
{
|
||||
var result_hex = Helpers.generateSecureKey(32, false);
|
||||
var result_base64 = Helpers.generateSecureKey(32, true);
|
||||
Assert.NotNull(result_hex);
|
||||
Assert.NotEmpty(result_base64);
|
||||
}
|
||||
//
|
||||
// // Test method to check if the security key is valid
|
||||
// [Fact]
|
||||
// public void testSecurityKey()
|
||||
// {
|
||||
// var result_key = Helpers.generateSecureKey();
|
||||
// Assert.NotNull(result_key);
|
||||
// Assert.NotEmpty(result_key);
|
||||
// }
|
||||
}
|
||||
135
BrokerApiTest/Helper/BrokerTestServer.cs
Normal file
135
BrokerApiTest/Helper/BrokerTestServer.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using NLog.Extensions.Logging;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
namespace BrokerTest.Helper;
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
using BrokerApiServer.Common;
|
||||
using BrokerApiServer.Controllers;
|
||||
using BrokerApiServer.Extensions;
|
||||
|
||||
using CaliGameApi.Middlewares;
|
||||
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
public interface IBrokerTestServer
|
||||
{
|
||||
HttpClient getTestClient();
|
||||
TService? getRequiredService<TService>() where TService : class;
|
||||
}
|
||||
|
||||
public interface IBrokerTestServerLocal: IBrokerTestServer
|
||||
{
|
||||
TService? getService<TService>(in IServiceScope scope) where TService : class;
|
||||
}
|
||||
|
||||
public class BrokerTestServerFactory
|
||||
{
|
||||
public static IBrokerTestServer createServer()
|
||||
{
|
||||
return new BrokerTestServer();
|
||||
}
|
||||
|
||||
public static IBrokerTestServer createRemoteServer(string baseUrl)
|
||||
{
|
||||
return new BrokerTestRemoteServer(baseUrl);
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokerTestRemoteServer: IBrokerTestServer
|
||||
{
|
||||
private readonly string m_base_url;
|
||||
|
||||
public BrokerTestRemoteServer(string baseUrl)
|
||||
{
|
||||
m_base_url = baseUrl;
|
||||
}
|
||||
|
||||
public HttpClient getTestClient()
|
||||
{
|
||||
return new HttpClient { BaseAddress = new Uri(m_base_url) };
|
||||
}
|
||||
|
||||
public TService? getRequiredService<TService>() where TService : class
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class BrokerTestServer: IBrokerTestServerLocal
|
||||
{
|
||||
private readonly WebApplication m_server;
|
||||
|
||||
public BrokerTestServer()
|
||||
{
|
||||
m_server = runWebApp();
|
||||
Assert.NotNull(m_server);
|
||||
}
|
||||
|
||||
WebApplication runWebApp()
|
||||
{
|
||||
var port = 12000;
|
||||
var cmd_options = new string[] { "--urls", $"http://localhost:{port}" };
|
||||
// Arrange
|
||||
var builder = WebApplication.CreateBuilder(cmd_options);
|
||||
builder.Logging.AddNLog(new NLogProviderOptions{ ReplaceLoggerFactory = true });
|
||||
builder.Logging.AddConsole();
|
||||
builder.addAppServices();
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
// builder.Services.AddControllers(options => { options.Filters.Add(new ResultExceptionFilter()); });
|
||||
var assembly = Assembly.GetAssembly(typeof(PlanetUserController));
|
||||
Assert.NotNull(assembly);
|
||||
builder.Services.AddControllers(options => { options.Filters.Add(new ResultExceptionFilter()); })
|
||||
.AddApplicationPart(assembly); // 이유는 모르겠지만 이게 없으면 테스트에서 404 에러 발생 - 컨트롤러가 없음
|
||||
builder.Services.AddHealthChecks();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
|
||||
var app = builder.Build();
|
||||
app.UseHttpsRedirection();
|
||||
app.UseRouting();
|
||||
app.UseCors("Everything");
|
||||
app.UseMiddleware<ResultLoggingMiddleware>();
|
||||
app.UseAuthorization();
|
||||
app.MapControllers();
|
||||
app.MapHealthChecks("/healthcheck");
|
||||
|
||||
app.validateRepoConnections();
|
||||
app.brokerServerLogicInit();
|
||||
app.metadataMangerInit(TestDefines.MetaDataPath);
|
||||
|
||||
app.Services.GetRequiredService<IHostApplicationLifetime>().ApplicationStarted.Register(() =>
|
||||
{
|
||||
// Log.getLogger().info($"Env : {app.Environment.EnvironmentName}");
|
||||
// Log.getLogger().info($"BrokerApiServer started {port}");
|
||||
// todo 왜 enpoints가 1개 뿐이지?
|
||||
Console.WriteLine($"Env : {app.Environment.EnvironmentName}");
|
||||
});
|
||||
// app.Services.GetRequiredService<IHostApplicationLifetime>().ApplicationStopped.Register(Log.shutdown);
|
||||
app.RunAsync().ConfigureAwait(false);
|
||||
return app;
|
||||
}
|
||||
|
||||
public HttpClient getTestClient()
|
||||
{
|
||||
var url = m_server.Urls.FirstOrDefault()?.ToString() ?? "http://localhost:12000";
|
||||
var http_client = new HttpClient();
|
||||
http_client.BaseAddress = new Uri(url);
|
||||
return http_client;
|
||||
}
|
||||
|
||||
public TService? getRequiredService<TService>() where TService : class
|
||||
{
|
||||
return m_server.Services.GetRequiredService<TService>();
|
||||
}
|
||||
|
||||
public TService? getService<TService>(in IServiceScope scope) where TService : class
|
||||
{
|
||||
return scope.ServiceProvider.GetRequiredService<TService>();
|
||||
}
|
||||
}
|
||||
19
BrokerApiTest/Helper/DocRepo/AccountDocRepo.cs
Normal file
19
BrokerApiTest/Helper/DocRepo/AccountDocRepo.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// public class AccountDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public AccountDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, AccountBaseAttrib?)> findAccountBaseAttrib(string accountId)
|
||||
// {
|
||||
// var (result, doc) = await AccountBaseDoc.findUserGuidFromAccountId(m_dynamo_db_client, accountId);
|
||||
// return (result, doc?.getAttrib<AccountBaseAttrib>());
|
||||
// }
|
||||
// }
|
||||
53
BrokerApiTest/Helper/DocRepo/CaliumEventDocRepo.cs
Normal file
53
BrokerApiTest/Helper/DocRepo/CaliumEventDocRepo.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using ServerCommon;
|
||||
// using ServerCommon.EchoSystem.Models;
|
||||
//
|
||||
// using ServerCore; using ServerBase;
|
||||
//
|
||||
// public class CaliumEventDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public CaliumEventDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// // public async Task<(Result, CaliumEventAttrib?)> createOne(string userGuid)
|
||||
// // {
|
||||
// // var (result_pk, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<CaliumEventDoc>(userGuid);
|
||||
// // if (result_pk.isFail() || primary_key_object == null)
|
||||
// // {
|
||||
// // return (result_pk, null);
|
||||
// // }
|
||||
// //
|
||||
// // var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// // var (result, doc) =
|
||||
// // await m_dynamo_db_client.simpleInsertDocument<CaliumEventDoc>(config);
|
||||
// // var attrib = doc?.getAttrib<CaliumEventAttrib>();
|
||||
// // return (result, attrib);
|
||||
// // }
|
||||
// public async Task<string> createOne(string userGuid, CaliumEventRequest request, bool isRetry)
|
||||
// {
|
||||
// var doc = new CaliumEventDoc(request.m_event_id);
|
||||
// var attrib = doc.getAttrib<CaliumEventAttrib>();
|
||||
// NullReferenceCheckHelper.throwIfNull(attrib, () => $"calium event attrib is null !!! - userGuid[{userGuid}]");
|
||||
//
|
||||
// attrib.UserGuid = userGuid;
|
||||
// attrib.EventData.m_server_type = request.m_server_type;
|
||||
// attrib.EventData.m_event_type = request.m_event_type;
|
||||
// attrib.EventData.m_sub_type = request.m_sub_type;
|
||||
// attrib.EventData.m_div_type = request.m_div_type;
|
||||
// attrib.EventData.m_div_id = request.m_div_id;
|
||||
// attrib.EventData.m_calium_delta = request.m_calium_delta;
|
||||
// attrib.EventData.m_sapphire_delta = request.m_sapphire_delta;
|
||||
// attrib.EventData.m_current_epoch = request.m_current_epoch;
|
||||
// attrib.EventData.m_current_inflation_rate = request.m_current_inflation_rate;
|
||||
// attrib.Status = isRetry ? CaliumEventStatus.Regist : CaliumEventStatus.Failed;
|
||||
//
|
||||
// await m_dynamo_db_client.simpleInsertDocumentWithDocType(doc);
|
||||
// return request.m_event_id;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
28
BrokerApiTest/Helper/DocRepo/CaliumStorageDocRepo.cs
Normal file
28
BrokerApiTest/Helper/DocRepo/CaliumStorageDocRepo.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// public class CaliumStorageDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public CaliumStorageDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, CaliumStorageAttrib?)> findOne(string userGuid)
|
||||
// {
|
||||
// var (result_pk, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<CaliumStorageDoc>(userGuid);
|
||||
// if (result_pk.isFail() || primary_key_object == null)
|
||||
// {
|
||||
// return (result_pk, null);
|
||||
// }
|
||||
//
|
||||
// var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// var (result, doc) =
|
||||
// await m_dynamo_db_client.simpleQueryDocTypeWithQueryOperationConfig<CaliumStorageDoc>(config);
|
||||
// var attrib = doc?.getAttrib<CaliumStorageAttrib>();
|
||||
// return (result, attrib);
|
||||
// }
|
||||
// }
|
||||
30
BrokerApiTest/Helper/DocRepo/CaliumStorageRepo.cs
Normal file
30
BrokerApiTest/Helper/DocRepo/CaliumStorageRepo.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using Common;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// public class CaliumStorageRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public CaliumStorageRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, CaliumStorageAttrib?)> findOne(string userGuid)
|
||||
// {
|
||||
// var (result_pk, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<CaliumStorageDoc>(userGuid);
|
||||
// if (result_pk.isFail() || primary_key_object == null)
|
||||
// {
|
||||
// return (result_pk, null);
|
||||
// }
|
||||
//
|
||||
// var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// var (result, doc) =
|
||||
// await m_dynamo_db_client.simpleQueryDocTypeWithQueryOperationConfig<CaliumStorageDoc>(config);
|
||||
// var attrib = doc?.getAttrib<CaliumStorageAttrib>();
|
||||
// return (result, attrib);
|
||||
// }
|
||||
// }
|
||||
445
BrokerApiTest/Helper/DocRepo/MoneyDocRepo.cs
Normal file
445
BrokerApiTest/Helper/DocRepo/MoneyDocRepo.cs
Normal file
@@ -0,0 +1,445 @@
|
||||
// using Amazon.DynamoDBv2;
|
||||
// using Amazon.DynamoDBv2.Model;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// using ServerCore; using ServerBase;
|
||||
//
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using BrokerApiServer.Common;
|
||||
//
|
||||
// public class BrokerApiLogActor : ILogActor
|
||||
// {
|
||||
// public string getActorGuid() => "broker";
|
||||
// }
|
||||
//
|
||||
// public class BrokerApiWithLogActor : EntityBase, IWithLogActor
|
||||
// {
|
||||
// public readonly EntityType m_entity_type = EntityType.Money;
|
||||
//
|
||||
// public BrokerApiWithLogActor() : base(EntityType.Money)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// //public BrokerApiWithLogActor(string masterGuid) : base(EntityType.Money, masterGuid)
|
||||
// //{
|
||||
// //}
|
||||
//
|
||||
// public ILogActor toLogActor()
|
||||
// {
|
||||
// return new BrokerApiLogActor();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public class DbqChangeSapphire : QueryExecutorBase
|
||||
// {
|
||||
// private readonly double m_delta;
|
||||
// private PrimaryKey? m_primary_key;
|
||||
// private readonly string m_user_guid;
|
||||
//
|
||||
// public DbqChangeSapphire(string userGuid, double delta) : base(nameof(DbqChangeSapphire))
|
||||
// {
|
||||
// m_delta = delta;
|
||||
// m_user_guid = userGuid;
|
||||
// }
|
||||
//
|
||||
// public override async Task<Result> onPrepareQuery()
|
||||
// {
|
||||
// (var result, m_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<MoneyDoc>(m_user_guid);
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// public override async Task<Result> onQuery()
|
||||
// {
|
||||
// var owner = getOwner();
|
||||
//
|
||||
// // 부모 인스턴스의 정보를 사용하여 필요한 데이터를 가져온다. (여기서는 ...)
|
||||
// var query_batch = getQueryBatch() as QueryBatch<QueryRunnerWithItemRequest>;
|
||||
// NullReferenceCheckHelper.throwIfNull(query_batch, () => $"query_batch is null !!! - {owner.toBasicString()}");
|
||||
//
|
||||
// var query_runner_with_item_request = query_batch.getQueryRunner();
|
||||
// NullReferenceCheckHelper.throwIfNull(query_runner_with_item_request,
|
||||
// () => $"query_runner_with_item_request is null !!! - {owner.toBasicString()}");
|
||||
//
|
||||
// var db_connector = query_batch.getDynamoDbConnector();
|
||||
// var (result, update_request) = makeUpdateItemRequest();
|
||||
// if (result.isFail())
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// NullReferenceCheckHelper.throwIfNull(update_request,
|
||||
// () => $"update_request is null !!! - {owner.toBasicString()}");
|
||||
//
|
||||
// var exception_handler = new DynamoDbQueryExceptionNotifier.ExceptionHandler(
|
||||
// DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.LackOfTotalCalium);
|
||||
//
|
||||
// var query_context = update_request.createItemRequestQueryContext(QueryType.Update, exception_handler);
|
||||
// return await query_runner_with_item_request.tryRegisterQueryContext(query_context);
|
||||
// }
|
||||
//
|
||||
// //=====================================================================================
|
||||
// // DB 쿼리를 성공하고, doFnCommit()가 QueryResultType.NotCalledQueryFunc를 반환할 경우 호출된다.
|
||||
// //=====================================================================================
|
||||
// public override Task onQueryResponseCommit()
|
||||
// {
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
//
|
||||
// //=====================================================================================
|
||||
// // DB 쿼리를 실패하고, doFnRollback()가 QueryResultType.NotCalledQueryFunc를 반환할 경우 호출된다.
|
||||
// //=====================================================================================
|
||||
// public override Task onQueryResponseRollback(Result errorResult)
|
||||
// {
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
//
|
||||
// private (Result, UpdateItemRequest?) makeUpdateItemRequest()
|
||||
// {
|
||||
// Guard.Against.isNull(m_primary_key, (BrokerApiErrorCode)ServerErrorCode.DynamoDbPrimaryKeyNotFound, "primary key is null");
|
||||
// var attribute_value_with_primary_key = m_primary_key.toKeyWithAttributeValue();
|
||||
//
|
||||
// var currency_name = MoneyAttribExtensions.getKeyNameFromType(CurrencyType.Sapphire);
|
||||
// var result = new Result();
|
||||
// var dynamo_db_client = getQueryBatch()?.getDynamoDbConnector();
|
||||
// NullReferenceCheckHelper.throwIfNull(dynamo_db_client, () => $"dynamo_db_client is null !!!");
|
||||
//
|
||||
// var query_builder = new DynamoDbItemRequestHelper.UpdateItemRequestBuilder(dynamo_db_client.getTableName());
|
||||
// query_builder.withKeys(attribute_value_with_primary_key);
|
||||
//
|
||||
// var target_doc = new MoneyDoc();
|
||||
// var attrib_path_json_string = target_doc.toJsonStringOfAttribs();
|
||||
// var target_key = JsonHelper.getJsonPropertyName<MoneyAttrib>(currency_name);
|
||||
// var (is_success, attribute_expression) =
|
||||
// DynamoDbClientHelper.toAttributeExpressionFromJson(attrib_path_json_string, target_key);
|
||||
// if (false == is_success)
|
||||
// {
|
||||
// var err_msg =
|
||||
// $"Failed to DynamoDbClientHelper.toAttributeExpressionFromJson() !!! : attribPath:{attrib_path_json_string}, targetKey:{target_key}";
|
||||
// result.setFail(ServerErrorCode.AttribPathMakeFailed, err_msg);
|
||||
// Log.getLogger().error(result.toBasicString());
|
||||
//
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// query_builder.withExpressionAttributeNames(
|
||||
// DynamoDbClientHelper.toExpressionAttributeNamesFromJson(attrib_path_json_string, target_key));
|
||||
//
|
||||
// var update_expression = (m_delta >= 0)
|
||||
// ? $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) + :changeValue"
|
||||
// : $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) - :changeValue";
|
||||
// query_builder.withUpdateExpression(update_expression);
|
||||
//
|
||||
// var expression_attribute_values = new Dictionary<string, AttributeValue>
|
||||
// {
|
||||
// { ":changeValue", new AttributeValue { N = Math.Abs(m_delta).ToString() } },
|
||||
// { ":start", new AttributeValue { N = "0" } }
|
||||
// };
|
||||
// query_builder.withExpressionAttributeValues(expression_attribute_values);
|
||||
// query_builder.withReturnValues(ReturnValue.ALL_NEW);
|
||||
// return query_builder.build();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public class MoneyDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public MoneyDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, MoneyDoc?)> findMoneyDoc(string userGuid)
|
||||
// {
|
||||
// var (result, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<MoneyDoc>(userGuid);
|
||||
// if (result.isFail() || primary_key_object == null)
|
||||
// {
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// return await m_dynamo_db_client.simpleQueryDocTypeWithQueryOperationConfig<MoneyDoc>(config);
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, MoneyAttrib?)> findMoneyAttrib(string userGuid, CancellationToken cancellationToken)
|
||||
// {
|
||||
// var (result, doc) = await findMoneyDoc(userGuid);
|
||||
// return (result, doc?.getAttrib<MoneyAttrib>());
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, MoneyAttrib?)> changeSapphire(string userGuid, double delta)
|
||||
// {
|
||||
// var (result, make_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<MoneyDoc>(userGuid);
|
||||
// // 프라이머리 키 생성 실패
|
||||
// if (result.isFail() || make_primary_key == null)
|
||||
// {
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// (result, var request) = makeUpdateItemRequest(
|
||||
// make_primary_key.toKeyWithAttributeValue(),
|
||||
// MoneyAttribExtensions.getKeyNameFromType(CurrencyType.Sapphire),
|
||||
// delta);
|
||||
// // 업데이트 쿼리 생성 실패
|
||||
// if (result.isFail() || request == null)
|
||||
// {
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// (result, var update_doc) = await m_dynamo_db_client.simpleQueryDocTypesWithUpdateItemRequest<MoneyDoc>(request);
|
||||
// // 업데이트 쿼리 실패
|
||||
// if (result.isFail() || update_doc == null) return (result, null);
|
||||
//
|
||||
// var attrib = update_doc.getAttrib<MoneyAttrib>();
|
||||
// // 업데이트 된 문서에서 MoneyAttrib을 찾을 수 없음
|
||||
// if (attrib == null)
|
||||
// {
|
||||
// result.setFail(ServerErrorCode.AttribNotFound, $"attrib is null !!!");
|
||||
// return (result, null);
|
||||
// }
|
||||
// return (result, attrib);
|
||||
// }
|
||||
//
|
||||
// private async Task<Result> sendQuery(QueryBatchBase batch)
|
||||
// {
|
||||
// var result = new Result();
|
||||
// var err_msg = string.Empty;
|
||||
//
|
||||
// if (batch == null)
|
||||
// {
|
||||
// err_msg = $"Failed to sendQuery !!!, QueryBatchBase is null";
|
||||
// result.setFail(ServerErrorCode.FunctionInvalidParam, err_msg);
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// if (false == batch.hasQuery())
|
||||
// {
|
||||
// err_msg = $"Not has DBQuery !!!";
|
||||
// result.setFail(ServerErrorCode.DynamoDbQueryNoRequested, err_msg);
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// result = await batch.prepareQueryWithStopwatch();
|
||||
// if (result.isFail())
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// result = await batch.doQueryWithStopwatch();
|
||||
// if (result.isFail())
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// private (Result, UpdateItemRequest?) makeUpdateItemRequest(
|
||||
// Dictionary<string, AttributeValue> attributeValueWithPrimaryKey
|
||||
// , string targetAttribName
|
||||
// , double deltaCount)
|
||||
// {
|
||||
// var result = new Result();
|
||||
// var query_builder = new DynamoDbItemRequestHelper.UpdateItemRequestBuilder(m_dynamo_db_client.getTableName());
|
||||
// query_builder.withKeys(attributeValueWithPrimaryKey);
|
||||
//
|
||||
// var target_doc = new MoneyDoc();
|
||||
// var attrib_path_json_string = target_doc.toJsonStringOfAttribs();
|
||||
// var target_key = JsonHelper.getJsonPropertyName<MoneyAttrib>(targetAttribName);
|
||||
// var (is_success, attribute_expression) =
|
||||
// DynamoDbClientHelper.toAttributeExpressionFromJson(attrib_path_json_string, target_key);
|
||||
// if (false == is_success)
|
||||
// {
|
||||
// var err_msg =
|
||||
// $"Failed to DynamoDbClientHelper.toAttributeExpressionFromJson() !!! : attribPath:{attrib_path_json_string}, targetKey:{target_key}";
|
||||
// result.setFail(ServerErrorCode.AttribPathMakeFailed, err_msg);
|
||||
// Log.getLogger().error(result.toBasicString());
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// query_builder.withExpressionAttributeNames(
|
||||
// DynamoDbClientHelper.toExpressionAttributeNamesFromJson(attrib_path_json_string, target_key));
|
||||
//
|
||||
// var update_expression = (deltaCount >= 0)
|
||||
// ? $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) + :changeValue"
|
||||
// : $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) - :changeValue";
|
||||
// query_builder.withUpdateExpression(update_expression);
|
||||
//
|
||||
// var expression_attribute_values = new Dictionary<string, AttributeValue>
|
||||
// {
|
||||
// { ":changeValue", new AttributeValue { N = Math.Abs(deltaCount).ToString() } },
|
||||
// { ":start", new AttributeValue { N = "0" } }
|
||||
// };
|
||||
// query_builder.withExpressionAttributeValues(expression_attribute_values);
|
||||
// query_builder.withReturnValues(ReturnValue.ALL_NEW);
|
||||
// return query_builder.build();
|
||||
// }
|
||||
//
|
||||
// // //=============================================================================================
|
||||
// // // delta 만큼 금전을 변경(음수, 양수) 한다.
|
||||
// // //=============================================================================================
|
||||
// // public async Task<Result> changeMoney(CurrencyType currencyType, double delta, bool isTrimExcess = false,
|
||||
// // bool useCaliumEvent = true)
|
||||
// // {
|
||||
// // var result = new Result();
|
||||
// //
|
||||
// // // var owner = getOwner() as Player;
|
||||
// // // NullReferenceCheckHelper.throwIfNull(owner, () => $"player is null !!!");
|
||||
// //
|
||||
// // // if (currencyType == CurrencyType.Beam)
|
||||
// // // {
|
||||
// // // var found_transaction_runner = owner.findTransactionRunner(TransactionIdType.PrivateContents);
|
||||
// // // found_transaction_runner?.addRemoteChargeAIPoint(this, delta);
|
||||
// // // return result;
|
||||
// // // }
|
||||
// //
|
||||
// // result = changeMoneyFromCurrencyType(currencyType, delta, isTrimExcess);
|
||||
// // if (result.isSuccess() && useCaliumEvent)
|
||||
// // {
|
||||
// // var found_transaction_runner = owner.findTransactionRunner(TransactionIdType.PrivateContents);
|
||||
// // var event_name = found_transaction_runner?.getTransactionName() ?? "None";
|
||||
// // found_transaction_runner?.addNotifyCaliumEvent(this, event_name, currencyType, delta);
|
||||
// // }
|
||||
// //
|
||||
// // return await Task.FromResult(result);
|
||||
// // }
|
||||
// //
|
||||
// // private Result changeMoneyFromCurrencyType(CurrencyType type, double delta, bool isTrimExcess = false)
|
||||
// // {
|
||||
// // var result = new Result();
|
||||
// // var err_msg = string.Empty;
|
||||
// //
|
||||
// // // var owner = getOwner() as Player;
|
||||
// // // NullReferenceCheckHelper.throwIfNull(owner, () => $"player is null !!!");
|
||||
// //
|
||||
// // if (MetaData.Instance._CurrencyMetaTableByCurrencyType.TryGetValue(type, out var currencyMetaData) == false)
|
||||
// // {
|
||||
// // // err_msg = $"Not found CurrencyMetaData !!! : currencyType:{type} - {owner.toBasicString()}";
|
||||
// // result.setFail(ServerErrorCode.CurrencyMetaDataNotFound, err_msg);
|
||||
// // Log.getLogger().error(result.toBasicString());
|
||||
// //
|
||||
// // return result;
|
||||
// // }
|
||||
// //
|
||||
// // // var money_attribute = owner.getEntityAttribute<MoneyAttribute>();
|
||||
// // // NullReferenceCheckHelper.throwIfNull(money_attribute,
|
||||
// // // () => $"money_attribute is null !!! - {owner.toBasicString()}");
|
||||
// //
|
||||
// // var currency = money_attribute.getCurrencyFromType(type);
|
||||
// // var change = currency + delta;
|
||||
// // if (change < 0)
|
||||
// // {
|
||||
// // err_msg =
|
||||
// // $"Failed to change getCurrencyFromType() !!!, not enough Money : deltaMoney:{delta}, changeCurrency:{change}, currencyType:{type} - {owner.toBasicString()}";
|
||||
// // result.setFail(ServerErrorCode.MoneyNotEnough, err_msg);
|
||||
// // Log.getLogger().error(result.toBasicString());
|
||||
// //
|
||||
// // return result;
|
||||
// // }
|
||||
// //
|
||||
// // if (change >= currencyMetaData.MaxCount)
|
||||
// // {
|
||||
// // MoneyNotifyHelper.send_GS2C_NTF_CURRENCY_MAX_ALERT(owner, type, currencyMetaData.MaxCount);
|
||||
// //
|
||||
// // if (change > currencyMetaData.MaxCount
|
||||
// // && false == isTrimExcess)
|
||||
// // {
|
||||
// // err_msg =
|
||||
// // $"Money exceeded Max Count !!! : toDelta:{delta}, toChange:{change} <= MaxCount:{currencyMetaData.MaxCount}, currencyType:{type} - {owner.toBasicString()}";
|
||||
// // result.setFail(ServerErrorCode.MoneyMaxCountExceeded, err_msg);
|
||||
// // Log.getLogger().error(result.toBasicString());
|
||||
// //
|
||||
// // return result;
|
||||
// // }
|
||||
// //
|
||||
// // var trim_money = change - currencyMetaData.MaxCount;
|
||||
// // change = double.Min(change, currencyMetaData.MaxCount);
|
||||
// //
|
||||
// // err_msg =
|
||||
// // $"Exceeded MaxCount of Money !!!, Trimming Money : currencyType:{type}, changeMoney:{change}, trimMoney:{trim_money}, deltaMoney:{delta}, maxMoney:{currencyMetaData.MaxCount} - {owner.toBasicString()}";
|
||||
// // Log.getLogger().info(err_msg);
|
||||
// // }
|
||||
// //
|
||||
// // money_attribute.setCurrencyFromType(type, change);
|
||||
// //
|
||||
// // money_attribute.modifiedEntityAttribute();
|
||||
// //
|
||||
// // return result;
|
||||
// // }
|
||||
// //
|
||||
// //
|
||||
// // public TransactionRunner? findTransactionRunner(TransactionIdType transactionIdType)
|
||||
// // {
|
||||
// // TransactionRunner? found_transaction_runner = null;
|
||||
// //
|
||||
// // var err_msg = string.Empty;
|
||||
// //
|
||||
// // if (true == hasMasterGuid())
|
||||
// // {
|
||||
// // var master_guid = getMasterGuid();
|
||||
// // var found_master_entity = onGetMasterEntity();
|
||||
// // if(null == found_master_entity)
|
||||
// // {
|
||||
// // return null;
|
||||
// // }
|
||||
// //
|
||||
// // found_transaction_runner = found_master_entity.findTransactionRunner(transactionIdType);
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // if (false == m_transaction_runners.TryGetValue(transactionIdType, out found_transaction_runner))
|
||||
// // {
|
||||
// // return null;
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// // return found_transaction_runner;
|
||||
// // }
|
||||
//
|
||||
// // private (Result, UpdateItemRequest?) makeUpdateItemRequest(
|
||||
// // Dictionary<string, AttributeValue> attributeValueWithPrimaryKey
|
||||
// // , string targetAttribName
|
||||
// // , double deltaCount)
|
||||
// // {
|
||||
// // var result = new Result();
|
||||
// //
|
||||
// // var query_builder = new DynamoDbItemRequestHelper.UpdateItemRequestBuilder(m_dynamo_db_client.getTableName());
|
||||
// // query_builder.withKeys(attributeValueWithPrimaryKey);
|
||||
// //
|
||||
// // var target_doc = new MoneyDoc();
|
||||
// // var attrib_path_json_string = target_doc.toJsonStringOfAttribs();
|
||||
// // var target_key = JsonHelper.getJsonPropertyName<MoneyAttrib>(targetAttribName);
|
||||
// // (var is_success, var attribute_expression) =
|
||||
// // DynamoDbClientHelper.toAttributeExpressionFromJson(attrib_path_json_string, target_key);
|
||||
// // if (false == is_success)
|
||||
// // {
|
||||
// // var err_msg =
|
||||
// // $"Failed to DynamoDbClientHelper.toAttributeExpressionFromJson() !!! : attribPath:{attrib_path_json_string}, targetKey:{target_key}";
|
||||
// // result.setFail(ServerErrorCode.AttribPathMakeFailed, err_msg);
|
||||
// // Log.getLogger().error(result.toBasicString());
|
||||
// //
|
||||
// // return (result, null);
|
||||
// // }
|
||||
// //
|
||||
// // query_builder.withExpressionAttributeNames(
|
||||
// // DynamoDbClientHelper.toExpressionAttributeNamesFromJson(attrib_path_json_string, target_key));
|
||||
// //
|
||||
// // var update_expression = (deltaCount >= 0)
|
||||
// // ? $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) + :changeValue"
|
||||
// // : $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) - :changeValue";
|
||||
// // query_builder.withUpdateExpression(update_expression);
|
||||
// //
|
||||
// // var expression_attribute_values = new Dictionary<string, AttributeValue>
|
||||
// // {
|
||||
// // { ":changeValue", new AttributeValue { N = Math.Abs(deltaCount).ToString() } },
|
||||
// // { ":start", new AttributeValue { N = "0" } }
|
||||
// // };
|
||||
// // query_builder.withExpressionAttributeValues(expression_attribute_values);
|
||||
// //
|
||||
// // query_builder.withReturnValues(ReturnValue.ALL_NEW);
|
||||
// //
|
||||
// // return query_builder.build();
|
||||
// // }
|
||||
// }
|
||||
71
BrokerApiTest/Helper/DocRepo/PlanetInfoCache.cs
Normal file
71
BrokerApiTest/Helper/DocRepo/PlanetInfoCache.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using DbEntity;
|
||||
//
|
||||
// using Microsoft.Extensions.DependencyInjection;
|
||||
// using Microsoft.Extensions.Hosting;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// using ServerCore; using ServerBase;
|
||||
//
|
||||
// //==================================================
|
||||
// // 행성 정보 캐시를 갱신한다.
|
||||
// //==================================================
|
||||
// public class PlanetInfoCache : BackgroundService
|
||||
// {
|
||||
// private readonly object m_lock = new();
|
||||
// private IEnumerable<PlanetInfo> m_planets = [];
|
||||
// private readonly IServiceScopeFactory m_scope_factory;
|
||||
//
|
||||
// public PlanetInfoCache(IServiceScopeFactory scopeFactory, IHostApplicationLifetime lifetime)
|
||||
// {
|
||||
// m_scope_factory = scopeFactory;
|
||||
// }
|
||||
//
|
||||
// public IEnumerable<PlanetInfo> Planets
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// lock (m_planets)
|
||||
// {
|
||||
// return m_planets;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
// {
|
||||
// while (!stoppingToken.IsCancellationRequested)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// await updateData();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// Console.WriteLine(e);
|
||||
// throw;
|
||||
// }
|
||||
//
|
||||
// await Task.Delay(TimeSpan.FromSeconds(120), stoppingToken); // 120초마다 데이터 갱신
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private async Task updateData()
|
||||
// {
|
||||
// using var scope = m_scope_factory.CreateScope();
|
||||
// var planet_info_repo = scope.ServiceProvider.GetRequiredService<PlanetInfoRepo>();
|
||||
// var (result, planet_infos) = await planet_info_repo.findAll();
|
||||
// if (result.isFail() || planet_infos == null)
|
||||
// {
|
||||
// Log.getLogger().error("Failed to find planet infos");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// lock (m_lock)
|
||||
// {
|
||||
// m_planets = planet_infos;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
67
BrokerApiTest/Helper/DocRepo/UserBaseDocRepo.cs
Normal file
67
BrokerApiTest/Helper/DocRepo/UserBaseDocRepo.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
// using ServerCommon;
|
||||
//
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using ServerCore; using ServerBase;
|
||||
//
|
||||
// public class UserBaseDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public UserBaseDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// this.m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, UserBaseDoc?)> findUserBaseDoc(string userGuid)
|
||||
// {
|
||||
// var (result, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<UserBaseDoc>(userGuid);
|
||||
// if (result.isFail() || primary_key_object == null)
|
||||
// {
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// // var (result, user_doc) = await m_dynamoDbClient.simpleQueryDocTypeWithQueryOperationConfig<UserBaseDoc>(config);
|
||||
// return await m_dynamo_db_client.simpleQueryDocTypeWithQueryOperationConfig<UserBaseDoc>(config);
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, UserBaseAttrib?)> findUserBaseAttrib(string userGuid)
|
||||
// {
|
||||
// var (result, doc) = await findUserBaseDoc(userGuid);
|
||||
// return (result, doc?.getAttrib<UserBaseAttrib>());
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, string)> findNickname(string userGuid)
|
||||
// {
|
||||
// var (result, found_nickname_attrib) = await NicknameDoc.findNicknameFromGuid(m_dynamo_db_client, userGuid);
|
||||
// if(result.isFail())
|
||||
// {
|
||||
// return (result, string.Empty);
|
||||
// }
|
||||
// NullReferenceCheckHelper.throwIfNull(found_nickname_attrib, () => $"found_nickname_attrib is null !!!, userGuid:{userGuid}");
|
||||
// return (result, found_nickname_attrib.Nickname);
|
||||
// }
|
||||
//
|
||||
// //===================================================================================================
|
||||
// // 로그아웃 여부만 체크
|
||||
// // TODO: 레디스 캐시를 이용하여 로그인 여부를 체크하는 것이 더 효율적일 수 있음
|
||||
// //===================================================================================================
|
||||
// public bool isUserLoggedIn(UserBaseAttrib userAttrib)
|
||||
// {
|
||||
// return userAttrib.GameLoginDateTime > userAttrib.GameLogoutDateTime;
|
||||
// }
|
||||
//
|
||||
// // public async Task<Result> insertUserBaseDoc(UserBaseAttrib userAttrib)
|
||||
// // {
|
||||
// // var user_doc = new UserBaseDoc(userAttrib.UserGuid);
|
||||
// // var user_attrib = user_doc.getAttrib<UserBaseAttrib>();
|
||||
// // NullReferenceCheckHelper.throwIfNull(user_attrib, () => $"insertUserBaseDoc : user_attrib is null !!! - {userAttrib.UserGuid}");
|
||||
// // user_attrib.UserGuid = userAttrib.UserGuid;
|
||||
// // user_attrib.AccountId = userAttrib.AccountId;
|
||||
// // user_attrib.EOA = userAttrib.EOA;
|
||||
// // user_attrib.SelectedCharacterGuid = userAttrib.SelectedCharacterGuid;
|
||||
// // user_attrib.IsIntroCompleted = userAttrib.IsIntroCompleted;
|
||||
// // return await m_dynamoDbClient.simpleInsertDocumentWithDocType(user_doc);
|
||||
// // }
|
||||
// }
|
||||
4
BrokerApiTest/Helper/Helpers.cs
Normal file
4
BrokerApiTest/Helper/Helpers.cs
Normal file
@@ -0,0 +1,4 @@
|
||||
public static class TestDefines
|
||||
{
|
||||
public static string MetaDataPath => Path.GetFullPath("../../../../../bin/Debug/resource/meta", Directory.GetCurrentDirectory());
|
||||
}
|
||||
16
BrokerApiTest/Helper/MetaTableTestHelper.cs
Normal file
16
BrokerApiTest/Helper/MetaTableTestHelper.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace BrokerTest.Helper;
|
||||
|
||||
public class MetaTableTestHelper
|
||||
{
|
||||
readonly BrokerApiMetaLoader m_meta_loader = new();
|
||||
|
||||
public void load()
|
||||
{
|
||||
m_meta_loader.load(TestDefines.MetaDataPath);
|
||||
}
|
||||
|
||||
public BrokerMetaTableRef getMetaTableRef()
|
||||
{
|
||||
return new BrokerMetaTableRef(m_meta_loader.getMetaTable());
|
||||
}
|
||||
}
|
||||
8
BrokerApiTest/Helper/TestConst.cs
Normal file
8
BrokerApiTest/Helper/TestConst.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace BrokerTest.Helper;
|
||||
|
||||
public static class TestConst
|
||||
{
|
||||
public const string TestPlanetId = "new_earth";
|
||||
public const string TestPlanetSecret = "A8h$KmP";
|
||||
public const string TestUserGuid = "1052b08b52ef4d69a27ee1f40911a72f";
|
||||
}
|
||||
37
BrokerApiTest/Helper/TestLogger.cs
Normal file
37
BrokerApiTest/Helper/TestLogger.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace BrokerTest.Helper;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Xunit.Abstractions;
|
||||
|
||||
public class TestLogger<T> : ILogger<T>, IDisposable
|
||||
{
|
||||
private readonly List<string> m_logs = [];
|
||||
private readonly ITestOutputHelper m_output;
|
||||
|
||||
public TestLogger(ITestOutputHelper output)
|
||||
{
|
||||
m_output = output;
|
||||
}
|
||||
|
||||
public IDisposable? BeginScope<TState>(TState state) where TState : notnull
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel) => true;
|
||||
|
||||
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception,
|
||||
Func<TState, Exception?, string> formatter)
|
||||
{
|
||||
var message = formatter(state, exception);
|
||||
m_logs.Add(message);
|
||||
m_output.WriteLine(message);
|
||||
}
|
||||
|
||||
public IEnumerable<string> Logs => m_logs;
|
||||
|
||||
public void Dispose() => m_logs.Clear();
|
||||
}
|
||||
70
BrokerApiTest/Helper/TestUserHelper.cs
Normal file
70
BrokerApiTest/Helper/TestUserHelper.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using BrokerApiServer.Extensions;
|
||||
|
||||
using BrokerCore;
|
||||
using BrokerCore.Entity;
|
||||
using BrokerCore.Repository;
|
||||
using BrokerCore.Services;
|
||||
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
namespace BrokerTest.Helper;
|
||||
|
||||
public class TestUserHelper
|
||||
{
|
||||
readonly BrokerServerLogic m_server_logic;
|
||||
private readonly UserAuthAction m_auth_action;
|
||||
private readonly PlanetUserEntity m_planet_user;
|
||||
|
||||
public TestUserHelper(string serviceEnv)
|
||||
{
|
||||
AppBuilderExtensions.initGlobalNlog();
|
||||
Log.initLog("BrokerApiServer", "Developer");
|
||||
var config = initBrokerServerConfig(serviceEnv);
|
||||
var logic = new BrokerServerLogic(config);
|
||||
logic.onInit().Wait();
|
||||
ServerLogicApp.setServerLogicApp(logic);
|
||||
m_server_logic = logic;
|
||||
|
||||
m_planet_user = new PlanetUserEntity(logic);
|
||||
m_planet_user.onInit().Wait();
|
||||
m_auth_action = new UserAuthAction(m_planet_user, logic.getDynamoDbClient());
|
||||
}
|
||||
|
||||
private static ServerConfigMetaverseBroker initBrokerServerConfig(string serviceEnv)
|
||||
{
|
||||
string config_path = serviceEnv switch
|
||||
{
|
||||
"Dev" => "ServerConfig.json",
|
||||
"QA" => "ServerConfig-QA.json",
|
||||
"Stage" => "ServerConfig-Stage.json",
|
||||
_ => throw new ArgumentException($"Invalid service environment: {serviceEnv}")
|
||||
};
|
||||
// 서버 설정
|
||||
var server_config = new ServerConfigMetaverseBroker();
|
||||
var server_config_path = $"./Config/{config_path}";
|
||||
server_config.setConfigFilePath(server_config_path);
|
||||
var result = server_config.tryLoadConfig().GetAwaiter().GetResult();
|
||||
Assert.True(result.isSuccess(), $"ServerConfig Load Failed => {result}");
|
||||
return server_config;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<string> getUserGuidByAccountId(string accountId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await m_auth_action.findAndSetAllAttributeByAccountId(accountId);
|
||||
return result.isFail() ? string.Empty : m_planet_user.UserGuid;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.getLogger().Error(ex, $"{nameof(TestUserHelper)}.getUserGuidByAccountId() Exception => {ex.Message}");
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
BrokerApiTest/Helper/ValueResult.cs
Normal file
18
BrokerApiTest/Helper/ValueResult.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
// namespace BrokerCore.Common;
|
||||
//
|
||||
// public class ValueResult<TValue>
|
||||
// {
|
||||
// public Result Result { get; init; }
|
||||
// public TValue? Value { get; set; }
|
||||
//
|
||||
// public ValueResult()
|
||||
// {
|
||||
// Result = new Result();
|
||||
// }
|
||||
//
|
||||
// public ValueResult(Result result, TValue? value)
|
||||
// {
|
||||
// Result = result;
|
||||
// Value = value;
|
||||
// }
|
||||
// }
|
||||
45
BrokerApiTest/Jwt/JwtBasicTests.cs
Normal file
45
BrokerApiTest/Jwt/JwtBasicTests.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// Jwt 토큰 생성 및 파싱 기본 라이브러리 사용 테스트
|
||||
//=============================================================================================
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
using BrokerCore.Common;
|
||||
using BrokerCore.Services;
|
||||
|
||||
namespace BrokerTest.Jwt;
|
||||
|
||||
public class JwtBasicTests
|
||||
{
|
||||
private readonly ITestOutputHelper m_test_output_helper;
|
||||
|
||||
public JwtBasicTests(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
m_test_output_helper = testOutputHelper;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void jwtServiceTest()
|
||||
{
|
||||
var jwt_option = new JwtOption
|
||||
{
|
||||
Secret = "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
TokenValidityInMinutes = 1,
|
||||
};
|
||||
var jwt_service = new JwtGenerator(jwt_option);
|
||||
var token = jwt_service.generateAccessToken("new_earth", "caliverse");
|
||||
m_test_output_helper.WriteLine(token);
|
||||
Assert.NotNull(token);
|
||||
|
||||
var jwt_parser = new JwtParser(jwt_option);
|
||||
var token_parsed = jwt_parser.parseToken(token);
|
||||
Assert.NotNull(token_parsed);
|
||||
var sid = token_parsed.FindFirstValue(JwtRegisteredClaimNames.Sid);
|
||||
Assert.NotNull(sid);
|
||||
var typ = token_parsed.FindFirstValue(JwtRegisteredClaimNames.Typ);
|
||||
Assert.NotNull(typ);
|
||||
}
|
||||
}
|
||||
48
BrokerApiTest/Jwt/SSOTests.cs
Normal file
48
BrokerApiTest/Jwt/SSOTests.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
// using ServerCommon;
|
||||
// using ServerCore; using ServerBase;
|
||||
// using Services;
|
||||
//
|
||||
// namespace BrokerTest.Jwt;
|
||||
// public class SsoTests
|
||||
// {
|
||||
// private readonly ServerConfig m_server_config;
|
||||
// private readonly string m_web_portal_token_secret;
|
||||
// private readonly string m_account_db;
|
||||
//
|
||||
// public SsoTests()
|
||||
// {
|
||||
// Log.NLogFileName = "./TestConfig/nlog-BrokerApiServer.config";
|
||||
// Log.initLog("BrokerApiServerTest", "Developer");
|
||||
// var path = "./TestConfig/ServerConfig-Local.json";
|
||||
// var full_path = Path.GetFullPath(path);
|
||||
// m_server_config = new ServerConfig();
|
||||
// m_server_config.setConfigFilePath(full_path);
|
||||
// m_server_config.loadConfig();
|
||||
// m_account_db = m_server_config.AccountNftDb;
|
||||
// m_web_portal_token_secret = m_server_config.SsoAccountAuthJwtSecretKey;
|
||||
// }
|
||||
//
|
||||
// private async Task findTestAccount()
|
||||
// {
|
||||
// var sso_account_auth = new WebPortalTokenAuthService(m_account_db, m_web_portal_token_secret);
|
||||
// var result = await sso_account_auth.mysqlAuthWithEmail("tenafter71@gmail.com", 1);
|
||||
// Assert.True(result.isSuccess());
|
||||
// // m_account_id = result.getAccountId();
|
||||
// }
|
||||
//
|
||||
// [Fact]
|
||||
// public async Task ssoFailTest()
|
||||
// {
|
||||
// var sso_account_auth = new WebPortalTokenAuthService(m_account_db, m_web_portal_token_secret);
|
||||
// var result = await sso_account_auth.mysqlAuthWithEmail("test", 1);
|
||||
// Assert.True(result.isFail());
|
||||
// }
|
||||
//
|
||||
// [Fact]
|
||||
// public async Task ssoSuccessTest()
|
||||
// {
|
||||
// var sso_account_auth = new WebPortalTokenAuthService(m_account_db, m_web_portal_token_secret);
|
||||
// var result = await sso_account_auth.mysqlAuthWithEmail("test@test.com", 1);
|
||||
// Assert.True(result.isSuccess());
|
||||
// }
|
||||
// }
|
||||
6
BrokerApiTest/Services/ExchangeServiceTests.cs
Normal file
6
BrokerApiTest/Services/ExchangeServiceTests.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace BrokerTest.Services;
|
||||
|
||||
public class ExchangeServiceTests
|
||||
{
|
||||
|
||||
}
|
||||
1
BrokerApiTest/Services/UserAuthServiceTests.cs
Normal file
1
BrokerApiTest/Services/UserAuthServiceTests.cs
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
150
BrokerApiTest/TestConfig/ServerConfig-Local.json
Normal file
150
BrokerApiTest/TestConfig/ServerConfig-Local.json
Normal file
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": true,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Dev",
|
||||
"StandaloneMode": true,
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 500,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
"SessionKeepAliveTimeSec": 3600,
|
||||
"MinWorkerThreadCount": 100,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
|
||||
"Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
|
||||
|
||||
"Dynamodb": "http://localhost:8000",
|
||||
|
||||
"AWS": {
|
||||
"Enable": false,
|
||||
"LocalDynamoDB": true,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": false,
|
||||
"LogGroup": "MetaverseLog-Dev",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"player": "${event-properties:player}",
|
||||
"properties": "${event-properties:properties}",
|
||||
"threadId": "${threadid}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}",
|
||||
"server": "${event-properties:server}",
|
||||
"ipport": "${event-properties:ipport}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Dev",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-test",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": false,
|
||||
"PlatformTypeAllows": ""
|
||||
},
|
||||
|
||||
"LoadBalancingRule": {
|
||||
"AuthToGameRule": {
|
||||
"Rule": "WeightedRoundRobin",
|
||||
"MinRate": 0,
|
||||
"MaxRate": 100,
|
||||
"UserLanguageBased": true
|
||||
}
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": "https://caliverse.io/shop" },
|
||||
{ "ChatAiApiServerUrl": "https://ai-dev-api.caliverse.io" },
|
||||
{ "MyhomeEditGuideUrl": "https://calidocu.gitbook.io/caliverse-metaverse/en/caliverse-feature-guide/interior" },
|
||||
{ "WebLinkUrlSeasonPass": "https://calidocu.gitbook.io/caliverse-metaverse/en/pass-and-claim/season-pass" },
|
||||
{ "CaliumConverterWebGuide": "https://calidocu.gitbook.io/caliverse-metaverse/en/calium/calium-converter" },
|
||||
{ "S3ResourceImageUrl": "https://d3s9natejb9ydz.cloudfront.net/Dev" }
|
||||
],
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": false,
|
||||
"CPNftForOwnerAllGetUrl": "https://dev-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-dev-rollup-admin-api.caliverse.io"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://ai-dev-api.caliverse.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://dev-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "https://dev-ugqapi.caliverse.io:11000",
|
||||
//"ApiServerAddress": "http://localhost:1000",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "localhost",
|
||||
"Port": 5672,
|
||||
"UserName": "admin",
|
||||
"Password": "admin",
|
||||
"SSL": false
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 1200000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 3600000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": false,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable" : true
|
||||
|
||||
}
|
||||
|
||||
94
BrokerApiTest/TestConfig/nlog-BrokerApiServer.config
Normal file
94
BrokerApiTest/TestConfig/nlog-BrokerApiServer.config
Normal file
@@ -0,0 +1,94 @@
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
throwConfigExceptions="true"
|
||||
autoReload="true"
|
||||
internalLogLevel="Error"
|
||||
internalLogToConsole="true">
|
||||
|
||||
<extensions>
|
||||
<add assembly="NLog.AWS.Logger" />
|
||||
</extensions>
|
||||
|
||||
<targets async="true">
|
||||
<!--
|
||||
<target name="logconsole" xsi:type="Console"
|
||||
layout="${longdate:universalTime=true} ${level} [${threadid}] [${event-properties:memberName}] ${message}" />
|
||||
-->
|
||||
<target name="logfile" xsi:type="File"
|
||||
fileName="${basedir}/logs/${ProcessName}.log"
|
||||
archiveFileName="${basedir}/logs/${ProcessName}_{###}.log"
|
||||
archiveAboveSize="10240000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveFiles= "1000"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm"
|
||||
layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}|${level:uppercase=true}|${threadid}|${message}|${event-properties:memberName}|${event-properties:filePath}:${event-properties:lineNumber}"/>
|
||||
|
||||
<target name="businessLogFile" xsi:type="File"
|
||||
fileName="${basedir}/logs/Business_${ProcessName}.json"
|
||||
archiveFileName="${basedir}/logs/archive/business/Business_${ProcessName}_{###}.json"
|
||||
archiveAboveSize="1024000000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveDays= "30"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm">
|
||||
<layout xsi:type="JsonLayout" includeEventProperties="true" excludeProperties="Comma-separated list (string)">
|
||||
<attribute name="logTime" layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}" />
|
||||
<attribute name="level" layout="${level:upperCase=true}"/>
|
||||
<attribute name="message" layout="${message}" />
|
||||
</layout>
|
||||
</target>
|
||||
|
||||
<target name="developLogFile" xsi:type="File"
|
||||
fileName="${basedir}/logs/${ProcessName}.json"
|
||||
archiveFileName="${basedir}/logs/archive/develop/${ProcessName}_{###}.json"
|
||||
archiveAboveSize="1024000000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveDays= "30"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm">
|
||||
<layout xsi:type="JsonLayout" includeEventProperties="true" excludeProperties="Comma-separated list (string)">
|
||||
<attribute name="logTime" layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}" />
|
||||
<attribute name="threadid" layout="${threadid}" />
|
||||
<attribute name="level" layout="${level:upperCase=true}"/>
|
||||
<attribute name="message" layout="${message}" />
|
||||
<attribute name="exception" layout="${exception:format=ToString}" />
|
||||
</layout>
|
||||
</target>
|
||||
|
||||
<target name="logconsole" xsi:type="ColoredConsole"
|
||||
layout="${longdate:universalTime=true}|${level:uppercase=true}|${threadid}|${message}|${event-properties:filePath}:${event-properties:lineNumber} ${exception:format=ToString}">
|
||||
<highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" />
|
||||
<highlight-row condition="level == LogLevel.Info" foregroundColor="DarkGray" />
|
||||
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
|
||||
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
|
||||
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" />
|
||||
</target>
|
||||
|
||||
<target name="logSeqFile" xsi:type="File"
|
||||
fileName="${basedir}/../../bin/LogSequence/${ProcessName}.log"
|
||||
archiveFileName="${basedir}/../../bin/LogSequence/${ProcessName}_{#}.Sequence.bak"
|
||||
archiveAboveSize="10240000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveFiles= "1000"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd"
|
||||
layout="${ticks},${event-properties:sender},${event-properties:receiver},${message}:${event-properties:errordesc}"/>
|
||||
|
||||
</targets>
|
||||
<rules>
|
||||
<logger name="*" minlevel="Info" writeTo="logconsole"/>
|
||||
<logger name="*" minlevel="Info" writeTo="developLogFile"/>
|
||||
<logger name="BusinessLogger" minlevel="Info" writeTo="businessLogFile"/>
|
||||
<!-->logger name="*" minlevel="Error" writeTo="logfile"/-->
|
||||
<logger name="SequenceLogger" minlevel="Debug" writeTo="logSeqFile"/>
|
||||
</rules>
|
||||
</nlog>
|
||||
19
BrokerApiTest/TestHelper/DocRepo/AccountDocRepo.cs
Normal file
19
BrokerApiTest/TestHelper/DocRepo/AccountDocRepo.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// public class AccountDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public AccountDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, AccountBaseAttrib?)> findAccountBaseAttrib(string accountId)
|
||||
// {
|
||||
// var (result, doc) = await AccountBaseDoc.findUserGuidFromAccountId(m_dynamo_db_client, accountId);
|
||||
// return (result, doc?.getAttrib<AccountBaseAttrib>());
|
||||
// }
|
||||
// }
|
||||
53
BrokerApiTest/TestHelper/DocRepo/CaliumEventDocRepo.cs
Normal file
53
BrokerApiTest/TestHelper/DocRepo/CaliumEventDocRepo.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using ServerCommon;
|
||||
// using ServerCommon.EchoSystem.Models;
|
||||
//
|
||||
// using ServerCore; using ServerBase;
|
||||
//
|
||||
// public class CaliumEventDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public CaliumEventDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// // public async Task<(Result, CaliumEventAttrib?)> createOne(string userGuid)
|
||||
// // {
|
||||
// // var (result_pk, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<CaliumEventDoc>(userGuid);
|
||||
// // if (result_pk.isFail() || primary_key_object == null)
|
||||
// // {
|
||||
// // return (result_pk, null);
|
||||
// // }
|
||||
// //
|
||||
// // var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// // var (result, doc) =
|
||||
// // await m_dynamo_db_client.simpleInsertDocument<CaliumEventDoc>(config);
|
||||
// // var attrib = doc?.getAttrib<CaliumEventAttrib>();
|
||||
// // return (result, attrib);
|
||||
// // }
|
||||
// public async Task<string> createOne(string userGuid, CaliumEventRequest request, bool isRetry)
|
||||
// {
|
||||
// var doc = new CaliumEventDoc(request.m_event_id);
|
||||
// var attrib = doc.getAttrib<CaliumEventAttrib>();
|
||||
// NullReferenceCheckHelper.throwIfNull(attrib, () => $"calium event attrib is null !!! - userGuid[{userGuid}]");
|
||||
//
|
||||
// attrib.UserGuid = userGuid;
|
||||
// attrib.EventData.m_server_type = request.m_server_type;
|
||||
// attrib.EventData.m_event_type = request.m_event_type;
|
||||
// attrib.EventData.m_sub_type = request.m_sub_type;
|
||||
// attrib.EventData.m_div_type = request.m_div_type;
|
||||
// attrib.EventData.m_div_id = request.m_div_id;
|
||||
// attrib.EventData.m_calium_delta = request.m_calium_delta;
|
||||
// attrib.EventData.m_sapphire_delta = request.m_sapphire_delta;
|
||||
// attrib.EventData.m_current_epoch = request.m_current_epoch;
|
||||
// attrib.EventData.m_current_inflation_rate = request.m_current_inflation_rate;
|
||||
// attrib.Status = isRetry ? CaliumEventStatus.Regist : CaliumEventStatus.Failed;
|
||||
//
|
||||
// await m_dynamo_db_client.simpleInsertDocumentWithDocType(doc);
|
||||
// return request.m_event_id;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
28
BrokerApiTest/TestHelper/DocRepo/CaliumStorageDocRepo.cs
Normal file
28
BrokerApiTest/TestHelper/DocRepo/CaliumStorageDocRepo.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// public class CaliumStorageDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public CaliumStorageDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, CaliumStorageAttrib?)> findOne(string userGuid)
|
||||
// {
|
||||
// var (result_pk, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<CaliumStorageDoc>(userGuid);
|
||||
// if (result_pk.isFail() || primary_key_object == null)
|
||||
// {
|
||||
// return (result_pk, null);
|
||||
// }
|
||||
//
|
||||
// var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// var (result, doc) =
|
||||
// await m_dynamo_db_client.simpleQueryDocTypeWithQueryOperationConfig<CaliumStorageDoc>(config);
|
||||
// var attrib = doc?.getAttrib<CaliumStorageAttrib>();
|
||||
// return (result, attrib);
|
||||
// }
|
||||
// }
|
||||
30
BrokerApiTest/TestHelper/DocRepo/CaliumStorageRepo.cs
Normal file
30
BrokerApiTest/TestHelper/DocRepo/CaliumStorageRepo.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using Common;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// public class CaliumStorageRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public CaliumStorageRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, CaliumStorageAttrib?)> findOne(string userGuid)
|
||||
// {
|
||||
// var (result_pk, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<CaliumStorageDoc>(userGuid);
|
||||
// if (result_pk.isFail() || primary_key_object == null)
|
||||
// {
|
||||
// return (result_pk, null);
|
||||
// }
|
||||
//
|
||||
// var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// var (result, doc) =
|
||||
// await m_dynamo_db_client.simpleQueryDocTypeWithQueryOperationConfig<CaliumStorageDoc>(config);
|
||||
// var attrib = doc?.getAttrib<CaliumStorageAttrib>();
|
||||
// return (result, attrib);
|
||||
// }
|
||||
// }
|
||||
445
BrokerApiTest/TestHelper/DocRepo/MoneyDocRepo.cs
Normal file
445
BrokerApiTest/TestHelper/DocRepo/MoneyDocRepo.cs
Normal file
@@ -0,0 +1,445 @@
|
||||
// using Amazon.DynamoDBv2;
|
||||
// using Amazon.DynamoDBv2.Model;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// using ServerCore; using ServerBase;
|
||||
//
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using BrokerApiServer.Common;
|
||||
//
|
||||
// public class BrokerApiLogActor : ILogActor
|
||||
// {
|
||||
// public string getActorGuid() => "broker";
|
||||
// }
|
||||
//
|
||||
// public class BrokerApiWithLogActor : EntityBase, IWithLogActor
|
||||
// {
|
||||
// public readonly EntityType m_entity_type = EntityType.Money;
|
||||
//
|
||||
// public BrokerApiWithLogActor() : base(EntityType.Money)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// //public BrokerApiWithLogActor(string masterGuid) : base(EntityType.Money, masterGuid)
|
||||
// //{
|
||||
// //}
|
||||
//
|
||||
// public ILogActor toLogActor()
|
||||
// {
|
||||
// return new BrokerApiLogActor();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public class DbqChangeSapphire : QueryExecutorBase
|
||||
// {
|
||||
// private readonly double m_delta;
|
||||
// private PrimaryKey? m_primary_key;
|
||||
// private readonly string m_user_guid;
|
||||
//
|
||||
// public DbqChangeSapphire(string userGuid, double delta) : base(nameof(DbqChangeSapphire))
|
||||
// {
|
||||
// m_delta = delta;
|
||||
// m_user_guid = userGuid;
|
||||
// }
|
||||
//
|
||||
// public override async Task<Result> onPrepareQuery()
|
||||
// {
|
||||
// (var result, m_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<MoneyDoc>(m_user_guid);
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// public override async Task<Result> onQuery()
|
||||
// {
|
||||
// var owner = getOwner();
|
||||
//
|
||||
// // 부모 인스턴스의 정보를 사용하여 필요한 데이터를 가져온다. (여기서는 ...)
|
||||
// var query_batch = getQueryBatch() as QueryBatch<QueryRunnerWithItemRequest>;
|
||||
// NullReferenceCheckHelper.throwIfNull(query_batch, () => $"query_batch is null !!! - {owner.toBasicString()}");
|
||||
//
|
||||
// var query_runner_with_item_request = query_batch.getQueryRunner();
|
||||
// NullReferenceCheckHelper.throwIfNull(query_runner_with_item_request,
|
||||
// () => $"query_runner_with_item_request is null !!! - {owner.toBasicString()}");
|
||||
//
|
||||
// var db_connector = query_batch.getDynamoDbConnector();
|
||||
// var (result, update_request) = makeUpdateItemRequest();
|
||||
// if (result.isFail())
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// NullReferenceCheckHelper.throwIfNull(update_request,
|
||||
// () => $"update_request is null !!! - {owner.toBasicString()}");
|
||||
//
|
||||
// var exception_handler = new DynamoDbQueryExceptionNotifier.ExceptionHandler(
|
||||
// DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.LackOfTotalCalium);
|
||||
//
|
||||
// var query_context = update_request.createItemRequestQueryContext(QueryType.Update, exception_handler);
|
||||
// return await query_runner_with_item_request.tryRegisterQueryContext(query_context);
|
||||
// }
|
||||
//
|
||||
// //=====================================================================================
|
||||
// // DB 쿼리를 성공하고, doFnCommit()가 QueryResultType.NotCalledQueryFunc를 반환할 경우 호출된다.
|
||||
// //=====================================================================================
|
||||
// public override Task onQueryResponseCommit()
|
||||
// {
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
//
|
||||
// //=====================================================================================
|
||||
// // DB 쿼리를 실패하고, doFnRollback()가 QueryResultType.NotCalledQueryFunc를 반환할 경우 호출된다.
|
||||
// //=====================================================================================
|
||||
// public override Task onQueryResponseRollback(Result errorResult)
|
||||
// {
|
||||
// return Task.CompletedTask;
|
||||
// }
|
||||
//
|
||||
// private (Result, UpdateItemRequest?) makeUpdateItemRequest()
|
||||
// {
|
||||
// Guard.Against.isNull(m_primary_key, (BrokerApiErrorCode)ServerErrorCode.DynamoDbPrimaryKeyNotFound, "primary key is null");
|
||||
// var attribute_value_with_primary_key = m_primary_key.toKeyWithAttributeValue();
|
||||
//
|
||||
// var currency_name = MoneyAttribExtensions.getKeyNameFromType(CurrencyType.Sapphire);
|
||||
// var result = new Result();
|
||||
// var dynamo_db_client = getQueryBatch()?.getDynamoDbConnector();
|
||||
// NullReferenceCheckHelper.throwIfNull(dynamo_db_client, () => $"dynamo_db_client is null !!!");
|
||||
//
|
||||
// var query_builder = new DynamoDbItemRequestHelper.UpdateItemRequestBuilder(dynamo_db_client.getTableName());
|
||||
// query_builder.withKeys(attribute_value_with_primary_key);
|
||||
//
|
||||
// var target_doc = new MoneyDoc();
|
||||
// var attrib_path_json_string = target_doc.toJsonStringOfAttribs();
|
||||
// var target_key = JsonHelper.getJsonPropertyName<MoneyAttrib>(currency_name);
|
||||
// var (is_success, attribute_expression) =
|
||||
// DynamoDbClientHelper.toAttributeExpressionFromJson(attrib_path_json_string, target_key);
|
||||
// if (false == is_success)
|
||||
// {
|
||||
// var err_msg =
|
||||
// $"Failed to DynamoDbClientHelper.toAttributeExpressionFromJson() !!! : attribPath:{attrib_path_json_string}, targetKey:{target_key}";
|
||||
// result.setFail(ServerErrorCode.AttribPathMakeFailed, err_msg);
|
||||
// Log.getLogger().error(result.toBasicString());
|
||||
//
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// query_builder.withExpressionAttributeNames(
|
||||
// DynamoDbClientHelper.toExpressionAttributeNamesFromJson(attrib_path_json_string, target_key));
|
||||
//
|
||||
// var update_expression = (m_delta >= 0)
|
||||
// ? $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) + :changeValue"
|
||||
// : $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) - :changeValue";
|
||||
// query_builder.withUpdateExpression(update_expression);
|
||||
//
|
||||
// var expression_attribute_values = new Dictionary<string, AttributeValue>
|
||||
// {
|
||||
// { ":changeValue", new AttributeValue { N = Math.Abs(m_delta).ToString() } },
|
||||
// { ":start", new AttributeValue { N = "0" } }
|
||||
// };
|
||||
// query_builder.withExpressionAttributeValues(expression_attribute_values);
|
||||
// query_builder.withReturnValues(ReturnValue.ALL_NEW);
|
||||
// return query_builder.build();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public class MoneyDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public MoneyDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, MoneyDoc?)> findMoneyDoc(string userGuid)
|
||||
// {
|
||||
// var (result, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<MoneyDoc>(userGuid);
|
||||
// if (result.isFail() || primary_key_object == null)
|
||||
// {
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// return await m_dynamo_db_client.simpleQueryDocTypeWithQueryOperationConfig<MoneyDoc>(config);
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, MoneyAttrib?)> findMoneyAttrib(string userGuid, CancellationToken cancellationToken)
|
||||
// {
|
||||
// var (result, doc) = await findMoneyDoc(userGuid);
|
||||
// return (result, doc?.getAttrib<MoneyAttrib>());
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, MoneyAttrib?)> changeSapphire(string userGuid, double delta)
|
||||
// {
|
||||
// var (result, make_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<MoneyDoc>(userGuid);
|
||||
// // 프라이머리 키 생성 실패
|
||||
// if (result.isFail() || make_primary_key == null)
|
||||
// {
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// (result, var request) = makeUpdateItemRequest(
|
||||
// make_primary_key.toKeyWithAttributeValue(),
|
||||
// MoneyAttribExtensions.getKeyNameFromType(CurrencyType.Sapphire),
|
||||
// delta);
|
||||
// // 업데이트 쿼리 생성 실패
|
||||
// if (result.isFail() || request == null)
|
||||
// {
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// (result, var update_doc) = await m_dynamo_db_client.simpleQueryDocTypesWithUpdateItemRequest<MoneyDoc>(request);
|
||||
// // 업데이트 쿼리 실패
|
||||
// if (result.isFail() || update_doc == null) return (result, null);
|
||||
//
|
||||
// var attrib = update_doc.getAttrib<MoneyAttrib>();
|
||||
// // 업데이트 된 문서에서 MoneyAttrib을 찾을 수 없음
|
||||
// if (attrib == null)
|
||||
// {
|
||||
// result.setFail(ServerErrorCode.AttribNotFound, $"attrib is null !!!");
|
||||
// return (result, null);
|
||||
// }
|
||||
// return (result, attrib);
|
||||
// }
|
||||
//
|
||||
// private async Task<Result> sendQuery(QueryBatchBase batch)
|
||||
// {
|
||||
// var result = new Result();
|
||||
// var err_msg = string.Empty;
|
||||
//
|
||||
// if (batch == null)
|
||||
// {
|
||||
// err_msg = $"Failed to sendQuery !!!, QueryBatchBase is null";
|
||||
// result.setFail(ServerErrorCode.FunctionInvalidParam, err_msg);
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// if (false == batch.hasQuery())
|
||||
// {
|
||||
// err_msg = $"Not has DBQuery !!!";
|
||||
// result.setFail(ServerErrorCode.DynamoDbQueryNoRequested, err_msg);
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// result = await batch.prepareQueryWithStopwatch();
|
||||
// if (result.isFail())
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// result = await batch.doQueryWithStopwatch();
|
||||
// if (result.isFail())
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// private (Result, UpdateItemRequest?) makeUpdateItemRequest(
|
||||
// Dictionary<string, AttributeValue> attributeValueWithPrimaryKey
|
||||
// , string targetAttribName
|
||||
// , double deltaCount)
|
||||
// {
|
||||
// var result = new Result();
|
||||
// var query_builder = new DynamoDbItemRequestHelper.UpdateItemRequestBuilder(m_dynamo_db_client.getTableName());
|
||||
// query_builder.withKeys(attributeValueWithPrimaryKey);
|
||||
//
|
||||
// var target_doc = new MoneyDoc();
|
||||
// var attrib_path_json_string = target_doc.toJsonStringOfAttribs();
|
||||
// var target_key = JsonHelper.getJsonPropertyName<MoneyAttrib>(targetAttribName);
|
||||
// var (is_success, attribute_expression) =
|
||||
// DynamoDbClientHelper.toAttributeExpressionFromJson(attrib_path_json_string, target_key);
|
||||
// if (false == is_success)
|
||||
// {
|
||||
// var err_msg =
|
||||
// $"Failed to DynamoDbClientHelper.toAttributeExpressionFromJson() !!! : attribPath:{attrib_path_json_string}, targetKey:{target_key}";
|
||||
// result.setFail(ServerErrorCode.AttribPathMakeFailed, err_msg);
|
||||
// Log.getLogger().error(result.toBasicString());
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// query_builder.withExpressionAttributeNames(
|
||||
// DynamoDbClientHelper.toExpressionAttributeNamesFromJson(attrib_path_json_string, target_key));
|
||||
//
|
||||
// var update_expression = (deltaCount >= 0)
|
||||
// ? $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) + :changeValue"
|
||||
// : $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) - :changeValue";
|
||||
// query_builder.withUpdateExpression(update_expression);
|
||||
//
|
||||
// var expression_attribute_values = new Dictionary<string, AttributeValue>
|
||||
// {
|
||||
// { ":changeValue", new AttributeValue { N = Math.Abs(deltaCount).ToString() } },
|
||||
// { ":start", new AttributeValue { N = "0" } }
|
||||
// };
|
||||
// query_builder.withExpressionAttributeValues(expression_attribute_values);
|
||||
// query_builder.withReturnValues(ReturnValue.ALL_NEW);
|
||||
// return query_builder.build();
|
||||
// }
|
||||
//
|
||||
// // //=============================================================================================
|
||||
// // // delta 만큼 금전을 변경(음수, 양수) 한다.
|
||||
// // //=============================================================================================
|
||||
// // public async Task<Result> changeMoney(CurrencyType currencyType, double delta, bool isTrimExcess = false,
|
||||
// // bool useCaliumEvent = true)
|
||||
// // {
|
||||
// // var result = new Result();
|
||||
// //
|
||||
// // // var owner = getOwner() as Player;
|
||||
// // // NullReferenceCheckHelper.throwIfNull(owner, () => $"player is null !!!");
|
||||
// //
|
||||
// // // if (currencyType == CurrencyType.Beam)
|
||||
// // // {
|
||||
// // // var found_transaction_runner = owner.findTransactionRunner(TransactionIdType.PrivateContents);
|
||||
// // // found_transaction_runner?.addRemoteChargeAIPoint(this, delta);
|
||||
// // // return result;
|
||||
// // // }
|
||||
// //
|
||||
// // result = changeMoneyFromCurrencyType(currencyType, delta, isTrimExcess);
|
||||
// // if (result.isSuccess() && useCaliumEvent)
|
||||
// // {
|
||||
// // var found_transaction_runner = owner.findTransactionRunner(TransactionIdType.PrivateContents);
|
||||
// // var event_name = found_transaction_runner?.getTransactionName() ?? "None";
|
||||
// // found_transaction_runner?.addNotifyCaliumEvent(this, event_name, currencyType, delta);
|
||||
// // }
|
||||
// //
|
||||
// // return await Task.FromResult(result);
|
||||
// // }
|
||||
// //
|
||||
// // private Result changeMoneyFromCurrencyType(CurrencyType type, double delta, bool isTrimExcess = false)
|
||||
// // {
|
||||
// // var result = new Result();
|
||||
// // var err_msg = string.Empty;
|
||||
// //
|
||||
// // // var owner = getOwner() as Player;
|
||||
// // // NullReferenceCheckHelper.throwIfNull(owner, () => $"player is null !!!");
|
||||
// //
|
||||
// // if (MetaData.Instance._CurrencyMetaTableByCurrencyType.TryGetValue(type, out var currencyMetaData) == false)
|
||||
// // {
|
||||
// // // err_msg = $"Not found CurrencyMetaData !!! : currencyType:{type} - {owner.toBasicString()}";
|
||||
// // result.setFail(ServerErrorCode.CurrencyMetaDataNotFound, err_msg);
|
||||
// // Log.getLogger().error(result.toBasicString());
|
||||
// //
|
||||
// // return result;
|
||||
// // }
|
||||
// //
|
||||
// // // var money_attribute = owner.getEntityAttribute<MoneyAttribute>();
|
||||
// // // NullReferenceCheckHelper.throwIfNull(money_attribute,
|
||||
// // // () => $"money_attribute is null !!! - {owner.toBasicString()}");
|
||||
// //
|
||||
// // var currency = money_attribute.getCurrencyFromType(type);
|
||||
// // var change = currency + delta;
|
||||
// // if (change < 0)
|
||||
// // {
|
||||
// // err_msg =
|
||||
// // $"Failed to change getCurrencyFromType() !!!, not enough Money : deltaMoney:{delta}, changeCurrency:{change}, currencyType:{type} - {owner.toBasicString()}";
|
||||
// // result.setFail(ServerErrorCode.MoneyNotEnough, err_msg);
|
||||
// // Log.getLogger().error(result.toBasicString());
|
||||
// //
|
||||
// // return result;
|
||||
// // }
|
||||
// //
|
||||
// // if (change >= currencyMetaData.MaxCount)
|
||||
// // {
|
||||
// // MoneyNotifyHelper.send_GS2C_NTF_CURRENCY_MAX_ALERT(owner, type, currencyMetaData.MaxCount);
|
||||
// //
|
||||
// // if (change > currencyMetaData.MaxCount
|
||||
// // && false == isTrimExcess)
|
||||
// // {
|
||||
// // err_msg =
|
||||
// // $"Money exceeded Max Count !!! : toDelta:{delta}, toChange:{change} <= MaxCount:{currencyMetaData.MaxCount}, currencyType:{type} - {owner.toBasicString()}";
|
||||
// // result.setFail(ServerErrorCode.MoneyMaxCountExceeded, err_msg);
|
||||
// // Log.getLogger().error(result.toBasicString());
|
||||
// //
|
||||
// // return result;
|
||||
// // }
|
||||
// //
|
||||
// // var trim_money = change - currencyMetaData.MaxCount;
|
||||
// // change = double.Min(change, currencyMetaData.MaxCount);
|
||||
// //
|
||||
// // err_msg =
|
||||
// // $"Exceeded MaxCount of Money !!!, Trimming Money : currencyType:{type}, changeMoney:{change}, trimMoney:{trim_money}, deltaMoney:{delta}, maxMoney:{currencyMetaData.MaxCount} - {owner.toBasicString()}";
|
||||
// // Log.getLogger().info(err_msg);
|
||||
// // }
|
||||
// //
|
||||
// // money_attribute.setCurrencyFromType(type, change);
|
||||
// //
|
||||
// // money_attribute.modifiedEntityAttribute();
|
||||
// //
|
||||
// // return result;
|
||||
// // }
|
||||
// //
|
||||
// //
|
||||
// // public TransactionRunner? findTransactionRunner(TransactionIdType transactionIdType)
|
||||
// // {
|
||||
// // TransactionRunner? found_transaction_runner = null;
|
||||
// //
|
||||
// // var err_msg = string.Empty;
|
||||
// //
|
||||
// // if (true == hasMasterGuid())
|
||||
// // {
|
||||
// // var master_guid = getMasterGuid();
|
||||
// // var found_master_entity = onGetMasterEntity();
|
||||
// // if(null == found_master_entity)
|
||||
// // {
|
||||
// // return null;
|
||||
// // }
|
||||
// //
|
||||
// // found_transaction_runner = found_master_entity.findTransactionRunner(transactionIdType);
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // if (false == m_transaction_runners.TryGetValue(transactionIdType, out found_transaction_runner))
|
||||
// // {
|
||||
// // return null;
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// // return found_transaction_runner;
|
||||
// // }
|
||||
//
|
||||
// // private (Result, UpdateItemRequest?) makeUpdateItemRequest(
|
||||
// // Dictionary<string, AttributeValue> attributeValueWithPrimaryKey
|
||||
// // , string targetAttribName
|
||||
// // , double deltaCount)
|
||||
// // {
|
||||
// // var result = new Result();
|
||||
// //
|
||||
// // var query_builder = new DynamoDbItemRequestHelper.UpdateItemRequestBuilder(m_dynamo_db_client.getTableName());
|
||||
// // query_builder.withKeys(attributeValueWithPrimaryKey);
|
||||
// //
|
||||
// // var target_doc = new MoneyDoc();
|
||||
// // var attrib_path_json_string = target_doc.toJsonStringOfAttribs();
|
||||
// // var target_key = JsonHelper.getJsonPropertyName<MoneyAttrib>(targetAttribName);
|
||||
// // (var is_success, var attribute_expression) =
|
||||
// // DynamoDbClientHelper.toAttributeExpressionFromJson(attrib_path_json_string, target_key);
|
||||
// // if (false == is_success)
|
||||
// // {
|
||||
// // var err_msg =
|
||||
// // $"Failed to DynamoDbClientHelper.toAttributeExpressionFromJson() !!! : attribPath:{attrib_path_json_string}, targetKey:{target_key}";
|
||||
// // result.setFail(ServerErrorCode.AttribPathMakeFailed, err_msg);
|
||||
// // Log.getLogger().error(result.toBasicString());
|
||||
// //
|
||||
// // return (result, null);
|
||||
// // }
|
||||
// //
|
||||
// // query_builder.withExpressionAttributeNames(
|
||||
// // DynamoDbClientHelper.toExpressionAttributeNamesFromJson(attrib_path_json_string, target_key));
|
||||
// //
|
||||
// // var update_expression = (deltaCount >= 0)
|
||||
// // ? $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) + :changeValue"
|
||||
// // : $"SET {attribute_expression} = if_not_exists({attribute_expression}, :start) - :changeValue";
|
||||
// // query_builder.withUpdateExpression(update_expression);
|
||||
// //
|
||||
// // var expression_attribute_values = new Dictionary<string, AttributeValue>
|
||||
// // {
|
||||
// // { ":changeValue", new AttributeValue { N = Math.Abs(deltaCount).ToString() } },
|
||||
// // { ":start", new AttributeValue { N = "0" } }
|
||||
// // };
|
||||
// // query_builder.withExpressionAttributeValues(expression_attribute_values);
|
||||
// //
|
||||
// // query_builder.withReturnValues(ReturnValue.ALL_NEW);
|
||||
// //
|
||||
// // return query_builder.build();
|
||||
// // }
|
||||
// }
|
||||
71
BrokerApiTest/TestHelper/DocRepo/PlanetInfoCache.cs
Normal file
71
BrokerApiTest/TestHelper/DocRepo/PlanetInfoCache.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using DbEntity;
|
||||
//
|
||||
// using Microsoft.Extensions.DependencyInjection;
|
||||
// using Microsoft.Extensions.Hosting;
|
||||
//
|
||||
// using ServerCommon;
|
||||
//
|
||||
// using ServerCore; using ServerBase;
|
||||
//
|
||||
// //==================================================
|
||||
// // 행성 정보 캐시를 갱신한다.
|
||||
// //==================================================
|
||||
// public class PlanetInfoCache : BackgroundService
|
||||
// {
|
||||
// private readonly object m_lock = new();
|
||||
// private IEnumerable<PlanetInfo> m_planets = [];
|
||||
// private readonly IServiceScopeFactory m_scope_factory;
|
||||
//
|
||||
// public PlanetInfoCache(IServiceScopeFactory scopeFactory, IHostApplicationLifetime lifetime)
|
||||
// {
|
||||
// m_scope_factory = scopeFactory;
|
||||
// }
|
||||
//
|
||||
// public IEnumerable<PlanetInfo> Planets
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// lock (m_planets)
|
||||
// {
|
||||
// return m_planets;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
// {
|
||||
// while (!stoppingToken.IsCancellationRequested)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// await updateData();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// Console.WriteLine(e);
|
||||
// throw;
|
||||
// }
|
||||
//
|
||||
// await Task.Delay(TimeSpan.FromSeconds(120), stoppingToken); // 120초마다 데이터 갱신
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private async Task updateData()
|
||||
// {
|
||||
// using var scope = m_scope_factory.CreateScope();
|
||||
// var planet_info_repo = scope.ServiceProvider.GetRequiredService<PlanetInfoRepo>();
|
||||
// var (result, planet_infos) = await planet_info_repo.findAll();
|
||||
// if (result.isFail() || planet_infos == null)
|
||||
// {
|
||||
// Log.getLogger().error("Failed to find planet infos");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// lock (m_lock)
|
||||
// {
|
||||
// m_planets = planet_infos;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
67
BrokerApiTest/TestHelper/DocRepo/UserBaseDocRepo.cs
Normal file
67
BrokerApiTest/TestHelper/DocRepo/UserBaseDocRepo.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
// using ServerCommon;
|
||||
//
|
||||
// namespace BrokerCore.Repository;
|
||||
//
|
||||
// using ServerCore; using ServerBase;
|
||||
//
|
||||
// public class UserBaseDocRepo
|
||||
// {
|
||||
// private readonly DynamoDbClient m_dynamo_db_client;
|
||||
//
|
||||
// public UserBaseDocRepo(DynamoDbClient dynamoDbClient)
|
||||
// {
|
||||
// this.m_dynamo_db_client = dynamoDbClient;
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, UserBaseDoc?)> findUserBaseDoc(string userGuid)
|
||||
// {
|
||||
// var (result, primary_key_object) = await DynamoDBDocBaseHelper.makePrimaryKey<UserBaseDoc>(userGuid);
|
||||
// if (result.isFail() || primary_key_object == null)
|
||||
// {
|
||||
// return (result, null);
|
||||
// }
|
||||
//
|
||||
// var config = m_dynamo_db_client.makeQueryConfigForReadByPKOnly(primary_key_object.PK);
|
||||
// // var (result, user_doc) = await m_dynamoDbClient.simpleQueryDocTypeWithQueryOperationConfig<UserBaseDoc>(config);
|
||||
// return await m_dynamo_db_client.simpleQueryDocTypeWithQueryOperationConfig<UserBaseDoc>(config);
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, UserBaseAttrib?)> findUserBaseAttrib(string userGuid)
|
||||
// {
|
||||
// var (result, doc) = await findUserBaseDoc(userGuid);
|
||||
// return (result, doc?.getAttrib<UserBaseAttrib>());
|
||||
// }
|
||||
//
|
||||
// public async Task<(Result, string)> findNickname(string userGuid)
|
||||
// {
|
||||
// var (result, found_nickname_attrib) = await NicknameDoc.findNicknameFromGuid(m_dynamo_db_client, userGuid);
|
||||
// if(result.isFail())
|
||||
// {
|
||||
// return (result, string.Empty);
|
||||
// }
|
||||
// NullReferenceCheckHelper.throwIfNull(found_nickname_attrib, () => $"found_nickname_attrib is null !!!, userGuid:{userGuid}");
|
||||
// return (result, found_nickname_attrib.Nickname);
|
||||
// }
|
||||
//
|
||||
// //===================================================================================================
|
||||
// // 로그아웃 여부만 체크
|
||||
// // TODO: 레디스 캐시를 이용하여 로그인 여부를 체크하는 것이 더 효율적일 수 있음
|
||||
// //===================================================================================================
|
||||
// public bool isUserLoggedIn(UserBaseAttrib userAttrib)
|
||||
// {
|
||||
// return userAttrib.GameLoginDateTime > userAttrib.GameLogoutDateTime;
|
||||
// }
|
||||
//
|
||||
// // public async Task<Result> insertUserBaseDoc(UserBaseAttrib userAttrib)
|
||||
// // {
|
||||
// // var user_doc = new UserBaseDoc(userAttrib.UserGuid);
|
||||
// // var user_attrib = user_doc.getAttrib<UserBaseAttrib>();
|
||||
// // NullReferenceCheckHelper.throwIfNull(user_attrib, () => $"insertUserBaseDoc : user_attrib is null !!! - {userAttrib.UserGuid}");
|
||||
// // user_attrib.UserGuid = userAttrib.UserGuid;
|
||||
// // user_attrib.AccountId = userAttrib.AccountId;
|
||||
// // user_attrib.EOA = userAttrib.EOA;
|
||||
// // user_attrib.SelectedCharacterGuid = userAttrib.SelectedCharacterGuid;
|
||||
// // user_attrib.IsIntroCompleted = userAttrib.IsIntroCompleted;
|
||||
// // return await m_dynamoDbClient.simpleInsertDocumentWithDocType(user_doc);
|
||||
// // }
|
||||
// }
|
||||
93
BrokerApiTest/TestHelper/Helpers.cs
Normal file
93
BrokerApiTest/TestHelper/Helpers.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// using System.Globalization;
|
||||
// using System.Security.Cryptography;
|
||||
// using System.Text;
|
||||
//
|
||||
// namespace BrokerCore.Common;
|
||||
// public static class Helpers
|
||||
// {
|
||||
// public static string generateAccessKey(string inputString, int keyLength = 24)
|
||||
// {
|
||||
// var salt = DateTime.Now.ToString(CultureInfo.InvariantCulture);
|
||||
// using var pbkdf2 =
|
||||
// new Rfc2898DeriveBytes(inputString, Encoding.UTF8.GetBytes(salt), 10000, HashAlgorithmName.SHA256);
|
||||
// byte[] key_bytes = pbkdf2.GetBytes(keyLength); // 원하는 길이의 바이트 배열 생성
|
||||
// return BitConverter.ToString(key_bytes).Replace("-", "").ToLower()[..keyLength]; // 원하는 길이만큼 잘라서 반환
|
||||
// }
|
||||
//
|
||||
// public static string generateAccessToken(string inputString, string secret, int keyLength = 32)
|
||||
// {
|
||||
// var salt = DateTime.Now.ToString(CultureInfo.InvariantCulture);
|
||||
// using var pbkdf2 =
|
||||
// new Rfc2898DeriveBytes(inputString, Encoding.UTF8.GetBytes(salt), 10000, HashAlgorithmName.SHA256);
|
||||
// byte[] key_bytes = pbkdf2.GetBytes(keyLength); // 원하는 길이의 바이트 배열 생성
|
||||
// return BitConverter.ToString(key_bytes).Replace("-", "").ToLower()[..keyLength]; // 원하는 길이만큼 잘라서 반환
|
||||
// }
|
||||
//
|
||||
// public static string generateAccessKeyTest()
|
||||
// {
|
||||
// var key = generateAccessKey("test");
|
||||
// return key;
|
||||
// }
|
||||
//
|
||||
// public static string getErrorName(int errorCode)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var error_name = (BrokerApiErrorCode)errorCode;
|
||||
// return error_name.ToString();
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// return errorCode.ToString();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public static string encrypt(string plainText, string planetSecretKey, string tokenSecret)
|
||||
// {
|
||||
// var key = Encoding.UTF8.GetBytes(tokenSecret);
|
||||
// var iv = Encoding.UTF8.GetBytes(planetSecretKey);
|
||||
// using Aes aes_alg = Aes.Create();
|
||||
// aes_alg.Key = key;
|
||||
// aes_alg.IV = iv;
|
||||
//
|
||||
// ICryptoTransform encryptor = aes_alg.CreateEncryptor(aes_alg.Key, aes_alg.IV);
|
||||
//
|
||||
// using (MemoryStream ms_encrypt = new MemoryStream())
|
||||
// {
|
||||
// using (CryptoStream cs_encrypt = new CryptoStream(ms_encrypt, encryptor, CryptoStreamMode.Write))
|
||||
// {
|
||||
// using (StreamWriter sw_encrypt = new StreamWriter(cs_encrypt))
|
||||
// {
|
||||
// sw_encrypt.Write(plainText);
|
||||
// }
|
||||
//
|
||||
// return Convert.ToBase64String(ms_encrypt.ToArray());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public static string decrypt(string cipherText, string planetSecretKey, string tokenSecret)
|
||||
// {
|
||||
// var key = Encoding.UTF8.GetBytes(tokenSecret);
|
||||
// var iv = Encoding.UTF8.GetBytes(planetSecretKey);
|
||||
//
|
||||
// byte[] buffer = Convert.FromBase64String(cipherText);
|
||||
// using Aes aes_alg = Aes.Create();
|
||||
// aes_alg.Key = key;
|
||||
// aes_alg.IV = iv;
|
||||
//
|
||||
// ICryptoTransform decryptor = aes_alg.CreateDecryptor(aes_alg.Key, aes_alg.IV);
|
||||
//
|
||||
// using (MemoryStream ms_decrypt = new MemoryStream(buffer))
|
||||
// {
|
||||
// using (CryptoStream cs_decrypt = new CryptoStream(ms_decrypt, decryptor, CryptoStreamMode.Read))
|
||||
// {
|
||||
// using (StreamReader sr_decrypt = new StreamReader(cs_decrypt))
|
||||
// {
|
||||
// return sr_decrypt.ReadToEnd();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
18
BrokerApiTest/TestHelper/ValueResult.cs
Normal file
18
BrokerApiTest/TestHelper/ValueResult.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
// namespace BrokerCore.Common;
|
||||
//
|
||||
// public class ValueResult<TValue>
|
||||
// {
|
||||
// public Result Result { get; init; }
|
||||
// public TValue? Value { get; set; }
|
||||
//
|
||||
// public ValueResult()
|
||||
// {
|
||||
// Result = new Result();
|
||||
// }
|
||||
//
|
||||
// public ValueResult(Result result, TValue? value)
|
||||
// {
|
||||
// Result = result;
|
||||
// Value = value;
|
||||
// }
|
||||
// }
|
||||
133
BrokerApiTest/User/UserDocRepoTests.cs
Normal file
133
BrokerApiTest/User/UserDocRepoTests.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
|
||||
|
||||
using MODULE_ID = System.UInt32;
|
||||
|
||||
|
||||
namespace BrokerTest.User;
|
||||
|
||||
public class TestServerLogic : IServerLogic
|
||||
{
|
||||
private DynamoDbClient m_dynamo_db_client;
|
||||
private ServerConfig m_server_config;
|
||||
|
||||
public TestServerLogic(DynamoDbClient dynamoDbClient, ServerConfig serverConfig)
|
||||
{
|
||||
m_dynamo_db_client = dynamoDbClient;
|
||||
m_server_config = serverConfig;
|
||||
}
|
||||
|
||||
public DynamoDbClient getDynamoDbClient() => m_dynamo_db_client;
|
||||
|
||||
public RedisConnector getRedisConnector()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public ServerConfig getServerConfig() => m_server_config;
|
||||
|
||||
public string getServerName() => "TestServer";
|
||||
|
||||
public string getServerType() => "BrokerApi";
|
||||
|
||||
public string toBasicString() => "TestServerLogic";
|
||||
|
||||
public IModule getModule(MODULE_ID moduleId) { throw new NullReferenceException(); }
|
||||
|
||||
public Result registerEntityTicker(EntityTicker entityTicker) { throw new NullReferenceException(); }
|
||||
}
|
||||
|
||||
// public class UserDocRepoTests
|
||||
// {
|
||||
// private readonly ServerConfig m_server_config = new ServerConfig();
|
||||
// private DynamoDbClient? m_dynamo_db_client;
|
||||
// private bool m_is_init = false;
|
||||
// private TestServerLogic? m_server_logic;
|
||||
//
|
||||
// // public UserDocRepoTests()
|
||||
// // {
|
||||
// // // var user = new UserEntity();
|
||||
// // // user.OnInit();
|
||||
// // }
|
||||
//
|
||||
// private async Task init()
|
||||
// {
|
||||
// if (m_is_init) return;
|
||||
// Log.NLogFileName = "./Config/nlog-BrokerApiServer.config";
|
||||
// Log.initLog("BrokerApiServerTest", "Developer");
|
||||
// var path = "./Config/ServerConfig-Local.json";
|
||||
// var full_path = Path.GetFullPath(path);
|
||||
// m_server_config.setConfigFilePath(full_path);
|
||||
// var result =m_server_config.loadConfig();
|
||||
// Assert.True(result.isSuccess());
|
||||
// Assert.NotNull(m_dynamo_db_client);
|
||||
// m_server_logic = new TestServerLogic(m_dynamo_db_client, m_server_config);
|
||||
// ServerLogicApp.setServerLogicApp(m_server_logic);
|
||||
//
|
||||
// m_dynamo_db_client = new DynamoDbClient();
|
||||
// var connection_result = m_dynamo_db_client.connectToDb(m_server_config);
|
||||
// await m_dynamo_db_client.createDBIfNotExists(false);
|
||||
// Assert.True(connection_result.isSuccess());
|
||||
//
|
||||
// m_is_init = true;
|
||||
// }
|
||||
//
|
||||
// [Fact]
|
||||
// public async Task findTests()
|
||||
// {
|
||||
// await init();
|
||||
//
|
||||
// //=============================================================================================
|
||||
// // db에 "heon3" 계정이 존재한다는 전제로 테스트 진행
|
||||
// //=============================================================================================
|
||||
//
|
||||
// // TODO: 계정을 생성하는 절차를 추가할 것
|
||||
//
|
||||
// var account_id = "heon3";
|
||||
// Assert.NotNull(m_dynamo_db_client);
|
||||
// var account_repo = new AccountDocRepo(m_dynamo_db_client);
|
||||
// var (result_account, account_attrib) = await account_repo.findAccountBaseAttrib(account_id);
|
||||
// Assert.True(result_account.isSuccess());
|
||||
// Assert.NotNull(account_attrib);
|
||||
//
|
||||
// var user_guid = account_attrib.UserGuid;
|
||||
// Assert.NotNull(user_guid);
|
||||
//
|
||||
// var user_doc_repo = new UserBaseDocRepo(m_dynamo_db_client);
|
||||
// var (result_user, user_attrib) = await user_doc_repo.findUserBaseAttrib(user_guid);
|
||||
// Assert.True(result_user.isSuccess());
|
||||
// Assert.NotNull(user_attrib);
|
||||
// Assert.True(user_attrib.UserGuid == user_guid);
|
||||
// Assert.True(user_attrib.AccountId == account_id);
|
||||
//
|
||||
// // var money_doc_repo = new MoneyDocRepo(m_dynamo_db_client);
|
||||
// // var (result_money, money_attrib) = await money_doc_repo.findMoneyAttrib(user_guid, CancellationToken.None);
|
||||
// // Assert.True(result_money.isSuccess());
|
||||
// // Assert.NotNull(money_attrib);
|
||||
// // Assert.True(money_attrib.Sapphire >= 0);
|
||||
// // Assert.True(money_attrib.Gold >= 0);
|
||||
// // Assert.True(money_attrib.Ruby >= 0);
|
||||
// // Assert.True(money_attrib.Calium >= 0);
|
||||
// }
|
||||
//
|
||||
// private async Task<string> findUser(string accountId)
|
||||
// {
|
||||
// await init();
|
||||
// Assert.NotNull(m_dynamo_db_client);
|
||||
// var account_repo = new AccountDocRepo(m_dynamo_db_client);
|
||||
// var (result_account, account_attrib) = await account_repo.findAccountBaseAttrib(accountId);
|
||||
// Assert.True(result_account.isSuccess());
|
||||
// Assert.NotNull(account_attrib);
|
||||
//
|
||||
// var user_guid = account_attrib.UserGuid;
|
||||
// Assert.NotNull(user_guid);
|
||||
//
|
||||
// var user_doc_repo = new UserBaseDocRepo(m_dynamo_db_client);
|
||||
// var (result_user, user_attrib) = await user_doc_repo.findUserBaseAttrib(user_guid);
|
||||
// Assert.True(result_user.isSuccess());
|
||||
// Assert.NotNull(user_attrib);
|
||||
// return user_attrib.UserGuid;
|
||||
// }
|
||||
// }
|
||||
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AWS.Logger.Core.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AWS.Logger.Core.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.CloudWatchLogs.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.CloudWatchLogs.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.Core.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.Core.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.DynamoDBv2.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.DynamoDBv2.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.OpenSearchService.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.OpenSearchService.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.S3.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.S3.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.SecurityToken.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AWSSDK.SecurityToken.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/Asp.Versioning.Abstractions.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/Asp.Versioning.Abstractions.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/Asp.Versioning.Http.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/Asp.Versioning.Http.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/Asp.Versioning.Mvc.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/Asp.Versioning.Mvc.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AsyncLock.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AsyncLock.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/AsyncStateMachine.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/AsyncStateMachine.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/Axion.ConcurrentHashSet.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/Axion.ConcurrentHashSet.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/BouncyCastle.Cryptography.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/BouncyCastle.Cryptography.dll
Normal file
Binary file not shown.
2425
BrokerApiTest/bin/Debug/net8.0/BrokerApiCore.deps.json
Normal file
2425
BrokerApiTest/bin/Debug/net8.0/BrokerApiCore.deps.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiCore.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiCore.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiCore.pdb
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiCore.pdb
Normal file
Binary file not shown.
140
BrokerApiTest/bin/Debug/net8.0/BrokerApiCore.xml
Normal file
140
BrokerApiTest/bin/Debug/net8.0/BrokerApiCore.xml
Normal file
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>BrokerApiCore</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_105106">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_105106.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_105106.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_105106.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_121410">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_121410.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_121410.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_121410.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_145503">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_145503.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_145503.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_145503.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_152918">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_152918.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_152918.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_152918.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_153518">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_153518.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_153518.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_153518.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_160851">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_160851.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_160851.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_160851.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_110113">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_110113.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_110113.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_110113.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_120450">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_120450.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_120450.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_120450.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_122745">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_122745.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_122745.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_122745.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_124658">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_124658.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_124658.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_124658.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:BrokerApiCore.Migrations.SchemaChanges_164908">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_164908.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_164908.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:BrokerApiCore.Migrations.SchemaChanges_164908.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
2763
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.deps.json
Normal file
2763
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.deps.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.exe
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.exe
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.pdb
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.pdb
Normal file
Binary file not shown.
20
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.xml
Normal file
20
BrokerApiTest/bin/Debug/net8.0/BrokerApiServer.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>BrokerApiServer</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:BrokerCore.Common.RequireAdminAuthAttribute">
|
||||
<summary>
|
||||
엑세스 토큰 인증이 필요한 컨트롤러를 지정하는 애노테이션(Attribute) 정의
|
||||
밴 상태 체크 이슈
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:BrokerCore.Common.RequirePlanetAuthAttribute">
|
||||
<summary>
|
||||
엑세스 토큰 인증이 필요한 컨트롤러를 지정하는 애노테이션(Attribute) 정의
|
||||
밴 상태 체크 이슈
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
6733
BrokerApiTest/bin/Debug/net8.0/BrokerApiTest.deps.json
Normal file
6733
BrokerApiTest/bin/Debug/net8.0/BrokerApiTest.deps.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiTest.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiTest.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiTest.pdb
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/BrokerApiTest.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App",
|
||||
"version": "8.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.Reflection.NullabilityInfoContext.IsSupported": true,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
BrokerApiTest/bin/Debug/net8.0/Castle.Core.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/Castle.Core.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/CommandLine.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/CommandLine.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/CommunityToolkit.Diagnostics.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/CommunityToolkit.Diagnostics.dll
Normal file
Binary file not shown.
162
BrokerApiTest/bin/Debug/net8.0/Config/ServerConfig-Dev.json
Normal file
162
BrokerApiTest/bin/Debug/net8.0/Config/ServerConfig-Dev.json
Normal file
@@ -0,0 +1,162 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": true,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Dev",
|
||||
"StandaloneMode": true,
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 500,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
"SessionKeepAliveTimeSec": 3600,
|
||||
"MinWorkerThreadCount": 100,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
|
||||
"Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
|
||||
|
||||
"Dynamodb": "http://localhost:8000",
|
||||
|
||||
"MongoDb": {
|
||||
"ConnectionString": "mongodb://root:root@localhost:27017",
|
||||
"DatabaseName": "Metaverse",
|
||||
"MinConnectionPoolSize": 0,
|
||||
"MaxConnectionPoolSize": 100,
|
||||
"WaitQueueTimeoutSecs": 120
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
"Enable": true,
|
||||
"LocalDynamoDB": false,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": false,
|
||||
"LogGroup": "MetaverseLog-Dev",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"server": "${event-properties:server}",
|
||||
"ip/port": "${event-properties:ip/port}",
|
||||
"threadId": "${threadid}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Dev",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-test",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": false,
|
||||
"PlatformTypeAllows": ""
|
||||
},
|
||||
|
||||
"LoadBalancingRule": {
|
||||
"AuthToGameRule": {
|
||||
"Rule": "WeightedRoundRobin",
|
||||
"MinRate": 0,
|
||||
"MaxRate": 100,
|
||||
"UserLanguageBased": true
|
||||
}
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": { "Ko": "https://caliverse.io/shop" } },
|
||||
{ "ChatAiApiServerUrl": { "Ko": "https://caliverse-dev-api.caveduck.io" } },
|
||||
{ "S3ResourceImageUrl": { "Ko": "https://d3s9natejb9ydz.cloudfront.net/Dev" } }
|
||||
],
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": false,
|
||||
"CPNftForOwnerAllGetUrl": "https://dev-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-dev-rollup-admin-api.caliverse.io",
|
||||
"SlackAddress": "https://hooks.slack.com/services/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"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://caliverse-dev-api.caveduck.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://dev-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "https://dev-ugqapi.caliverse.io:11000",
|
||||
//"ApiServerAddress": "http://localhost:1000",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "localhost",
|
||||
"Port": 5672,
|
||||
"UserName": "admin",
|
||||
"Password": "admin",
|
||||
"SSL": false
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 1200000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 3600000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": false,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable": true,
|
||||
|
||||
"MetaverseBroker": {
|
||||
"JwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
"ExpireMinutes": 1440,
|
||||
"SsoAccountDb": "Server=dev-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"MetaverseBrokerDb": "Server=metaverse-broker-dev.cdn6gxjy33pu.us-west-2.rds.amazonaws.com;Port=3306;User ID=broker_user;Password=Apxkqjtmqmfhzj;Database=metaverse-broker",
|
||||
"MetaverseBrokerDbLocal": "Server=localhost;Port=3307;User ID=broker_user;Password=qmfhzjdbwj;Database=metaverse-broker"
|
||||
}
|
||||
}
|
||||
|
||||
150
BrokerApiTest/bin/Debug/net8.0/Config/ServerConfig-QA.json
Normal file
150
BrokerApiTest/bin/Debug/net8.0/Config/ServerConfig-QA.json
Normal file
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": false,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Qa",
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 600,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
|
||||
"SessionKeepAliveTimeSec": 3600,
|
||||
"MinWorkerThreadCount": 200,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=qa-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=k0RantM9gOAg5ATecBTFXzbCYDnvXi;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=qa-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=k0RantM9gOAg5ATecBTFXzbCYDnvXi;Database=caliverse",
|
||||
|
||||
"Redis": "clustercfg.metaverse-qa-cluster.ocif0u.usw2.cache.amazonaws.com:6379,password=wiUaVvNwX4PhBj&8,ssl=true,abortConnect=false",
|
||||
"Dynamodb": "",
|
||||
|
||||
"MongoDb": {
|
||||
"ConnectionString": "mongodb://qrwugqmongoconnect:qrw#$943cali@ip-172-40-141-201.us-west-2.compute.internal:27017/Metaverse",
|
||||
"DatabaseName": "Metaverse",
|
||||
"MinConnectionPoolSize": 0,
|
||||
"MaxConnectionPoolSize": 100,
|
||||
"WaitQueueTimeoutSecs": 120
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
"Enable": true,
|
||||
"LocalDynamoDB": false,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": true,
|
||||
"LogGroup": "MetaverseLog-QA",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"server": "${event-properties:server}",
|
||||
"ip/port": "${event-properties:ip/port}",
|
||||
"threadId": "${threadid}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Qa",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-qa",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": true,
|
||||
"PlatformTypeAllows": "WindowsPc"
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": { "Ko": "https://qa.caliverse.io/shop" } },
|
||||
{ "ChatAiApiServerUrl": { "Ko": "https://caliverse-qa-api.caveduck.io" } },
|
||||
{ "S3ResourceImageUrl": { "Ko": "https://d3s9natejb9ydz.cloudfront.net/QA" } }
|
||||
],
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": true,
|
||||
"CPNftForOwnerAllGetUrl": "https://qa-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://caliverse-qa-api.caveduck.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-qa-rollup-admin-api.caliverse.io",
|
||||
"SlackAddress": "https://hooks.slack.com/services/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"
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://qa-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "http://internal-Metaverse-QA-UGQAPI-Game-1559632298.us-west-2.elb.amazonaws.com:11201",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "b-d7c76a76-156d-4d55-8614-d4ce122a47c3.mq.us-west-2.amazonaws.com",
|
||||
"Port": 5671,
|
||||
"UserName": "serveruser",
|
||||
"Password": "Zkfflqjtm!33&*(",
|
||||
"SSL": true
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 120000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 300000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": true,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable": true,
|
||||
|
||||
"MetaverseBroker": {
|
||||
"JwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
"ExpireMinutes": 1440,
|
||||
"SsoAccountDb": "Server=qa-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=k0RantM9gOAg5ATecBTFXzbCYDnvXi;Database=caliverse",
|
||||
"MetaverseBrokerDb": "Server=metaverse-broker-qa.cdn6gxjy33pu.us-west-2.rds.amazonaws.com;Port=3306;User ID=broker_user;Password=06M67cKVhHDpVipisA2g;Database=metaverse-broker",
|
||||
"MetaverseBrokerDbLocal": "Server=localhost;Port=3307;User ID=root;Password=root;Database=metaverse-broker"
|
||||
}
|
||||
}
|
||||
|
||||
151
BrokerApiTest/bin/Debug/net8.0/Config/ServerConfig-Stage.json
Normal file
151
BrokerApiTest/bin/Debug/net8.0/Config/ServerConfig-Stage.json
Normal file
@@ -0,0 +1,151 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": false,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Stage",
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 600,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
|
||||
"SessionKeepAliveTimeSec": 600,
|
||||
"MinWorkerThreadCount": 200,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=stage-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=caliverse;Password=XjEDXb8fi9ZXP5PaxDCxPWeXK03mzk;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=stage-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=caliverse;Password=XjEDXb8fi9ZXP5PaxDCxPWeXK03mzk;Database=caliverse",
|
||||
|
||||
"Redis": "clustercfg.metaverse-stage-cluster.ocif0u.usw2.cache.amazonaws.com:6379,password=wiUaVvNwX4PhBj&8,ssl=true,abortConnect=false",
|
||||
"Dynamodb": "",
|
||||
|
||||
"MongoDb": {
|
||||
"ConnectionString": "mongodb+srv://stageugqapirw:uY3xQzVURk59S7Vu@stage-ugqapi.7d0do.mongodb.net/?retryWrites=true&w=majority&appName=stage-ugqapi",
|
||||
"DatabaseName": "Metaverse",
|
||||
"MinConnectionPoolSize": 0,
|
||||
"MaxConnectionPoolSize": 100,
|
||||
"WaitQueueTimeoutSecs": 120
|
||||
},
|
||||
|
||||
"AWS": {
|
||||
"Enable": true,
|
||||
"LocalDynamoDB": false,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": true,
|
||||
"LogGroup": "MetaverseLog-Stage",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"server": "${event-properties:server}",
|
||||
"ip/port": "${event-properties:ip/port}",
|
||||
"threadId": "${threadid}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Stage",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-stage",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": true,
|
||||
"PlatformTypeAllows": "WindowsPc"
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": { "Ko": "https://stage.caliverse.io/shop" } },
|
||||
{ "ChatAiApiServerUrl": { "Ko": "https://caliverse-stage-api.caveduck.io" } },
|
||||
{ "S3ResourceImageUrl": { "Ko": "https://d3s9natejb9ydz.cloudfront.net/Stage" } }
|
||||
],
|
||||
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": true,
|
||||
"CPNftForOwnerAllGetUrl": "https://stage-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://caliverse-stage-api.caveduck.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-stage-rollup-admin-api.caliverse.io",
|
||||
"SlackAddress": "https://hooks.slack.com/services/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"
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://stage-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "http://internal-Metaverse-Stage-UGQAPI-Game-88775700.us-west-2.elb.amazonaws.com:11201",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "b-d0e44de3-7fb3-4120-b851-4566002eaf8e.mq.us-west-2.amazonaws.com",
|
||||
"Port": 5671,
|
||||
"UserName": "serveruser",
|
||||
"Password": "Zkfflqjtm!33&*(",
|
||||
"SSL": true
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 120000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 300000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": true,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable": true,
|
||||
|
||||
"MetaverseBroker": {
|
||||
"JwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
"ExpireMinutes": 1440,
|
||||
"SsoAccountDb": "Server=stage-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=caliverse;Password=XjEDXb8fi9ZXP5PaxDCxPWeXK03mzk;Database=caliverse",
|
||||
"MetaverseBrokerDb": "Server=metaverse-broker-stage.cdn6gxjy33pu.us-west-2.rds.amazonaws.com;Port=3306;User ID=broker_user;Password=WkH44p4KiUDVzk5aPfANGtpCu6;Database=metaverse-broker",
|
||||
"MetaverseBrokerDbLocal": "Server=localhost;Port=3307;User ID=root;Password=root;Database=metaverse-broker"
|
||||
}
|
||||
}
|
||||
|
||||
216
BrokerApiTest/bin/Debug/net8.0/Config/ServerConfig.json
Normal file
216
BrokerApiTest/bin/Debug/net8.0/Config/ServerConfig.json
Normal file
@@ -0,0 +1,216 @@
|
||||
{
|
||||
"LogDir": "./Logs",
|
||||
"DumpDir": "./",
|
||||
"LocalServer": true,
|
||||
"SingleThreaded": false,
|
||||
"ServiceType": "Dev",
|
||||
"StandaloneMode": true,
|
||||
"OfflineMode": false,
|
||||
"DefaultMaxUser": 500,
|
||||
"ClientListen": {
|
||||
"Ip": "",
|
||||
"Port": 0
|
||||
},
|
||||
|
||||
"SessionKeepAliveTimeSec": 3600,
|
||||
"MinWorkerThreadCount": 100,
|
||||
"MinIoThreadCount": 0,
|
||||
|
||||
"AccountLoginBlockEnable": false,
|
||||
|
||||
"SsoAccountDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"SsoAccountAuthJwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
|
||||
"AccountNftDb": "Server=localhost;Port=13306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
|
||||
"Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
|
||||
|
||||
"Dynamodb": "http://localhost:8000",
|
||||
|
||||
"AWS": {
|
||||
"Enable": false,
|
||||
"LocalDynamoDB": false,
|
||||
"AccessKey": "AKIA4G3CB4Z5T6JUPHJN",
|
||||
"SecretKey": "G82Bq5tCUTvSPe9InGayH8kONbtEnLxMrgzrAbCn",
|
||||
"Region": "us-west-2",
|
||||
"MilestoneName": "MS5",
|
||||
|
||||
"CloudWatchLog": {
|
||||
"Enable": false,
|
||||
"LogGroup": "MetaverseLog-Dev",
|
||||
"LogNamePattern": "Developer",
|
||||
"LogLevel": "Debug",
|
||||
"Layout": {
|
||||
"logTime": "${date:universalTime=true:format=yyyy-MM-ddTHH\\:mm\\:ss.fffZ}",
|
||||
"level": "${level:upperCase=true}",
|
||||
"message": "${message}",
|
||||
"player": "${event-properties:player}",
|
||||
"properties": "{event-properties:properties}",
|
||||
"threadId": "${threadid}",
|
||||
"function": "${event-properties:memberName}",
|
||||
"filePath": "${event-properties:filePath}",
|
||||
"lineNumber": "${event-properties:lineNumber}",
|
||||
"server": "${event-properties:server}",
|
||||
"ipport": "${event-properties:ipport}"
|
||||
}
|
||||
},
|
||||
|
||||
"S3": {
|
||||
"ServiceFolderName": "Dev",
|
||||
"MyhomeUgcInfoBucketName": "metaverse-myhomeugc-test",
|
||||
"BeaconAppProfileBucketName": "metaverse-beacon-appprofile"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
"ClientProgramVersionCheck": false,
|
||||
"ClientMinimumRequiredLogicVersion": 0,
|
||||
"ProgramVersionPath": ".\\Version\\",
|
||||
"ProgramVersion": {
|
||||
"MetaSchemaVersion": "MetaSchemaVersion.json",
|
||||
"MetaDataVersion": "MetaDataVersion.json",
|
||||
"PacketVersion": "PacketVersion.json",
|
||||
"ResourceVersion": "ServerResourceVersion.json",
|
||||
"ConfigVersion": "ServerConfigVersion.json",
|
||||
"LogicVersion": "ServerBinaryVersion.json",
|
||||
"DbSchemaVersion": "DbSchemaVersion.json"
|
||||
},
|
||||
"CheatCommandAlwaysAllow": true,
|
||||
|
||||
|
||||
"AuthRule": {
|
||||
"ClientStandaloneAllow": true,
|
||||
"ClientBySsoAccountAuthWithLauncherAllow": false,
|
||||
"PlatformTypeAllows": ""
|
||||
},
|
||||
|
||||
"LoadBalancingRule": {
|
||||
"AuthToGameRule": {
|
||||
"Rule": "WeightedRoundRobin",
|
||||
"MinRate": 0,
|
||||
"MaxRate": 100,
|
||||
"UserLanguageBased": true
|
||||
}
|
||||
},
|
||||
|
||||
"ServerApiUrlCatalog": [
|
||||
{ "BillingApiServerUrl": "https://caliverse.io/shop" },
|
||||
{ "ChatAiApiServerUrl": "https://caliverse-dev-api.caveduck.io" },
|
||||
{ "S3ResourceImageUrl": "https://d3s9natejb9ydz.cloudfront.net/Dev" },
|
||||
{
|
||||
"RentalGuideURL": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/land/land-rental",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/land/land-rental",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/land/land-rental"
|
||||
}
|
||||
},
|
||||
{
|
||||
"LandAuctionWebGuide": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/land/land-rental",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/land/land-rental",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/land/land-rental"
|
||||
}
|
||||
},
|
||||
{
|
||||
"LandManageGuideURL": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/land/land-management",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/land/land-management",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/land/land-management"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Calium_Exchange_Web1": {
|
||||
"ko": "https://calidocu.gitbook.io/calium-eco-system/calium-inflation-system-and-its-principles",
|
||||
"en": "https://calidocu.gitbook.io/calium-eco-system/en/calium-inflation-system-and-its-principles",
|
||||
"jp": "https://calidocu.gitbook.io/calium-eco-system/jp/calium-inflation-system-and-its-principles"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Calium_Exchange_Web2": {
|
||||
"ko": "https://calium.caliverse.io/onchain",
|
||||
"en": "https://calium.caliverse.io/onchain",
|
||||
"jp": "https://calium.caliverse.io/onchain"
|
||||
}
|
||||
},
|
||||
{
|
||||
"MyhomeEditGuideUrl": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/caliverse-feature-guide/interior",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/caliverse-feature-guide/interior",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/caliverse-feature-guide/interior"
|
||||
}
|
||||
},
|
||||
{
|
||||
"WebLinkUrlSeasonPass": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/pass-and-claim/season-pass",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/pass-and-claim/season-pass",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/pass-and-claim/season-pass"
|
||||
}
|
||||
},
|
||||
{
|
||||
"WebLinkURLCurrency": {
|
||||
"ko": "https://caliverse.io/shop",
|
||||
"en": "https://caliverse.io/en/shop",
|
||||
"jp": "https://caliverse.io/en/shop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CaliumConverterWebGuide": {
|
||||
"ko": "https://calidocu.gitbook.io/caliverse-metaverse/calium/calium-converter",
|
||||
"en": "https://calidocu.gitbook.io/caliverse-metaverse/en/calium/calium-converter",
|
||||
"jp": "https://calidocu.gitbook.io/caliverse-metaverse/jp/calium/calium-converter"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
"NftRule": {
|
||||
"NftDBAccess": false,
|
||||
"CPNftForOwnerAllGetUrl": "https://dev-api.caliverse.io/v1/nft/game"
|
||||
},
|
||||
|
||||
"EchoSystem": {
|
||||
"BaseAddress": "https://eco-system-dev-rollup-admin-api.caliverse.io"
|
||||
},
|
||||
|
||||
"AIChat": {
|
||||
"BaseAddress": "https://caliverse-dev-api.caveduck.io",
|
||||
"PrivateKey": "PPt+3OLhgLnXCGXrezRL4ZmtA3FmCZtjOgDPvx1MMAY/0VcXFDQQfBRnfR4c2FmzGILuPjue/xtNyLUFOe3EYg=="
|
||||
},
|
||||
|
||||
"Billing": {
|
||||
"BaseAddress": "https://dev-api.caliverse.io"
|
||||
},
|
||||
|
||||
"Ugq": {
|
||||
"ApiServerAddress": "https://dev-ugqapi.caliverse.io:11000",
|
||||
//"ApiServerAddress": "http://localhost:1000",
|
||||
"UrlInGamePrefix": "/api/v1/InGame"
|
||||
},
|
||||
|
||||
"Rabbitmq": {
|
||||
"HostName": "localhost",
|
||||
"Port": 5672,
|
||||
"UserName": "admin",
|
||||
"Password": "admin",
|
||||
"SSL": false
|
||||
},
|
||||
|
||||
"GameConfig": {
|
||||
"ReservationWaitTimeMSec": 1200000,
|
||||
"LoginCacheExpiryTimeMSec": 3600000,
|
||||
"ServerSwitchCacheExpiryTimeMSec": 3600000
|
||||
},
|
||||
|
||||
"ControlAgentEnable": false,
|
||||
|
||||
"PerformanceCheckEnable": false,
|
||||
|
||||
"BattleSystemEnable" : true,
|
||||
|
||||
"MetaverseBroker": {
|
||||
"JwtSecretKey": "zgoRtipbFcgQp0VGP8VZW8QhW4ll1swfvASqwr78",
|
||||
"ExpireMinutes": 1440,
|
||||
"SsoAccountDb": "Server=dev-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com;Port=3306;User ID=external_ro;Password=bQNEXbRWQTtV6bwlqktGyBiuf2KqYF;Database=caliverse",
|
||||
"MetaverseBrokerDb": "Server=metaverse-broker-dev.cdn6gxjy33pu.us-west-2.rds.amazonaws.com;Port=3306;User ID=caliverse;Password=Apxkqjtmqmfhzj;Database=metaverse-broker",
|
||||
"MetaverseBrokerDbLocal": "Server=localhost;Port=3307;User ID=broker;Password=broker;Database=metaverse-broker"
|
||||
}
|
||||
}
|
||||
95
BrokerApiTest/bin/Debug/net8.0/Config/nlog.config
Normal file
95
BrokerApiTest/bin/Debug/net8.0/Config/nlog.config
Normal file
@@ -0,0 +1,95 @@
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
throwConfigExceptions="true"
|
||||
autoReload="true"
|
||||
internalLogLevel="Error"
|
||||
internalLogToConsole="true">
|
||||
|
||||
<extensions>
|
||||
<add assembly="NLog.AWS.Logger" />
|
||||
</extensions>
|
||||
|
||||
<targets async="true">
|
||||
<!--
|
||||
<target name="logconsole" xsi:type="Console"
|
||||
layout="${longdate:universalTime=true} ${level} [${threadid}] [${event-properties:memberName}] ${message}" />
|
||||
-->
|
||||
<target name="logfile" xsi:type="File"
|
||||
fileName="${basedir}/logs/${ProcessName}.log"
|
||||
archiveFileName="${basedir}/logs/${ProcessName}_{###}.log"
|
||||
archiveAboveSize="10240000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveDays= "2"
|
||||
maxArchiveFiles= "5"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm"
|
||||
layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}|${level:uppercase=true}|${threadid}|${message}|${event-properties:memberName}|${event-properties:filePath}:${event-properties:lineNumber}"/>
|
||||
|
||||
<target name="businessLogFile" xsi:type="File"
|
||||
fileName="${basedir}/logs/Business_${ProcessName}.json"
|
||||
archiveFileName="${basedir}/logs/archive/business/Business_${ProcessName}_{###}.json"
|
||||
archiveAboveSize="1024000000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveDays= "4"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm">
|
||||
<layout xsi:type="JsonLayout" includeEventProperties="true" excludeProperties="Comma-separated list (string)">
|
||||
<attribute name="logTime" layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}" />
|
||||
<attribute name="level" layout="${level:upperCase=true}"/>
|
||||
<attribute name="message" layout="${message}" />
|
||||
</layout>
|
||||
</target>
|
||||
|
||||
<target name="developLogFile" xsi:type="File"
|
||||
fileName="${basedir}/logs/${ProcessName}.json"
|
||||
archiveFileName="${basedir}/logs/archive/develop/${ProcessName}_{###}.json"
|
||||
archiveAboveSize="1024000000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveDays= "2"
|
||||
maxArchiveFiles= "5"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd-HH-mm">
|
||||
<layout xsi:type="JsonLayout" includeEventProperties="true" excludeProperties="Comma-separated list (string)">
|
||||
<attribute name="logTime" layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}" />
|
||||
<attribute name="threadid" layout="${threadid}" />
|
||||
<attribute name="level" layout="${level:upperCase=true}"/>
|
||||
<attribute name="message" layout="${message}" />
|
||||
</layout>
|
||||
</target>
|
||||
|
||||
<target name="logconsole" xsi:type="ColoredConsole"
|
||||
layout="${longdate:universalTime=true}|${level:uppercase=true}|${threadid}|${message}|${event-properties:filePath}:${event-properties:lineNumber}">
|
||||
<highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" />
|
||||
<highlight-row condition="level == LogLevel.Info" foregroundColor="DarkGray" />
|
||||
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
|
||||
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
|
||||
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" />
|
||||
</target>
|
||||
|
||||
<target name="logSeqFile" xsi:type="File"
|
||||
fileName="${basedir}/../../bin/LogSequence/${ProcessName}.log"
|
||||
archiveFileName="${basedir}/../../bin/LogSequence/${ProcessName}_{#}.Sequence.bak"
|
||||
archiveAboveSize="10240000"
|
||||
archiveNumbering="DateAndSequence"
|
||||
archiveEvery="Day"
|
||||
maxArchiveFiles= "1000"
|
||||
archiveOldFileOnStartup="true"
|
||||
ConcurrentWrites="true"
|
||||
archiveDateFormat="yyyy-MM-dd"
|
||||
layout="${ticks},${event-properties:sender},${event-properties:receiver},${message}:${event-properties:errordesc}"/>
|
||||
|
||||
</targets>
|
||||
<rules>
|
||||
<logger name="Developer" minlevel="Info" writeTo="logconsole"/>
|
||||
<logger name="Developer" minlevel="Debug" writeTo="developLogFile"/>
|
||||
<logger name="BusinessLogger" minlevel="Info" writeTo="businessLogFile"/>
|
||||
<!-->logger name="*" minlevel="Error" writeTo="logfile"/-->
|
||||
<logger name="SequenceLogger" minlevel="Debug" writeTo="logSeqFile"/>
|
||||
</rules>
|
||||
</nlog>
|
||||
318
BrokerApiTest/bin/Debug/net8.0/ControlCenter.Grpc.deps.json
Normal file
318
BrokerApiTest/bin/Debug/net8.0/ControlCenter.Grpc.deps.json
Normal file
@@ -0,0 +1,318 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"ControlCenter.Grpc/1.0.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Grpc.AspNetCore": "2.63.0",
|
||||
"Grpc.AspNetCore.Server.Reflection": "2.63.0",
|
||||
"Grpc.Tools": "2.64.0"
|
||||
},
|
||||
"runtime": {
|
||||
"ControlCenter.Grpc.dll": {}
|
||||
}
|
||||
},
|
||||
"Google.Protobuf/3.27.1": {
|
||||
"runtime": {
|
||||
"lib/net5.0/Google.Protobuf.dll": {
|
||||
"assemblyVersion": "3.27.1.0",
|
||||
"fileVersion": "3.27.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.AspNetCore/2.63.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Grpc.AspNetCore.Server.ClientFactory": "2.63.0",
|
||||
"Grpc.Tools": "2.64.0"
|
||||
}
|
||||
},
|
||||
"Grpc.AspNetCore.Server/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.Net.Common": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.AspNetCore.Server.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.AspNetCore.Server.ClientFactory/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.AspNetCore.Server": "2.63.0",
|
||||
"Grpc.Net.ClientFactory": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.AspNetCore.Server.ClientFactory.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.AspNetCore.Server.Reflection/2.63.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Grpc.AspNetCore.Server": "2.63.0",
|
||||
"Grpc.Reflection": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.AspNetCore.Server.Reflection.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Core.Api/2.63.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/Grpc.Core.Api.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Net.Client/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.Net.Common": "2.63.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.Net.Client.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Net.ClientFactory/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.Net.Client": "2.63.0",
|
||||
"Microsoft.Extensions.Http": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.Net.ClientFactory.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Net.Common/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.Core.Api": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.Net.Common.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Reflection/2.63.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Grpc.Core.Api": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Grpc.Reflection.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Tools/2.64.0": {},
|
||||
"Microsoft.Extensions.DependencyInjection/6.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/6.0.0": {},
|
||||
"Microsoft.Extensions.Http/6.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Logging": "6.0.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Options": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging/6.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection": "6.0.0",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Options": "6.0.0",
|
||||
"System.Diagnostics.DiagnosticSource": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/6.0.0": {},
|
||||
"Microsoft.Extensions.Options/6.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
|
||||
"Microsoft.Extensions.Primitives": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.Diagnostics.DiagnosticSource/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.0.0": {}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"ControlCenter.Grpc/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Google.Protobuf/3.27.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-7IVz9TzhYCZ8qY0rPhXUnyJSXYdshUqmmxmTI763XmDDSJJFnyfKH43FFcMJu/CZgBcE98xlFztrKwhzcRkiPg==",
|
||||
"path": "google.protobuf/3.27.1",
|
||||
"hashPath": "google.protobuf.3.27.1.nupkg.sha512"
|
||||
},
|
||||
"Grpc.AspNetCore/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-aDCMgtw4Ea2qV/xUPLFXj0qDn/ihKxTP/au6vSkDV4pa/ROU+4BeX71vuUfngG97mgMA3kzPLAKDSkl82zKXug==",
|
||||
"path": "grpc.aspnetcore/2.63.0",
|
||||
"hashPath": "grpc.aspnetcore.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.AspNetCore.Server/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-KoOz6f23k9p9+NnQw78MiMAUYNOZ8HqATcdS2Q6f9K+F8EMJbj2+Vcie88z1OpLc+7iObr4PbK3Xmf4Nm5XbGw==",
|
||||
"path": "grpc.aspnetcore.server/2.63.0",
|
||||
"hashPath": "grpc.aspnetcore.server.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.AspNetCore.Server.ClientFactory/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-e4VOlNQwFsKgnwPVdYO3Z2NG+rSdk6jStMazfxHlcE0Yr9tSDJxLa30Fgi8tx+S0nplAzjXmqzKhG5hUhRYugw==",
|
||||
"path": "grpc.aspnetcore.server.clientfactory/2.63.0",
|
||||
"hashPath": "grpc.aspnetcore.server.clientfactory.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.AspNetCore.Server.Reflection/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-+o21iX7CF8HRGJUu5op/DGANUXxIz7cR+p2Cr98Dxddvoy4jv3kybNfo+g1EJskZamDRDgfO2qtoqO6Tvga87g==",
|
||||
"path": "grpc.aspnetcore.server.reflection/2.63.0",
|
||||
"hashPath": "grpc.aspnetcore.server.reflection.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Core.Api/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-t3+/MF8AxIqKq5UmPB9EWAnM9C/+lXOB8TRFfeVMDntf6dekfJmjpKDebaT4t2bbuwVwwvthxxox9BuGr59kYA==",
|
||||
"path": "grpc.core.api/2.63.0",
|
||||
"hashPath": "grpc.core.api.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Net.Client/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-847zG24daOP1242OpbnjhbKtplH/EfV/76QReQA3cbS5SL78uIXsWMe9IN9JlIb4+kT3eE4fjMCXTn8BAQ91Ng==",
|
||||
"path": "grpc.net.client/2.63.0",
|
||||
"hashPath": "grpc.net.client.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Net.ClientFactory/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-RRT841A/JwmvXu+Fh8Gl9FNwwW8bc/Z0wm2F99SG26UGvTRCv39kx4edLtDuwo5ICrHpEu1fnsWMcPItamL7UQ==",
|
||||
"path": "grpc.net.clientfactory/2.63.0",
|
||||
"hashPath": "grpc.net.clientfactory.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Net.Common/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-RLt6p31ZMsXRcHNeu1dQuIFLYZvnwP6LUzoDPlV3KoR4w9btmwrXIvz9Jbp1SOmxW7nXw9zShAeIt5LsqFAx5w==",
|
||||
"path": "grpc.net.common/2.63.0",
|
||||
"hashPath": "grpc.net.common.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Reflection/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-IDZQoRI5+SAQAaT2NiXjUu/CbvS9WQQB95AP/Dr4Aq+rNDJURDPh1Y8pckcYK8G9tr08rVQ5aGIpnYknxrV0nQ==",
|
||||
"path": "grpc.reflection/2.63.0",
|
||||
"hashPath": "grpc.reflection.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Tools/2.64.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-W5RrhDFHUhioASktxfuDs5fTjWUxwegljZAig9zFL8nWNskeyQA6OXN2choWKYxGrljer25VqCJCMbWz7XHvqg==",
|
||||
"path": "grpc.tools/2.64.0",
|
||||
"hashPath": "grpc.tools.2.64.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==",
|
||||
"path": "microsoft.extensions.dependencyinjection/6.0.0",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==",
|
||||
"path": "microsoft.extensions.dependencyinjection.abstractions/6.0.0",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Http/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-15+pa2G0bAMHbHewaQIdr/y6ag2H3yh4rd9hTXavtWDzQBkvpe2RMqFg8BxDpcQWssmjmBApGPcw93QRz6YcMg==",
|
||||
"path": "microsoft.extensions.http/6.0.0",
|
||||
"hashPath": "microsoft.extensions.http.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==",
|
||||
"path": "microsoft.extensions.logging/6.0.0",
|
||||
"hashPath": "microsoft.extensions.logging.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==",
|
||||
"path": "microsoft.extensions.logging.abstractions/6.0.0",
|
||||
"hashPath": "microsoft.extensions.logging.abstractions.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Options/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==",
|
||||
"path": "microsoft.extensions.options/6.0.0",
|
||||
"hashPath": "microsoft.extensions.options.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==",
|
||||
"path": "microsoft.extensions.primitives/6.0.0",
|
||||
"hashPath": "microsoft.extensions.primitives.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Diagnostics.DiagnosticSource/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==",
|
||||
"path": "system.diagnostics.diagnosticsource/6.0.0",
|
||||
"hashPath": "system.diagnostics.diagnosticsource.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==",
|
||||
"path": "system.runtime.compilerservices.unsafe/6.0.0",
|
||||
"hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
BrokerApiTest/bin/Debug/net8.0/ControlCenter.Grpc.dll
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/ControlCenter.Grpc.dll
Normal file
Binary file not shown.
BIN
BrokerApiTest/bin/Debug/net8.0/ControlCenter.Grpc.pdb
Normal file
BIN
BrokerApiTest/bin/Debug/net8.0/ControlCenter.Grpc.pdb
Normal file
Binary file not shown.
429
BrokerApiTest/bin/Debug/net8.0/ControlCenter.NamedPipe.deps.json
Normal file
429
BrokerApiTest/bin/Debug/net8.0/ControlCenter.NamedPipe.deps.json
Normal file
@@ -0,0 +1,429 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"ControlCenter.NamedPipe/1.0.0": {
|
||||
"dependencies": {
|
||||
"ControlCenter.Grpc": "1.0.0",
|
||||
"ControlCenter.Utils": "1.0.0",
|
||||
"Microsoft.OpenApi": "1.6.22"
|
||||
},
|
||||
"runtime": {
|
||||
"ControlCenter.NamedPipe.dll": {}
|
||||
}
|
||||
},
|
||||
"Google.Protobuf/3.27.1": {
|
||||
"runtime": {
|
||||
"lib/net5.0/Google.Protobuf.dll": {
|
||||
"assemblyVersion": "3.27.1.0",
|
||||
"fileVersion": "3.27.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.AspNetCore/2.63.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Grpc.AspNetCore.Server.ClientFactory": "2.63.0"
|
||||
}
|
||||
},
|
||||
"Grpc.AspNetCore.Server/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.Net.Common": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.AspNetCore.Server.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.AspNetCore.Server.ClientFactory/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.AspNetCore.Server": "2.63.0",
|
||||
"Grpc.Net.ClientFactory": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.AspNetCore.Server.ClientFactory.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.AspNetCore.Server.Reflection/2.63.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Grpc.AspNetCore.Server": "2.63.0",
|
||||
"Grpc.Reflection": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.AspNetCore.Server.Reflection.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Core.Api/2.63.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/Grpc.Core.Api.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Net.Client/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.Net.Common": "2.63.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.Net.Client.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Net.ClientFactory/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.Net.Client": "2.63.0",
|
||||
"Microsoft.Extensions.Http": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.Net.ClientFactory.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Net.Common/2.63.0": {
|
||||
"dependencies": {
|
||||
"Grpc.Core.Api": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Grpc.Net.Common.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Grpc.Reflection/2.63.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Grpc.Core.Api": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Grpc.Reflection.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.63.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0",
|
||||
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Binder/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.1"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.1": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.324.11423"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Diagnostics/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "8.0.0",
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": "8.0.0",
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.1",
|
||||
"Microsoft.Extensions.Options": "8.0.0",
|
||||
"System.Diagnostics.DiagnosticSource": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Http/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.1",
|
||||
"Microsoft.Extensions.Diagnostics": "8.0.0",
|
||||
"Microsoft.Extensions.Logging": "8.0.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.0",
|
||||
"Microsoft.Extensions.Options": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection": "8.0.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.0",
|
||||
"Microsoft.Extensions.Options": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.1"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.1",
|
||||
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions/8.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0",
|
||||
"Microsoft.Extensions.Configuration.Binder": "8.0.0",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.1",
|
||||
"Microsoft.Extensions.Options": "8.0.0",
|
||||
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/8.0.0": {},
|
||||
"Microsoft.OpenApi/1.6.22": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.OpenApi.dll": {
|
||||
"assemblyVersion": "1.6.22.0",
|
||||
"fileVersion": "1.6.22.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Diagnostics.DiagnosticSource/8.0.0": {},
|
||||
"ControlCenter.Grpc/1.0.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Grpc.AspNetCore": "2.63.0",
|
||||
"Grpc.AspNetCore.Server.Reflection": "2.63.0"
|
||||
},
|
||||
"runtime": {
|
||||
"ControlCenter.Grpc.dll": {}
|
||||
}
|
||||
},
|
||||
"ControlCenter.Utils/1.0.0": {
|
||||
"dependencies": {
|
||||
"Google.Protobuf": "3.27.1",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.1",
|
||||
"Microsoft.Extensions.Http": "8.0.0",
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"ControlCenter.Utils.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"ControlCenter.NamedPipe/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Google.Protobuf/3.27.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-7IVz9TzhYCZ8qY0rPhXUnyJSXYdshUqmmxmTI763XmDDSJJFnyfKH43FFcMJu/CZgBcE98xlFztrKwhzcRkiPg==",
|
||||
"path": "google.protobuf/3.27.1",
|
||||
"hashPath": "google.protobuf.3.27.1.nupkg.sha512"
|
||||
},
|
||||
"Grpc.AspNetCore/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-aDCMgtw4Ea2qV/xUPLFXj0qDn/ihKxTP/au6vSkDV4pa/ROU+4BeX71vuUfngG97mgMA3kzPLAKDSkl82zKXug==",
|
||||
"path": "grpc.aspnetcore/2.63.0",
|
||||
"hashPath": "grpc.aspnetcore.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.AspNetCore.Server/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-KoOz6f23k9p9+NnQw78MiMAUYNOZ8HqATcdS2Q6f9K+F8EMJbj2+Vcie88z1OpLc+7iObr4PbK3Xmf4Nm5XbGw==",
|
||||
"path": "grpc.aspnetcore.server/2.63.0",
|
||||
"hashPath": "grpc.aspnetcore.server.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.AspNetCore.Server.ClientFactory/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-e4VOlNQwFsKgnwPVdYO3Z2NG+rSdk6jStMazfxHlcE0Yr9tSDJxLa30Fgi8tx+S0nplAzjXmqzKhG5hUhRYugw==",
|
||||
"path": "grpc.aspnetcore.server.clientfactory/2.63.0",
|
||||
"hashPath": "grpc.aspnetcore.server.clientfactory.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.AspNetCore.Server.Reflection/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-+o21iX7CF8HRGJUu5op/DGANUXxIz7cR+p2Cr98Dxddvoy4jv3kybNfo+g1EJskZamDRDgfO2qtoqO6Tvga87g==",
|
||||
"path": "grpc.aspnetcore.server.reflection/2.63.0",
|
||||
"hashPath": "grpc.aspnetcore.server.reflection.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Core.Api/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-t3+/MF8AxIqKq5UmPB9EWAnM9C/+lXOB8TRFfeVMDntf6dekfJmjpKDebaT4t2bbuwVwwvthxxox9BuGr59kYA==",
|
||||
"path": "grpc.core.api/2.63.0",
|
||||
"hashPath": "grpc.core.api.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Net.Client/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-847zG24daOP1242OpbnjhbKtplH/EfV/76QReQA3cbS5SL78uIXsWMe9IN9JlIb4+kT3eE4fjMCXTn8BAQ91Ng==",
|
||||
"path": "grpc.net.client/2.63.0",
|
||||
"hashPath": "grpc.net.client.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Net.ClientFactory/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-RRT841A/JwmvXu+Fh8Gl9FNwwW8bc/Z0wm2F99SG26UGvTRCv39kx4edLtDuwo5ICrHpEu1fnsWMcPItamL7UQ==",
|
||||
"path": "grpc.net.clientfactory/2.63.0",
|
||||
"hashPath": "grpc.net.clientfactory.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Net.Common/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-RLt6p31ZMsXRcHNeu1dQuIFLYZvnwP6LUzoDPlV3KoR4w9btmwrXIvz9Jbp1SOmxW7nXw9zShAeIt5LsqFAx5w==",
|
||||
"path": "grpc.net.common/2.63.0",
|
||||
"hashPath": "grpc.net.common.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Grpc.Reflection/2.63.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-IDZQoRI5+SAQAaT2NiXjUu/CbvS9WQQB95AP/Dr4Aq+rNDJURDPh1Y8pckcYK8G9tr08rVQ5aGIpnYknxrV0nQ==",
|
||||
"path": "grpc.reflection/2.63.0",
|
||||
"hashPath": "grpc.reflection.2.63.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==",
|
||||
"path": "microsoft.extensions.configuration/8.0.0",
|
||||
"hashPath": "microsoft.extensions.configuration.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==",
|
||||
"path": "microsoft.extensions.configuration.abstractions/8.0.0",
|
||||
"hashPath": "microsoft.extensions.configuration.abstractions.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Binder/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-mBMoXLsr5s1y2zOHWmKsE9veDcx8h1x/c3rz4baEdQKTeDcmQAPNbB54Pi/lhFO3K431eEq6PFbMgLaa6PHFfA==",
|
||||
"path": "microsoft.extensions.configuration.binder/8.0.0",
|
||||
"hashPath": "microsoft.extensions.configuration.binder.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==",
|
||||
"path": "microsoft.extensions.dependencyinjection/8.0.0",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-fGLiCRLMYd00JYpClraLjJTNKLmMJPnqxMaiRzEBIIvevlzxz33mXy39Lkd48hu1G+N21S7QpaO5ZzKsI6FRuA==",
|
||||
"path": "microsoft.extensions.dependencyinjection.abstractions/8.0.1",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Diagnostics/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3PZp/YSkIXrF7QK7PfC1bkyRYwqOHpWFad8Qx+4wkuumAeXo1NHaxpS9LboNA9OvNSAu+QOVlXbMyoY+pHSqcw==",
|
||||
"path": "microsoft.extensions.diagnostics/8.0.0",
|
||||
"hashPath": "microsoft.extensions.diagnostics.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-JHYCQG7HmugNYUhOl368g+NMxYE/N/AiclCYRNlgCY9eVyiBkOHMwK4x60RYMxv9EL3+rmj1mqHvdCiPpC+D4Q==",
|
||||
"path": "microsoft.extensions.diagnostics.abstractions/8.0.0",
|
||||
"hashPath": "microsoft.extensions.diagnostics.abstractions.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Http/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-cWz4caHwvx0emoYe7NkHPxII/KkTI8R/LC9qdqJqnKv2poTJ4e2qqPGQqvRoQ5kaSA4FU5IV3qFAuLuOhoqULQ==",
|
||||
"path": "microsoft.extensions.http/8.0.0",
|
||||
"hashPath": "microsoft.extensions.http.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-tvRkov9tAJ3xP51LCv3FJ2zINmv1P8Hi8lhhtcKGqM+ImiTCC84uOPEI4z8Cdq2C3o9e+Aa0Gw0rmrsJD77W+w==",
|
||||
"path": "microsoft.extensions.logging/8.0.0",
|
||||
"hashPath": "microsoft.extensions.logging.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-arDBqTgFCyS0EvRV7O3MZturChstm50OJ0y9bDJvAcmEPJm0FFpFyjU/JLYyStNGGey081DvnQYlncNX5SJJGA==",
|
||||
"path": "microsoft.extensions.logging.abstractions/8.0.0",
|
||||
"hashPath": "microsoft.extensions.logging.abstractions.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Options/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-JOVOfqpnqlVLUzINQ2fox8evY2SKLYJ3BV8QDe/Jyp21u1T7r45x/R/5QdteURMR5r01GxeJSBBUOCOyaNXA3g==",
|
||||
"path": "microsoft.extensions.options/8.0.0",
|
||||
"hashPath": "microsoft.extensions.options.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-0f4DMRqEd50zQh+UyJc+/HiBsZ3vhAQALgdkcQEalSH1L2isdC7Yj54M3cyo5e+BeO5fcBQ7Dxly8XiBBcvRgw==",
|
||||
"path": "microsoft.extensions.options.configurationextensions/8.0.0",
|
||||
"hashPath": "microsoft.extensions.options.configurationextensions.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==",
|
||||
"path": "microsoft.extensions.primitives/8.0.0",
|
||||
"hashPath": "microsoft.extensions.primitives.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.OpenApi/1.6.22": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-aBvunmrdu/x+4CaA/UP1Jx4xWGwk4kymhoIRnn2Vp+zi5/KOPQJ9EkSXHRUr01WcGKtYl3Au7XfkPJbU1G2sjQ==",
|
||||
"path": "microsoft.openapi/1.6.22",
|
||||
"hashPath": "microsoft.openapi.1.6.22.nupkg.sha512"
|
||||
},
|
||||
"System.Diagnostics.DiagnosticSource/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-c9xLpVz6PL9lp/djOWtk5KPDZq3cSYpmXoJQY524EOtuFl5z9ZtsotpsyrDW40U1DRnQSYvcPKEUV0X//u6gkQ==",
|
||||
"path": "system.diagnostics.diagnosticsource/8.0.0",
|
||||
"hashPath": "system.diagnostics.diagnosticsource.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"ControlCenter.Grpc/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"ControlCenter.Utils/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user