feat: 完成token功能
This commit is contained in:
@@ -7,16 +7,22 @@ namespace Yi.Framework.AiHub.Domain.Entities;
|
||||
/// 用量统计
|
||||
/// </summary>
|
||||
[SugarTable("Ai_UsageStatistics")]
|
||||
[SugarIndex($"index_{{table}}_{nameof(UserId)}_{nameof(ModelId)}_{nameof(TokenId)}",
|
||||
nameof(UserId), OrderByType.Asc,
|
||||
nameof(ModelId), OrderByType.Asc,
|
||||
nameof(TokenId), OrderByType.Asc
|
||||
)]
|
||||
public class UsageStatisticsAggregateRoot : FullAuditedAggregateRoot<Guid>
|
||||
{
|
||||
public UsageStatisticsAggregateRoot()
|
||||
{
|
||||
}
|
||||
|
||||
public UsageStatisticsAggregateRoot(Guid? userId, string modelId)
|
||||
public UsageStatisticsAggregateRoot(Guid? userId, string modelId, Guid tokenId)
|
||||
{
|
||||
UserId = userId;
|
||||
ModelId = modelId;
|
||||
TokenId = tokenId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -29,6 +35,11 @@ public class UsageStatisticsAggregateRoot : FullAuditedAggregateRoot<Guid>
|
||||
/// </summary>
|
||||
public string ModelId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Token密钥Id(通过API调用时记录,Web调用为Guid.Empty)
|
||||
/// </summary>
|
||||
public Guid TokenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 对话次数
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user