using CloudGaming.Repository.Game.Entities.Ext;
namespace CloudGaming.Api.Admin.ApplicationServices.Apps.Ext;
///
/// App配置表 服务 T_App_ConfigService
///
public class T_App_ConfigService(IServiceProvider serviceProvider)
: ApplicationGameService(serviceProvider)
{
///
/// 获取列表数据
///
///
///
public async override Task FindListAsync(PagingSearchInput pagingSearchInput)
{
var query = this.Repository.Select
//配置类型
.WhereIf(pagingSearchInput.Search?.ConfigType != null && pagingSearchInput.Search?.ConfigType > 0,
w => w.ConfigType == pagingSearchInput.Search.ConfigType)
//配置名称
.WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.Name),
w => w.Name.Contains(pagingSearchInput.Search.Name ?? ""))
.OrderByDescending(w => w.Id)
.Select(w => new
{
w.Id,
w.ConfigId,
w.ConfigType,
w.ActionId,
w.ConfigValue,
w.IsEnabled,
w.Name,
w.Desc,
w.ChannelId,
w.Plat,
w.AppVersion,
w.Continent,
w.CountryName,
w.CreateTime,
w.UpdateTime,
})
;
var result = await Repository.AsPagingViewAsync(query, pagingSearchInput);
// 设置列
//result.GetColumn(query, w => w.OperatorName).SetColumn("操作人");
//result.GetColumn(query, w => w. !).SetColumn(w => w.Name!);
result
.FormatValue(query, w => w.CreateTime, (oldValue) => oldValue.ToString("yyyy-MM-dd HH:mm:ss"))
.FormatValue(query, w => w.UpdateTime, (oldValue) => oldValue.ToString("yyyy-MM-dd HH:mm:ss"))
;
return result;
}
}