CloudGamingAdmin/admin-server/CloudGaming.Api.Admin/ApplicationServices/Apps/App/T_GameCBTService.cs
2024-11-15 02:58:48 +08:00

76 lines
2.7 KiB
C#

using CloudGaming.Repository.Game.Entities.App;
namespace CloudGaming.Api.Admin.ApplicationServices.Apps.App;
/// <summary>
/// 游戏配置 服务 T_GameCBTService
/// </summary>
public class T_GameCBTService(IServiceProvider serviceProvider)
: ApplicationUserService<T_GameCBT, int, T_GameCBT, T_GameCBT>(serviceProvider)
{
/// <summary>
/// 获取列表数据
/// </summary>
/// <param name="pagingSearchInput"></param>
/// <returns></returns>
public async override Task<PagingView> FindListAsync(PagingSearchInput<T_GameCBT> pagingSearchInput)
{
var query = this.Repository.Select
//游戏Id
.WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.GameId),
w => w.GameId.Contains(pagingSearchInput.Search.GameId ?? ""))
//游戏名称
.WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.GameName),
w => w.GameName.Contains(pagingSearchInput.Search.GameName ?? ""))
.OrderByDescending(w => w.Id)
.Select(w => new
{
w.Id,
w.GameId,
w.GameBgImgId,
w.ImageIconId,
w.IsOnline,
w.Score,
w.OrderId,
w.UpdateTime,
w.CreateTime,
w.Desc,
w.GameLoadBgImageId,
w.ImageId_YXK,
w.IsTest,
w.IsLimitToVip,
w.GameLoadTime,
w.ImageId_TJ,
w.ImageId_ShouSuo,
w.ImageId_RM,
w.Title2,
w.GameName,
w.ImageId_FK,
w.ImageId_Banner,
w.ConsumeDiamondNumHour,
w.ConsumeDiamondNumHourVip,
w.GameGroup,
w.VipTypeLimit,
w.VipVisible,
w.IsDiscount,
w.OnlinePlatform,
w.FriendlyTips,
w.TenantId,
})
;
var result = await Repository.AsPagingViewAsync(query, pagingSearchInput);
// 设置列
//result.GetColumn(query, w => w.OperatorName).SetColumn("操作人");
//result.GetColumn(query, w => w. !).SetColumn<SysUser>(w => w.Name!);
result
.FormatValue(query, w => w.UpdateTime, (oldValue) => oldValue?.ToString("yyyy-MM-dd"))
.FormatValue(query, w => w.CreateTime, (oldValue) => oldValue?.ToString("yyyy-MM-dd"))
;
return result;
}
}