51 lines
1.8 KiB
C#
51 lines
1.8 KiB
C#
using CloudGaming.Repository.Game.Entities.Ext;
|
|
namespace CloudGaming.Api.Admin.ApplicationServices.Apps.Ext;
|
|
|
|
/// <summary>
|
|
/// app渠道表 服务 T_App_ChannelService
|
|
/// </summary>
|
|
public class T_App_ChannelService(IServiceProvider serviceProvider)
|
|
: ApplicationGameService<T_App_Channel, int, T_App_Channel, T_App_Channel>(serviceProvider)
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
/// 获取列表数据
|
|
/// </summary>
|
|
/// <param name="pagingSearchInput"></param>
|
|
/// <returns></returns>
|
|
public async override Task<PagingView> FindListAsync(PagingSearchInput<T_App_Channel> pagingSearchInput)
|
|
{
|
|
var query = this.Repository.Select
|
|
//渠道号
|
|
.WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.ChannelId),
|
|
w => w.ChannelId.Contains(pagingSearchInput.Search.ChannelId ?? ""))
|
|
//渠道名称
|
|
.WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.Name),
|
|
w => w.Name.Contains(pagingSearchInput.Search.Name ?? ""))
|
|
.OrderByDescending(w => w.Id)
|
|
.Select(w => new
|
|
{
|
|
w.Id,
|
|
w.Name,
|
|
w.ChannelId,
|
|
w.CreateAt,
|
|
w.UpdateAt,
|
|
w.Desc,
|
|
})
|
|
;
|
|
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.CreateAt, (oldValue) => oldValue.ToString("yyyy-MM-dd HH:mm:ss"))
|
|
.FormatValue(query, w => w.UpdateAt, (oldValue) => oldValue.ToString("yyyy-MM-dd HH:mm:ss"))
|
|
;
|
|
|
|
return result;
|
|
}
|
|
|
|
} |