Pusher service

This commit is contained in:
2025-07-12 23:31:21 +08:00
parent e1b47bc7d1
commit 4a7f2e18b3
16 changed files with 563 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
using DysonNetwork.Shared.Cache;
using DysonNetwork.Shared.Geo;
using DysonNetwork.Shared.GeoIp;
namespace DysonNetwork.Pass.Account;

View File

@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc;
using NodaTime;
using Microsoft.EntityFrameworkCore;
using DysonNetwork.Pass.Account;
using DysonNetwork.Shared.Geo;
using DysonNetwork.Shared.GeoIp;
namespace DysonNetwork.Pass.Auth;

View File

@@ -4,9 +4,9 @@ using Microsoft.EntityFrameworkCore;
namespace DysonNetwork.Pass.Auth;
public class AuthServiceGrpc(AuthService authService, AppDatabase db) : Shared.Proto.AuthService
public class AuthServiceGrpc(AuthService authService, AppDatabase db) : Shared.Proto.AuthService.AuthServiceBase
{
public async Task<Shared.Proto.AuthSession> Authenticate(AuthenticateRequest request, ServerCallContext context)
public override async Task<Shared.Proto.AuthSession> Authenticate(AuthenticateRequest request, ServerCallContext context)
{
if (!authService.ValidateToken(request.Token, out var sessionId))
{

View File

@@ -1,5 +1,6 @@
using System.Net;
using DysonNetwork.Pass.Account;
using DysonNetwork.Pass.Auth;
using DysonNetwork.Pass.Permission;
using Microsoft.AspNetCore.HttpOverrides;
using Prometheus;
@@ -68,6 +69,7 @@ public static class ApplicationConfiguration
public static WebApplication ConfigureGrpcServices(this WebApplication app)
{
app.MapGrpcService<AccountServiceGrpc>();
app.MapGrpcService<AuthServiceGrpc>();
return app;
}

View File

@@ -18,7 +18,7 @@ using DysonNetwork.Pass.Auth.OidcProvider.Services;
using DysonNetwork.Pass.Handlers;
using DysonNetwork.Pass.Wallet.PaymentHandlers;
using DysonNetwork.Shared.Cache;
using DysonNetwork.Shared.Geo;
using DysonNetwork.Shared.GeoIp;
namespace DysonNetwork.Pass.Startup;
@@ -53,6 +53,7 @@ public static class ServiceCollectionExtensions
// Register gRPC services
services.AddScoped<AccountServiceGrpc>();
services.AddScoped<AuthServiceGrpc>();
// Register OIDC services
services.AddScoped<OidcService, GoogleOidcService>();

View File

@@ -1,12 +0,0 @@
namespace DysonNetwork.Pass;
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}