CloudGamingAdmin/admin-server/CloudGaming.Api.Admin/ApplicationServices/Apps/App/T_Sys_MessageService.cs
2024-12-01 01:12:18 +08:00

40 lines
1.3 KiB
C#

using CloudGaming.Repository.Game.Entities.App;
namespace CloudGaming.Api.Admin.ApplicationServices.Apps.App;
/// <summary>
/// 系统消息表 服务 T_Sys_MessageService
/// </summary>
public class T_Sys_MessageService(IServiceProvider serviceProvider)
: ApplicationUserService<T_Sys_Message,int,T_Sys_Message,T_Sys_Message>(serviceProvider)
{
/// <summary>
/// 获取列表数据
/// </summary>
/// <param name="pagingSearchInput"></param>
/// <returns></returns>
public async override Task<PagingView> FindListAsync(PagingSearchInput<T_Sys_Message> pagingSearchInput)
{
var query = this.Repository.Select
.OrderByDescending(w => w.Id)
.Select(w => new
{
w.Id,
w.Title,w.Content,w.CreatedAt,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.CreatedAt, (oldValue) => oldValue.ToString("yyyy-MM-dd"))
;
return result;
}
}