Пример #1
0
        public async Task <OperationContentViewModel> QueryOperationContentAsync(QueryOperationContent query)
        {
            var adminLog = await _adminLogRepository.QueryById(query.Id);

            if (adminLog == null)
            {
                return(null);
            }

            var aesHelper            = new AesHelper();
            var decryptAfterContent  = aesHelper.Decrypt(adminLog.AfterContent);
            var decryptBeforeContent = aesHelper.Decrypt(adminLog.BeforeContent);

            return(new OperationContentViewModel()
            {
                AfterContent = decryptAfterContent,
                BeforeContent = decryptBeforeContent
            });
        }
Пример #2
0
 public async Task <ApiResult <OperationContentViewModel> > QueryOperationContentAsync([FromQuery] QueryOperationContent query)
 {
     return(await _adminLogApplication.QueryOperationContentAsync(query));
 }
Пример #3
0
        public async Task <ApiResult <OperationContentViewModel> > QueryOperationContentAsync(QueryOperationContent query)
        {
            var result = await _adminLogService.QueryOperationContentAsync(query);

            return(new ApiResult <OperationContentViewModel>()
            {
                Code = result != null ? (int)ApiResultCode.Success : (int)ApiResultCode.ParamError,
                Data = result,
                Message = result != null ? "成功" : "不存在的ID"
            });
        }