using KH.WMS.Core.Attributes;
|
using KH.WMS.Core.DependencyInjection.ServiceLifetimes;
|
using Microsoft.Extensions.DependencyInjection;
|
|
namespace KH.WMS.TestProj;
|
|
/// <summary>
|
/// 测试服务(带日志拦截器)
|
/// </summary>
|
|
[RegisteredService(Lifetime = ServiceLifetime.Scoped)]
|
public class TestService : ITestService
|
{
|
private readonly TestOneService _testOneService;
|
private readonly TestTwoService _testTwoService;
|
|
public TestService(TestOneService testOneService, TestTwoService testTwoService)
|
{
|
_testOneService = testOneService;
|
_testTwoService = testTwoService;
|
}
|
|
[LogInterceptor(LogParameters = true, LogReturnValue = true, LogLevel = Microsoft.Extensions.Logging.LogLevel.Information)]
|
public object GetTestObject()
|
{
|
string message = "Executing TestService.GetTestObject";
|
|
message += _testOneService.GetTestObject();
|
|
message += _testTwoService.GetTestObject();
|
|
message += GetType().FullName ?? string.Empty;
|
|
message += " Finished TestService.GetTestObject";
|
|
return message;
|
}
|
}
|