79 lines
2.2 KiB
C#
79 lines
2.2 KiB
C#
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using ZR.Model.Business.Dto;
|
|
using ZR.Model.Business;
|
|
using ZR.Repository;
|
|
using ZR.Service.Business.IBusinessService;
|
|
|
|
namespace ZR.Service.Business
|
|
{
|
|
/// <summary>
|
|
/// 礼品小程序Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IGiftConfigService), ServiceLifetime = LifeTime.Transient)]
|
|
public class GiftConfigService : BaseService<GiftConfig>, IGiftConfigService
|
|
{
|
|
/// <summary>
|
|
/// 查询礼品小程序列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<GiftConfigDto> GetList(GiftConfigQueryDto parm)
|
|
{
|
|
var predicate = QueryExp(parm);
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<GiftConfig, GiftConfigDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public GiftConfig GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加礼品小程序
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public GiftConfig AddGiftConfig(GiftConfig model)
|
|
{
|
|
return Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改礼品小程序
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateGiftConfig(GiftConfig model)
|
|
{
|
|
return Update(model, true, "修改礼品小程序");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询导出表达式
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
private static Expressionable<GiftConfig> QueryExp(GiftConfigQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<GiftConfig>();
|
|
|
|
return predicate;
|
|
}
|
|
}
|
|
} |