z8018
2026-02-11 b8fb68b44c29e4667f6ea5746119413809a60a9e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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;
    }
}