32 lines
939 B
C#
32 lines
939 B
C#
using Zxd.Core.Domain.Dto.Activity;
|
|
|
|
namespace Zxd.Core.Domain
|
|
{
|
|
public class ActivityDomain : IActivityDomain
|
|
{
|
|
private readonly IBaseRepository<DncmsbaseDbContext> _cmsRepository;
|
|
|
|
public ActivityDomain(
|
|
IBaseRepository<DncmsbaseDbContext> cmsRepository)
|
|
{
|
|
_cmsRepository = cmsRepository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取活动名称
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
public async Task<string> GetActivityNameAsync(GetActivityNameRequest request)
|
|
{
|
|
var tag = await _cmsRepository.GetRepository<resourcetag>().Query().Where(w => w.remark == request.Code).FirstOrDefaultAsync();
|
|
if (tag == null)
|
|
{
|
|
throw new ArgumentException($"活动编码无效:{request.Code}");
|
|
}
|
|
|
|
return tag.name;
|
|
}
|
|
}
|
|
}
|