Add package sync workflow

This commit is contained in:
2026-04-10 22:06:39 +08:00
parent 47f9a8bafa
commit 48eeb79d7d
128 changed files with 4748 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Threading.Tasks;
public sealed class BriskPlayerModule
: BriskModuleBase
{
public async Task<BriskPlayerMe> GetMeAsync()
{
return await ExecuteAsync(async context =>
{
var data = await context.HttpClient.GetDataAsync("/player/me", null, true);
var result = BriskModelMapper.ToPlayerMe(data);
context.Session.Update(
context.Session.AccessToken,
context.Session.ExpiresAt,
result.PlayerId,
result.ProjectAccountId,
result.LoginProvider,
result.LoginUserId);
await context.TokenStore.SaveAsync(new BriskStoredSession
{
AccessToken = context.Session.AccessToken,
ExpiresAt = context.Session.ExpiresAt,
PlayerId = result.PlayerId,
ProjectAccountId = result.ProjectAccountId,
LoginProvider = result.LoginProvider,
LoginUserId = result.LoginUserId
});
return result;
});
}
}