diff --git a/src/CloudGaming/Api/CloudGaming.Api/Controllers/AppController.cs b/src/CloudGaming/Api/CloudGaming.Api/Controllers/AppController.cs index 44867c0..c1d0fed 100644 --- a/src/CloudGaming/Api/CloudGaming.Api/Controllers/AppController.cs +++ b/src/CloudGaming/Api/CloudGaming.Api/Controllers/AppController.cs @@ -21,6 +21,7 @@ public class AppController : CloudGamingControllerBase /// /// [HttpGet] + [Message("获取成功!")] public async Task GetAppConfigAsync() { AppConfigBLL appConfigBLL = new AppConfigBLL(ServiceProvider); diff --git a/src/CloudGaming/Code/CloudGaming.Code/Cache/Special/ImageEntityCache.cs b/src/CloudGaming/Code/CloudGaming.Code/Cache/Special/ImageEntityCache.cs index 774b840..a790079 100644 --- a/src/CloudGaming/Code/CloudGaming.Code/Cache/Special/ImageEntityCache.cs +++ b/src/CloudGaming/Code/CloudGaming.Code/Cache/Special/ImageEntityCache.cs @@ -1,24 +1,12 @@ -using Bogus; - using CloudGaming.Code.DataAccess; -using Flurl; - using HuanMeng.DotNetCore.CacheHelper; using HuanMeng.DotNetCore.CacheHelper.Contract; -using Microsoft.Extensions.Caching.Memory; - -using SKIT.FlurlHttpClient.Wechat.TenpayV3.Models; - using StackExchange.Redis; using System.Collections.Concurrent; -using static SKIT.FlurlHttpClient.Wechat.TenpayV3.ExtendedSDK.Global.Models.QueryPartnerRefundsResponse.Types; -using static SKIT.FlurlHttpClient.Wechat.TenpayV3.Models.CreateNewTaxControlFapiaoApplicationRequest.Types.Fapiao.Types; -using static System.Net.Mime.MediaTypeNames; - namespace CloudGaming.Code.Cache.Special; /// diff --git a/src/CloudGaming/Code/CloudGaming.Code/Filter/CustomResultFilter.cs b/src/CloudGaming/Code/CloudGaming.Code/Filter/CustomResultFilter.cs index 2764f1d..6f99ce7 100644 --- a/src/CloudGaming/Code/CloudGaming.Code/Filter/CustomResultFilter.cs +++ b/src/CloudGaming/Code/CloudGaming.Code/Filter/CustomResultFilter.cs @@ -95,17 +95,23 @@ public class CustomResultFilter : IResultFilter } string c = cloudGamingBase.AppRequestInfo.Language; var languageDic = _appConfig.GetAppApiLanguage(c, apiPrefix); - var dic = value.ToDictionaryOrList(false, apiPrefix, it => cloudGamingBase.Cache.AppImageCache[it], (value, prefix, isArray) => + var dic = value.ToDictionaryOrList(false, apiPrefix, it => cloudGamingBase.Cache.AppImageCache[it], (value, prefix, propertyName, isArray) => { - if (false && !isArray && value.ContainsChineseOptimized()) + if (!isArray) { - //中文 - var v = languageDic.GetOrAdd(prefix, value); - if (!string.IsNullOrEmpty(v)) + if (value.ContainsChineseOptimized()) { - return v; + if (propertyName == "Message") + { + var v = languageDic.GetOrAdd(prefix, value); + if (!string.IsNullOrEmpty(v)) + { + return v; + } + } } } + return value; }); objectResult.Value = dic; diff --git a/src/CloudGaming/Console/CloudGaming.ImportGame/Program.cs b/src/CloudGaming/Console/CloudGaming.ImportGame/Program.cs index 1afb830..b706940 100644 --- a/src/CloudGaming/Console/CloudGaming.ImportGame/Program.cs +++ b/src/CloudGaming/Console/CloudGaming.ImportGame/Program.cs @@ -1,4 +1,5 @@ // See https://aka.ms/new-console-template for more information +using CloudGaming.AppConfigModel; using CloudGaming.GameModel.Db.Db_Ext; using CloudGaming.GameModel.Db.Db_Game; using CloudGaming.Model.DbSqlServer.Db_Phone; @@ -289,7 +290,7 @@ tempGames.ForEach((Action)(game => VipTypeLimit = 0, VipVisible = false, IsDiscount = false, - OnlinePlatform = "", + OnlinePlatform = AppPlatform.car.ToString(), FriendlyTips = "", TenantId = Guid.Parse("6fba9c21-0de5-4734-a91e-f4961684d3d1"), GameLoadBgImageId = 0, diff --git a/src/CloudGaming/Utile/HuanMeng.DotNetCore/Utility/ObjectExtensions.cs b/src/CloudGaming/Utile/HuanMeng.DotNetCore/Utility/ObjectExtensions.cs index 653a880..ff84f43 100644 --- a/src/CloudGaming/Utile/HuanMeng.DotNetCore/Utility/ObjectExtensions.cs +++ b/src/CloudGaming/Utile/HuanMeng.DotNetCore/Utility/ObjectExtensions.cs @@ -44,7 +44,7 @@ public static class ObjectExtensions /// 要转换的对象。 /// 属性路径的可选前缀。 /// 对象的字典或列表表示形式。 - public static object ToDictionaryOrList(this object obj, bool isEnumerable, string prefix = "", Func? imageFunc = null, Func? languageFunc = null) + public static object ToDictionaryOrList(this object obj, bool isEnumerable, string prefix = "", Func? imageFunc = null, Func? languageFunc = null) { if (obj == null) return null; @@ -62,7 +62,7 @@ public static class ObjectExtensions /// 要转换的集合。 /// 集合中每个属性路径的前缀。 /// 转换后的项列表。 - private static List TransformCollection(IEnumerable enumerable, string prefix = "", Func? imageFunc = null, Func? languageFunc = null) + private static List TransformCollection(IEnumerable enumerable, string prefix = "", Func? imageFunc = null, Func? languageFunc = null) { var list = new List(enumerable is ICollection collection ? collection.Count : 10); int index = 0; @@ -80,7 +80,7 @@ public static class ObjectExtensions /// 要转换的对象。 /// 每个属性路径的前缀。 /// 包含属性名和属性值的字典。 - private static Dictionary TransformObject(object obj, bool isEnumerable, string prefix = "", Func? imageFunc = null, Func? languageFunc = null) + private static Dictionary TransformObject(object obj, bool isEnumerable, string prefix = "", Func? imageFunc = null, Func? languageFunc = null) { if (obj == null) { @@ -107,7 +107,7 @@ public static class ObjectExtensions } if (!string.IsNullOrEmpty(stringValue) && languageFunc != null) { - stringValue = languageFunc?.Invoke(stringValue, propertyPath, isEnumerable) ?? ""; + stringValue = languageFunc?.Invoke(stringValue, propertyPath, accessor.PropertyName, isEnumerable) ?? ""; } keyValuePairs[accessor.PropertyName] = stringValue; continue;