mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-04 04:48:01 +08:00
Tk (#197)
* refactor: ♻️ 业务代码项目文件名与框架代码项目文件名区分 * refactor: ♻️ 业务代码项目文件名与框架代码项目文件名区分 --------- Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
@ -0,0 +1,41 @@
|
||||
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; }
|
||||
}
|
Reference in New Issue
Block a user