LifePayment/LifePayment.HttpApi/LifePay/LogController.cs
@@ -1,31 +1,19 @@
using Castle.Core.Logging;
using LifePayment.Application.Sync;
using LifePayment.Application.Contracts;
using LifePayment.Domain.Shared;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
using ZeroD.Util;
namespace LifePayment.HttpApi.LifePay
namespace LifePayment.HttpApi
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class LogController : AbpController
    {
        private readonly ILogger<LogController> logger;
        private readonly IHttpContextAccessor httpContextAccessor;
        private readonly ILogService logService;
        public LogController(
            ILogger<LogController> logger,
            IHttpContextAccessor httpContextAccessor)
        public LogController(ILogService logService)
        {
            this.logger = logger;
            this.httpContextAccessor = httpContextAccessor;
            this.logService = logService;
        }
        /// <summary>
@@ -33,10 +21,9 @@
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public void LogFront(LogFrontInput message)
        public async void LogFront(LogFrontInput message)
        {
            string ip = httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString();
            logger.LogInformation($"前端日志(IP-{ip}):{message.ToJson()}");
            await logService.LogFront(message);
        }
    }
}