Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing

This commit is contained in:
he
2024-08-07 17:26:03 +08:00
29 changed files with 983 additions and 361 deletions
@@ -53,7 +53,7 @@ namespace IRaCIS.Core.Application.ViewModel
public UserTypeEnum? UserTypeEnum { get; set; }
public string? FeedBackKeyInfo { get; set; }
public string? FeedBackUserKeyInfo { get; set; }
public string? QuestionDescription { get; set; }
@@ -85,8 +85,7 @@ namespace IRaCIS.Core.Application.ViewModel
public int State { get; set; }
public Guid? TrialSiteId { get; set; }
[NotDefault]
public Guid TrialId { get; set; }
public Guid? TrialId { get; set; }
public Guid? VisitTaskId { get; set; }
@@ -6,19 +6,18 @@
using IRaCIS.Core.Application.ViewModel;
namespace IRaCIS.Core.Application.Interfaces
{
/// <summary>
/// IUserFeedBackService
/// </summary>
public interface IUserFeedBackService
{
/// <summary>
/// IUserFeedBackService
/// </summary>
public interface IUserFeedBackService
{
Task<PageOutput<UserFeedBackView>> GetUserFeedBackList(UserFeedBackQuery inQuery);
Task<IResponseOutput> AddOrUpdateUserFeedBack(UserFeedBackAddOrEdit addOrEditUserFeedBack);
Task<PageOutput<UserFeedBackView>> GetUserFeedBackList(UserFeedBackQuery inQuery);
Task<IResponseOutput> DeleteUserFeedBack(Guid userFeedBackId);
Task<IResponseOutput> DeleteUserFeedBack(Guid userFeedBackId);
}
}
}
@@ -11,6 +11,8 @@ using IRaCIS.Core.Application.ViewModel;
using Newtonsoft.Json;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using MailKit;
using IRaCIS.Application.Services;
namespace IRaCIS.Core.Application.Service
{
/// <summary>
@@ -42,6 +44,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(inQuery.EndCreatime != null, t => t.CreateTime == inQuery.EndCreatime)
.WhereIf(inQuery.UserTypeEnum != null, t => t.CreateUser.UserTypeEnum == inQuery.UserTypeEnum)
.WhereIf(!string.IsNullOrEmpty(inQuery.FeedBackUserKeyInfo), t => t.CreateUser.FullName.Contains(inQuery.FeedBackUserKeyInfo)|| t.CreateUser.UserName.Contains(inQuery.FeedBackUserKeyInfo))
.WhereIf(!string.IsNullOrEmpty(inQuery.QuestionDescription), t => t.QuestionDescription.Contains(inQuery.QuestionDescription))
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialKeyInfo), t => t.Trial.ExperimentName.Contains(inQuery.TrialKeyInfo) || t.Trial.TrialCode.Contains(inQuery.TrialKeyInfo))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubejctAndVisitKeyInfo), t => t.Subject.Code.Contains(inQuery.SubejctAndVisitKeyInfo) || t.SubjectVisit.VisitName.Contains(inQuery.SubejctAndVisitKeyInfo))
@@ -49,7 +52,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<UserFeedBackView>(_mapper.ConfigurationProvider);
var pageList = await userFeedBackQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(UserFeedBackView.Id) : inQuery.SortField,inQuery.Asc);
var pageList = await userFeedBackQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(UserFeedBackView.Id) : inQuery.SortField, inQuery.Asc);
return pageList;
}
@@ -69,7 +72,8 @@ namespace IRaCIS.Core.Application.Service
}
public async Task<IResponseOutput> AddOrUpdateUserFeedBack(UserFeedBackAddOrEdit addOrEditUserFeedBack)
public async Task<IResponseOutput> AddOrUpdateUserFeedBack(UserFeedBackAddOrEdit addOrEditUserFeedBack,
[FromServices] IMailVerificationService mailService)
{
addOrEditUserFeedBack.ScreenshotListStr = JsonConvert.SerializeObject(addOrEditUserFeedBack.ScreenshotList);
@@ -105,8 +109,15 @@ namespace IRaCIS.Core.Application.Service
}
}
var entity = await _userFeedBackRepository.InsertOrUpdateAsync(addOrEditUserFeedBack, true);
if (addOrEditUserFeedBack.VisitTaskId != null || addOrEditUserFeedBack.Id == null)
{
await mailService.UserFeedBackMail(entity.Id);
}
return ResponseOutput.Ok(entity.Id.ToString());
}