CloudGamingAdmin/admin-server/CloudGaming.Api.Admin/ApplicationServices/Apps/App/T_User_FeedBackService.cs
2024-11-19 20:20:58 +08:00

44 lines
1.6 KiB
C#

using CloudGaming.Repository.Game.Entities.App;
namespace CloudGaming.Api.Admin.ApplicationServices.Apps.App;
/// <summary>
/// 用户反馈表 服务 T_User_FeedBackService
/// </summary>
public class T_User_FeedBackService(IServiceProvider serviceProvider)
: ApplicationUserService<T_User_FeedBack,int,T_User_FeedBack,T_User_FeedBack>(serviceProvider)
{
/// <summary>
/// 获取列表数据
/// </summary>
/// <param name="pagingSearchInput"></param>
/// <returns></returns>
public async override Task<PagingView> FindListAsync(PagingSearchInput<T_User_FeedBack> pagingSearchInput)
{
var query = this.Repository.Select
//内容
.WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.Text),
w => w.Text.Contains(pagingSearchInput.Search.Text ?? ""))
.OrderByDescending(w => w.Id)
.Select(w => new
{
w.Id,
w.UserId,w.Text,w.ContactUs,w.CreateTime,w.UpdateTime,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.CreateTime, (oldValue) => oldValue.ToString("yyyy-MM-dd"))
.FormatValue(query, w => w.UpdateTime, (oldValue) => oldValue.ToString("yyyy-MM-dd"))
;
return result;
}
}