1
0
mirror of synced 2024-11-24 06:20:12 +01:00

Add Locked items config

This commit is contained in:
asesidaa 2024-03-31 00:51:46 +08:00
parent 8fc7adf35a
commit 9375466863
4 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,14 @@
using System.Text.Json.Serialization;
using Domain.Enums;
namespace Domain.Config;
public class LockedItemConfig
{
public const string LOCKED_SECTION = "Locked";
public int ItemId { get; set; }
[JsonConverter(typeof(JsonStringEnumConverter))]
public UnlockType ItemType { get; set; }
}

View File

@ -7,7 +7,7 @@
"TenpoName": "店舗1", "TenpoName": "店舗1",
"Pref": "東京都", "Pref": "東京都",
"Location": "渋谷区", "Location": "渋谷区",
"Mac": "000000000000" "Mac": "00155D6ACF78"
} }
] ]
} }

View File

@ -0,0 +1,9 @@
{
"Locked":
[
{
"ItemId": 11,
"ItemType": "Avatar"
}
]
}

View File

@ -42,6 +42,7 @@ try
.AddJsonFile($"{configurationsDirectory}/matching.json", optional: true, reloadOnChange: false) .AddJsonFile($"{configurationsDirectory}/matching.json", optional: true, reloadOnChange: false)
.AddJsonFile($"{configurationsDirectory}/auth.json", optional: true, reloadOnChange: false) .AddJsonFile($"{configurationsDirectory}/auth.json", optional: true, reloadOnChange: false)
.AddJsonFile($"{configurationsDirectory}/rank.json", optional: true, reloadOnChange: false) .AddJsonFile($"{configurationsDirectory}/rank.json", optional: true, reloadOnChange: false)
.AddJsonFile($"{configurationsDirectory}/locked.json", optional: true, reloadOnChange: false)
.AddJsonFile($"{configurationsDirectory}/server.json", optional: true, reloadOnChange: false); .AddJsonFile($"{configurationsDirectory}/server.json", optional: true, reloadOnChange: false);
builder.Services.Configure<EventConfig>( builder.Services.Configure<EventConfig>(
@ -52,6 +53,8 @@ try
builder.Configuration.GetSection(GameConfig.GAME_SECTION)); builder.Configuration.GetSection(GameConfig.GAME_SECTION));
builder.Services.Configure<AuthConfig>( builder.Services.Configure<AuthConfig>(
builder.Configuration.GetSection(AuthConfig.AUTH_SECTION)); builder.Configuration.GetSection(AuthConfig.AUTH_SECTION));
builder.Services.Configure<LockedItemConfig>(
builder.Configuration.GetSection(LockedItemConfig.LOCKED_SECTION));
builder.Services.AddOptions<RankConfig>() builder.Services.AddOptions<RankConfig>()
.Bind(builder.Configuration.GetSection(RankConfig.RANK_SECTION)) .Bind(builder.Configuration.GetSection(RankConfig.RANK_SECTION))
.ValidateDataAnnotations() .ValidateDataAnnotations()