zhengyiming
2025-03-19 a21551afb5f23820eb12848f560f4050eb5c35e2
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -2,6 +2,7 @@
using LifePayment.Domain.Shared;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -20,13 +21,16 @@
    {
        private readonly ILifePayService _lifePayService;
        private readonly IWebClientInfoProvider _webClientInfoProvider;
        private readonly ILogger<LifePayController> _logger;
        public LifePayController(
              ILifePayService lifePayService,
              IWebClientInfoProvider webClientInfoProvider
            , ILogger<LifePayController> logger
              )
        {
            _lifePayService = lifePayService;
            _webClientInfoProvider = webClientInfoProvider;
            _logger = logger;
        }
        #region 查询
@@ -54,7 +58,8 @@
        {
            var aresResult = await _lifePayService.GetElectricSupportArea();
            var parValues = await _lifePayService.GetElectricParValue();
            CheckExtensions.IfTrueThrowUserFriendlyException(aresResult == null, "电费充值区域不存在");
            CheckExtensions.IfTrueThrowUserFriendlyException(parValues == null, "电费面额不存在");
            foreach (var item in aresResult.ElectricAreaList)
            {
                var paritem = parValues.ElectricParValue.Where(r => r.AreaName == item.CityName).FirstOrDefault();
@@ -104,6 +109,20 @@
        {
            return await _lifePayService.GetGasOrgType();
        }
        /// <summary>
        /// 添加日志
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<int> AddLogger(LogErrorInput input)
        {
            Logger.LogError("前端错误:" + input.Error);
            return Constant.SUCCESS;
        }
        /// <summary>
        /// 获取折扣
@@ -189,6 +208,15 @@
        }
        /// <summary>
        /// 获取全部缴费渠道
        /// </summary>
        [HttpGet]
        public async Task<List<CreateEditPayChannelsInput>> GetLifePayChannlesAllList()
        {
            return await _lifePayService.GetLifePayChannlesAllList();
        }
        /// <summary>
        /// 获取渠道详情
        /// </summary>
        /// <param name="id"></param>