feat: 完成账户信息转发

This commit is contained in:
ccnetcore
2025-06-21 21:40:51 +08:00
parent a81be99100
commit 7d902682f8
3 changed files with 24 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\framework\Yi.Framework.Ddd.Application.Contracts\Yi.Framework.Ddd.Application.Contracts.csproj" />
<ProjectReference Include="..\..\rbac\Yi.Framework.Rbac.Application.Contracts\Yi.Framework.Rbac.Application.Contracts.csproj" />
<ProjectReference Include="..\Yi.Framework.AiHub.Domain.Shared\Yi.Framework.AiHub.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,13 +1,16 @@
using Microsoft.Extensions.DependencyInjection;
using Yi.Framework.AiHub.Application.Contracts.Options;
using Yi.Framework.AiHub.Domain.Shared;
using Yi.Framework.Ddd.Application.Contracts;
using Yi.Framework.Rbac.Application.Contracts;
namespace Yi.Framework.AiHub.Application.Contracts
{
[DependsOn(
typeof(YiFrameworkAiHubDomainSharedModule),
typeof(YiFrameworkDddApplicationContractsModule))]
typeof(YiFrameworkDddApplicationContractsModule),
typeof(YiFrameworkRbacApplicationContractsModule)
)]
public class YiFrameworkAiHubApplicationContractsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

View File

@@ -1,7 +1,10 @@
using System.Text;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.Identity.Client;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using OpenAI.Chat;
@@ -10,6 +13,8 @@ using Volo.Abp.Users;
using Yi.Framework.AiHub.Application.Contracts.Dtos;
using Yi.Framework.AiHub.Application.Contracts.Options;
using Yi.Framework.AiHub.Domain.Managers;
using Yi.Framework.Rbac.Application.Contracts.IServices;
using Yi.Framework.Rbac.Domain.Shared.Dtos;
namespace Yi.Framework.AiHub.Application.Services;
@@ -31,6 +36,19 @@ public class AiChatService : ApplicationService
}
/// <summary>
/// 查询已登录的账户信息
/// </summary>
/// <returns></returns>
[Route("ai-chat/account")]
[Authorize]
public async Task<UserRoleMenuDto> GetAsync()
{
var accountService = LazyServiceProvider.GetRequiredService<IAccountService>();
var output = await accountService.GetAsync();
return output;
}
/// <summary>
/// 获取模型列表
/// </summary>