mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-03 02:18:00 +08:00
* refactor: ♻️ 业务代码项目文件名与框架代码项目文件名区分 * refactor: ♻️ 业务代码项目文件名与框架代码项目文件名区分 --------- Co-authored-by: tk <fiyne1a@dingtalk.com>
41 lines
988 B
C#
41 lines
988 B
C#
using NetAdmin.Domain.Contexts;
|
|
|
|
namespace NetAdmin.Application.Services;
|
|
|
|
/// <inheritdoc />
|
|
public abstract class ServiceBase<TLogger> : ServiceBase
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ServiceBase{TLogger}" /> class.
|
|
/// </summary>
|
|
protected ServiceBase() //
|
|
{
|
|
Logger = App.GetService<ILogger<TLogger>>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 日志记录器
|
|
/// </summary>
|
|
protected ILogger<TLogger> Logger { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 服务基类
|
|
/// </summary>
|
|
public abstract class ServiceBase : IScoped, IService
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ServiceBase" /> class.
|
|
/// </summary>
|
|
protected ServiceBase()
|
|
{
|
|
UserToken = App.GetService<ContextUserToken>();
|
|
ServiceId = Guid.NewGuid();
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public Guid ServiceId { get; init; }
|
|
|
|
/// <inheritdoc />
|
|
public ContextUserToken UserToken { get; set; }
|
|
} |