Skip to content

Commit a95d6f2

Browse files
authored
Merge pull request #72 from masastack/feat/add_operation_log
feat(AuthClient): add OperationLogService integration
2 parents 03166c0 + 8ff791b commit a95d6f2

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Contrib.Wasm/Masa.Contrib.StackSdks.Auth.Wasm/AuthClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public AuthClient(ICaller caller, IMultiEnvironmentUserContext userContext)
1919
ClientService = new ClientService(caller);
2020
DynamicRoleService = new DynamicRoleService(caller);
2121
UserClaimService = new UserClaimService(caller);
22+
OperationLogService = new OperationLogService(caller);
2223
}
2324

2425
public IUserService UserService { get; }
@@ -44,5 +45,7 @@ public AuthClient(ICaller caller, IMultiEnvironmentUserContext userContext)
4445
public IDynamicRoleService DynamicRoleService { get; }
4546

4647
public IUserClaimService UserClaimService { get; }
48+
49+
public IOperationLogService OperationLogService { get; }
4750
}
4851

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace Masa.Contrib.StackSdks.Auth.Wasm.Service;
2+
3+
public class OperationLogService : IOperationLogService
4+
{
5+
readonly ICaller _caller;
6+
7+
const string PARTY = "api/operationLog/";
8+
9+
public OperationLogService(ICaller caller)
10+
{
11+
_caller = caller;
12+
}
13+
14+
public async Task AddLogAsync(AddOperationLogModel logModel)
15+
{
16+
var requestUri = $"{PARTY}add";
17+
await _caller.PostAsync(requestUri, logModel);
18+
}
19+
}

0 commit comments

Comments
 (0)