diff --git a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs index 5ea3f87dc..b10058954 100644 --- a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs @@ -16,10 +16,20 @@ namespace IRaCIS.Core.Application.Service /// 系统模板文档配置表 /// [ApiExplorerSettings(GroupName = "Common")] - public class CommonDocumentService(IRepository _commonDocumentRepository, + public class CommonDocumentService(IRepository _commonDocumentRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService, ICommonDocumentService { + public async Task GetCommonDocument(string code) + { + var first = await _commonDocumentRepository.Where(t => t.Code == code) + .ProjectTo(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.UserRoleId }) + .FirstNotNullAsync(); + + + return first; + } + [HttpPost] public async Task> GetCommonDocumentList(CommonDocumentQuery queryCommonDocument) {