60 lines
2.0 KiB
C#
60 lines
2.0 KiB
C#
using CloudGaming.Repository.Game.Entities.App;
|
||
namespace CloudGaming.Api.Admin.ApplicationServices.Apps.App;
|
||
|
||
/// <summary>
|
||
/// 通用奖励配置表 服务 T_RewardConfigService
|
||
/// </summary>
|
||
public class T_RewardConfigService(IServiceProvider serviceProvider)
|
||
: ApplicationUserService<T_RewardConfig, int, T_RewardConfig, T_RewardConfig>(serviceProvider)
|
||
{
|
||
|
||
|
||
/// <summary>
|
||
/// 获取列表数据
|
||
/// </summary>
|
||
/// <param name="pagingSearchInput"></param>
|
||
/// <returns></returns>
|
||
public async override Task<PagingView> FindListAsync(PagingSearchInput<T_RewardConfig> pagingSearchInput)
|
||
{
|
||
var query = this.Repository.Select
|
||
.OrderByDescending(w => w.Id)
|
||
.Select(w => new
|
||
{
|
||
w.Id,
|
||
w.CurrencyType,
|
||
w.AwardNum,
|
||
w.ParentNodeType,
|
||
w.ParentNodeId,
|
||
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!);
|
||
return result;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取列表数据
|
||
/// </summary>
|
||
/// <param name="productId"></param>
|
||
/// <returns></returns>
|
||
public async Task<List<T_RewardConfig>> FindListAsync(int typeId, int productId)
|
||
{
|
||
var query = await this.Repository.SelectNoTracking.Where(it => it.ParentNodeType == typeId && it.ParentNodeId == productId).OrderByDescending(w => w.Id).ToListAsync();
|
||
return query;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 保存数据
|
||
/// </summary>
|
||
/// <param name="form"></param>
|
||
/// <returns></returns>
|
||
public virtual Task SaveFormAsync(T_RewardConfig form)
|
||
{
|
||
return Repository.InsertOrUpdateAsync(form ?? throw MessageBox.Show("保存函数参数Dto不是数据库类型,请对保存函数重写!"));
|
||
}
|
||
|
||
} |