36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using IRaCIS.Application.Contracts;
|
|
using IRaCIS.Application.Interfaces;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace IRaCIS.Core.Application.Service
|
|
{
|
|
[ApiExplorerSettings(GroupName = "Reviewer")]
|
|
public class ResearchPublicationService(IRepository<ResearchPublication> _researchPublicationRepository) : BaseService, IResearchPublicationService
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
/// 查询-医生科学研究信息
|
|
/// </summary>
|
|
/// <param name="doctorId">医生Id</param>
|
|
/// <returns></returns>
|
|
[HttpGet("{doctorId:guid}")]
|
|
public async Task<ResearchPublicationDTO> GetResearchPublication(Guid doctorId)
|
|
{
|
|
var doctorScientificResearchInfo = await _researchPublicationRepository.Where(o => o.DoctorId == doctorId)
|
|
.ProjectTo<ResearchPublicationDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
|
|
|
return doctorScientificResearchInfo!;
|
|
}
|
|
|
|
|
|
[HttpPost]
|
|
public async Task<IResponseOutput> AddOrUpdateResearchPublication(ResearchPublicationDTO param)
|
|
{
|
|
|
|
var entity = await _researchPublicationRepository.InsertOrUpdateAsync(param, true);
|
|
|
|
return ResponseOutput.Ok(entity.Id);
|
|
}
|
|
}
|
|
} |