Add billing

This commit is contained in:
2025-10-26 21:42:53 +08:00
parent 50133684c7
commit 43e50a00ce
16 changed files with 385 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ using NodaTime.Serialization.Protobuf;
namespace DysonNetwork.Shared.Models;
public class WalletCurrency
public abstract class WalletCurrency
{
public const string SourcePoint = "points";
public const string GoldenPoint = "golds";

View File

@@ -8,6 +8,9 @@ public class SnThinkingSequence : ModelBase
{
public Guid Id { get; set; } = Guid.NewGuid();
[MaxLength(4096)] public string? Topic { get; set; }
public long TotalToken { get; set; }
public long PaidToken { get; set; }
public Guid AccountId { get; set; }
}
@@ -38,11 +41,13 @@ public class SnThinkingThought : ModelBase
public string? Content { get; set; }
[Column(TypeName = "jsonb")] public List<SnCloudFileReferenceObject> Files { get; set; } = [];
[Column(TypeName = "jsonb")] public List<SnThinkingChunk> Chunks { get; set; } = [];
public ThinkingThoughtRole Role { get; set; }
public long TokenCount { get; set; }
[MaxLength(4096)] public string? ModelName { get; set; }
public Guid SequenceId { get; set; }
[JsonIgnore] public SnThinkingSequence Sequence { get; set; } = null!;
}

View File

@@ -60,6 +60,11 @@ public static class ServiceInjectionHelper
{ ServerCertificateCustomValidationCallback = (_, _, _, _) => true }
);
services.AddGrpcClient<WalletService.WalletServiceClient>(o => o.Address = new Uri("https://_grpc.pass"))
.ConfigurePrimaryHttpMessageHandler(_ => new HttpClientHandler()
{ ServerCertificateCustomValidationCallback = (_, _, _, _) => true }
);
services
.AddGrpcClient<RealmService.RealmServiceClient>(o => o.Address = new Uri("https://_grpc.pass"))
.ConfigurePrimaryHttpMessageHandler(_ => new HttpClientHandler()
@@ -113,4 +118,4 @@ public static class ServiceInjectionHelper
return services;
}
}
}