FalconSSO/FAuth/Controllers/ControllerBase.cs
2020-03-30 16:10:51 +08:00

33 lines
927 B
C#

using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace FAuth.Controllers
{
/// <summary>
/// 控制器类基类
/// </summary>
public abstract class ControllerBase<LoggerType>:Controller
{
/// <summary>
/// 日志记录服务
/// </summary>
public ILogger Logger { get; set; }
/// <summary>
/// 服务集合
/// </summary>
public IServiceProvider Services { get; set; }
/// <summary>
/// 通过日志组件和服务集合生成控制器
/// </summary>
/// <param name="logger">控制器日志组件</param>
/// <param name="service">服务集合</param>
public ControllerBase(ILogger<LoggerType> logger,IServiceProvider service) {
this.Logger = logger;
this.Services = service;
}
}
}