Merge branch 'Test.IRC' of http://192.168.3.69:3000/XCKJ/irc-netcore-api into Test.IRC
						commit
						803f7f43b4
					
				| 
						 | 
					@ -7,6 +7,7 @@
 | 
				
			||||||
using Microsoft.AspNetCore.Mvc;
 | 
					using Microsoft.AspNetCore.Mvc;
 | 
				
			||||||
using IRaCIS.Core.Application.Contracts;
 | 
					using IRaCIS.Core.Application.Contracts;
 | 
				
			||||||
using User = IRaCIS.Core.Domain.Models.User;
 | 
					using User = IRaCIS.Core.Domain.Models.User;
 | 
				
			||||||
 | 
					using DocumentFormat.OpenXml.Office2010.Word;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace IRaCIS.Core.Application.Services
 | 
					namespace IRaCIS.Core.Application.Services
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -19,14 +20,16 @@ namespace IRaCIS.Core.Application.Services
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private readonly IRepository<SystemDocument> _systemDocumentRepository;
 | 
					        private readonly IRepository<SystemDocument> _systemDocumentRepository;
 | 
				
			||||||
        private readonly IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository;
 | 
					        private readonly IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository;
 | 
				
			||||||
 | 
					        private readonly IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public SystemDocumentService( IRepository<SystemDocument> systemDocumentRepository,
 | 
					        public SystemDocumentService( IRepository<SystemDocument> systemDocumentRepository,
 | 
				
			||||||
            IRepository<SystemDocNeedConfirmedUserType> systemDocNeedConfirmedUserTypeRepository
 | 
					            IRepository<SystemDocNeedConfirmedUserType> systemDocNeedConfirmedUserTypeRepository,
 | 
				
			||||||
            )
 | 
					            IRepository<SystemDocConfirmedUser> systemDocConfirmedUserRepository)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _systemDocumentRepository = systemDocumentRepository;
 | 
					            _systemDocumentRepository = systemDocumentRepository;
 | 
				
			||||||
            this._systemDocNeedConfirmedUserTypeRepository = systemDocNeedConfirmedUserTypeRepository;
 | 
					            this._systemDocNeedConfirmedUserTypeRepository = systemDocNeedConfirmedUserTypeRepository;
 | 
				
			||||||
        }
 | 
					            _systemDocConfirmedUserRepository = systemDocConfirmedUserRepository;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -109,6 +112,22 @@ namespace IRaCIS.Core.Application.Services
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [HttpDelete("{systemDocumentId:guid}")]
 | 
				
			||||||
 | 
					        public async Task<IResponseOutput> AbandonSystemDocumentAsync(Guid systemDocumentId)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            await _systemDocumentRepository.UpdatePartialFromQueryAsync(systemDocumentId, u => new SystemDocument() { IsDeleted = true });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == systemDocumentId, x => new SystemDocConfirmedUser()
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                IsDeleted = true
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            await _systemDocConfirmedUserRepository.SaveChangesAsync();
 | 
				
			||||||
 | 
					            return ResponseOutput.Result(true);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [HttpDelete("{systemDocumentId:guid}")]
 | 
					        [HttpDelete("{systemDocumentId:guid}")]
 | 
				
			||||||
        public async Task<IResponseOutput> DeleteSystemDocumentAsync(Guid systemDocumentId)
 | 
					        public async Task<IResponseOutput> DeleteSystemDocumentAsync(Guid systemDocumentId)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue