diff --git a/IRaCIS.Core.Application/Service/Common/DTO/InternationalizationViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/InternationalizationViewModel.cs index 5021de3cf..9b51e5030 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/InternationalizationViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/InternationalizationViewModel.cs @@ -9,27 +9,22 @@ using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel { /// InternationalizationView 列表视图模型 - public class InternationalizationView + public class InternationalizationView : InternationalizationAddOrEdit { - public Guid Id { get; set; } public int ShowOrder { get; set; } public Guid CreateUserId { get; set; } public DateTime CreateTime { get; set; } public DateTime UpdateTime { get; set; } public Guid UpdateUserId { get; set; } - public int State { get; set; } - public string FolderPath { get; set; } - public string Code { get; set; } - public string Value { get; set; } - public string ValueCN { get; set; } + } ///InternationalizationQuery 列表查询参数模型 - public class InternationalizationQuery:PageInput + public class InternationalizationQuery : PageInput { - - public string? FolderPath { get; set; } - public string? Code { get; set; } + + public string? FolderPath { get; set; } + public string? Code { get; set; } public string? Value { get; set; } public string? ValueCN { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/DTO/PublishLogViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/PublishLogViewModel.cs new file mode 100644 index 000000000..b76607051 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Common/DTO/PublishLogViewModel.cs @@ -0,0 +1,44 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-06-27 15:47:02 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- +using System; +using IRaCIS.Core.Domain.Share; +using System.Collections.Generic; +namespace IRaCIS.Core.Application.ViewModel +{ + /// PublishLogView 列表视图模型 + public class PublishLogView : PublishLogAddOrEdit + { + + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public Guid UpdateUserId { get; set; } + public DateTime UpdateTime { get; set; } + } + + ///PublishLogQuery 列表查询参数模型 + public class PublishLogQuery:PageInput + { + + public string? Version { get; set; } + + public string? UpdateContent { get; set; } + + } + + /// PublishLogAddOrEdit 列表查询参数模型 + public class PublishLogAddOrEdit + { + public Guid? Id { get; set; } + public string Version { get; set; } + public DateTime PublishTime { get; set; } + public string UpdateContent { get; set; } + + } + + +} + + diff --git a/IRaCIS.Core.Application/Service/Common/Interface/IPublishLogService.cs b/IRaCIS.Core.Application/Service/Common/Interface/IPublishLogService.cs new file mode 100644 index 000000000..600cff5a7 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Common/Interface/IPublishLogService.cs @@ -0,0 +1,24 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-06-27 15:47:10 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- + +using IRaCIS.Core.Application.ViewModel; +namespace IRaCIS.Core.Application.Interfaces +{ + /// + /// IPublishLogService + /// + public interface IPublishLogService + { + + Task> GetPublishLogList(PublishLogQuery inQuery); + + Task AddOrUpdatePublishLog(PublishLogAddOrEdit addOrEditPublishLog); + + Task DeletePublishLog(Guid publishLogId); + + + } +} diff --git a/IRaCIS.Core.Application/Service/Common/InternationalizationService.cs b/IRaCIS.Core.Application/Service/Common/InternationalizationService.cs index ac7a40970..9ab02c47e 100644 --- a/IRaCIS.Core.Application/Service/Common/InternationalizationService.cs +++ b/IRaCIS.Core.Application/Service/Common/InternationalizationService.cs @@ -29,9 +29,9 @@ namespace IRaCIS.Core.Application.Service var internationalizationQueryable =_internationalizationRepository .WhereIf(inQuery.FolderPath!=null,t=>t.FolderPath.Contains(inQuery.FolderPath)) - .WhereIf(inQuery.Code != null, t => t.FolderPath.Contains(inQuery.Code)) - .WhereIf(inQuery.Value != null, t => t.FolderPath.Contains(inQuery.Value)) - .WhereIf(inQuery.ValueCN != null, t => t.FolderPath.Contains(inQuery.ValueCN)) + .WhereIf(inQuery.Code != null, t => t.FolderPath.Contains(inQuery.Code)) + .WhereIf(inQuery.Value != null, t => t.FolderPath.Contains(inQuery.Value)) + .WhereIf(inQuery.ValueCN != null, t => t.FolderPath.Contains(inQuery.ValueCN)) .ProjectTo(_mapper.ConfigurationProvider); var pageList = await internationalizationQueryable diff --git a/IRaCIS.Core.Application/Service/Common/PublishLogService.cs b/IRaCIS.Core.Application/Service/Common/PublishLogService.cs new file mode 100644 index 000000000..8dc3a1cf7 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Common/PublishLogService.cs @@ -0,0 +1,71 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-06-27 15:47:06 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- + +using IRaCIS.Core.Domain.Models; +using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Application.Contracts; + +namespace IRaCIS.Core.Application.Service +{ + /// + /// PublishLogService + /// + [ApiExplorerSettings(GroupName = "Common")] + public class PublishLogService : BaseService, IPublishLogService + { + + private readonly IRepository _publishLogRepository; + + public PublishLogService(IRepository publishLogRepository) + { + _publishLogRepository = publishLogRepository; + } + + public async Task> GetPublishLogList(PublishLogQuery inQuery) + { + + var publishLogQueryable = _publishLogRepository + .WhereIf(!string.IsNullOrEmpty(inQuery.Version) , t => t.Version.Contains(inQuery.Version)) + .WhereIf(!string.IsNullOrEmpty(inQuery.UpdateContent), t => t.UpdateContent.Contains(inQuery.UpdateContent)) + .ProjectTo(_mapper.ConfigurationProvider); + + var pageList = await publishLogQueryable + .ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); + + return pageList; + } + + + public async Task AddOrUpdatePublishLog(PublishLogAddOrEdit addOrEditPublishLog) + { + var verifyExp1 = new EntityVerifyExp() + { + VerifyExp = u => u.Version == addOrEditPublishLog.Version , + + VerifyMsg = "发布编号不能重复" + }; + + + + var entity = await _publishLogRepository.InsertOrUpdateAsync(addOrEditPublishLog, true, verifyExp1); + + return ResponseOutput.Ok(entity.Id.ToString()); + + } + + + [HttpDelete("{publishLogId:guid}")] + public async Task DeletePublishLog(Guid publishLogId) + { + var success = await _publishLogRepository.DeleteFromQueryAsync(t => t.Id == publishLogId, true); + return ResponseOutput.Ok(); + } + + + } +} diff --git a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs index 5a1d95f24..523e15044 100644 --- a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs @@ -57,6 +57,9 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap().ReverseMap(); + CreateMap(); + CreateMap().ReverseMap(); + } } diff --git a/IRaCIS.Core.Domain/Common/PublishLog.cs b/IRaCIS.Core.Domain/Common/PublishLog.cs new file mode 100644 index 000000000..ccb8dc101 --- /dev/null +++ b/IRaCIS.Core.Domain/Common/PublishLog.cs @@ -0,0 +1,71 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-06-27 15:46:59 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + ///PublishLog + /// + [Table("PublishLog")] + public class PublishLog : Entity, IAuditUpdate, IAuditAdd + { + + /// + /// Id + /// + [Key] + [Required] + public Guid Id { get; set; } + + /// + /// Version + /// + [Required] + public string Version { get; set; } + + /// + /// PublishTime + /// + [Required] + public DateTime PublishTime { get; set; } + + /// + /// UpdateContent + /// + [Required] + public string UpdateContent { get; set; } + + /// + /// CreateTime + /// + [Required] + public DateTime CreateTime { get; set; } + + /// + /// CreateUserId + /// + [Required] + public Guid CreateUserId { get; set; } + + /// + /// UpdateUserId + /// + [Required] + public Guid UpdateUserId { get; set; } + + /// + /// UpdateTime + /// + [Required] + public DateTime UpdateTime { get; set; } + + } + + public virtual DbSet PublishLog { get; set; } +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 7b050ab0f..6cc45ea24 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -507,6 +507,9 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet ReadingTableQuestionAnswer { get; set; } + public virtual DbSet PublishLog { get; set; } + + #region 废弃