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

43 lines
1.5 KiB
C#

using CloudGaming.Repository.Game.Entities.Ext;
namespace CloudGaming.Api.Admin.ApplicationServices.Apps.Ext;
/// <summary>
/// 发送短信日志表 服务 T_Sms_LogService
/// </summary>
public class T_Sms_LogService(IServiceProvider serviceProvider)
: ApplicationGameService<T_Sms_Log,int,T_Sms_Log,T_Sms_Log>(serviceProvider)
{
/// <summary>
/// 获取列表数据
/// </summary>
/// <param name="pagingSearchInput"></param>
/// <returns></returns>
public async override Task<PagingView> FindListAsync(PagingSearchInput<T_Sms_Log> pagingSearchInput)
{
var query = this.Repository.Select
//手机号码
.WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.PhoneNumber),
w => w.PhoneNumber.Contains(pagingSearchInput.Search.PhoneNumber ?? ""))
.OrderByDescending(w => w.Id)
.Select(w => new
{
w.Id,
w.PhoneNumber,w.VerificationCode,w.SendStatus,w.SendTime,w.SendTimeDay,w.ErrorMessage,
})
;
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.SendTime, (oldValue) => oldValue.ToString("yyyy-MM-dd"))
;
return result;
}
}