Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a50c45f7a3 | ||
|
|
2bc8837155 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -265,7 +265,6 @@ src/Acme.BookStore.Blazor.Server.Tiered/Logs/*
|
|||||||
**/wwwroot/libs/*
|
**/wwwroot/libs/*
|
||||||
public
|
public
|
||||||
dist
|
dist
|
||||||
dist - 副本
|
|
||||||
.vscode
|
.vscode
|
||||||
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Development.json
|
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Development.json
|
||||||
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Production.json
|
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Production.json
|
||||||
@@ -278,6 +277,3 @@ database_backup
|
|||||||
/Yi.Abp.Net8/src/Yi.Abp.Web/yi-abp-dev.db
|
/Yi.Abp.Net8/src/Yi.Abp.Web/yi-abp-dev.db
|
||||||
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
.claude
|
|
||||||
components.d.ts
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"permissions": {
|
|
||||||
"allow": [
|
|
||||||
"Bash(dotnet build \"E:\\code\\github\\Yi\\Yi.Abp.Net8\\module\\ai-hub\\Yi.Framework.AiHub.Application\\Yi.Framework.AiHub.Application.csproj\" --no-restore)",
|
|
||||||
"Read(//e/code/github/Yi/Yi.Ai.Vue3/**)",
|
|
||||||
"Bash(dotnet build:*)"
|
|
||||||
],
|
|
||||||
"deny": [],
|
|
||||||
"ask": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
# CLAUDE.md
|
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
Yi.Abp.Net8 is a modular, multi-tenant SaaS platform built on ABP Framework 8.3.4 with .NET 8.0. It uses **SqlSugar** (not EF Core) as the ORM and follows Domain-Driven Design (DDD) principles. The platform includes AI/ML features (chat, models, agents, token tracking), RBAC, forum, messaging, and digital collectibles modules.
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
### Solution Structure
|
|
||||||
|
|
||||||
```
|
|
||||||
Yi.Abp.Net8/
|
|
||||||
├── src/ # Main application host
|
|
||||||
│ └── Yi.Abp.Web/ # ASP.NET Core 8.0 Web Host (port 19001)
|
|
||||||
├── framework/ # Framework layer (shared infrastructure)
|
|
||||||
│ ├── Yi.Framework.Core # Core utilities, JSON handling
|
|
||||||
│ ├── Yi.Framework.SqlSugarCore # SqlSugar ORM abstraction (v5.1.4.197-preview22)
|
|
||||||
│ ├── Yi.Framework.SqlSugarCore.Abstractions # Repository interfaces
|
|
||||||
│ ├── Yi.Framework.AspNetCore # ASP.NET Core extensions
|
|
||||||
│ ├── Yi.Framework.AspNetCore.Authentication.OAuth # QQ, Gitee OAuth
|
|
||||||
│ ├── Yi.Framework.Ddd.Application # DDD application base classes
|
|
||||||
│ ├── Yi.Framework.BackgroundWorkers.Hangfire # Job scheduling
|
|
||||||
│ ├── Yi.Framework.Caching.FreeRedis # Redis caching
|
|
||||||
│ └── Yi.Framework.SemanticKernel # AI/ML integration
|
|
||||||
├── module/ # Business modules (each follows 5-layer DDD pattern)
|
|
||||||
│ ├── ai-hub/ # AI services (chat, models, sessions, agents)
|
|
||||||
│ ├── rbac/ # Role-Based Access Control (core auth/authz)
|
|
||||||
│ ├── bbs/ # Forum/community
|
|
||||||
│ ├── chat-hub/ # Real-time messaging
|
|
||||||
│ ├── audit-logging/ # Audit trail tracking
|
|
||||||
│ ├── code-gen/ # Code generation
|
|
||||||
│ ├── tenant-management/ # Multi-tenancy support
|
|
||||||
│ ├── digital-collectibles/ # NFT/digital assets
|
|
||||||
│ └── ai-stock/ # AI-powered stock analysis
|
|
||||||
├── test/ # Unit tests (xUnit + NSubstitute + Shouldly)
|
|
||||||
├── client/ # HTTP API clients
|
|
||||||
└── tool/ # Development utilities
|
|
||||||
```
|
|
||||||
|
|
||||||
### Module Structure (DDD Layers)
|
|
||||||
|
|
||||||
Each module follows this pattern:
|
|
||||||
|
|
||||||
```
|
|
||||||
module/[feature]/
|
|
||||||
├── [Feature].Domain.Shared/ # Constants, enums, shared DTOs
|
|
||||||
├── [Feature].Domain/ # Entities, aggregates, domain services
|
|
||||||
├── [Feature].Application.Contracts/ # Service interfaces, DTOs
|
|
||||||
├── [Feature].Application/ # Application services (implementations)
|
|
||||||
└── [Feature].SqlSugarCore/ # Repository implementations, DbContext
|
|
||||||
```
|
|
||||||
|
|
||||||
**Dependency Flow:** Application → Domain + Application.Contracts → Domain.Shared → Framework
|
|
||||||
|
|
||||||
### Module Registration
|
|
||||||
|
|
||||||
All modules are registered in `src/Yi.Abp.Web/YiAbpWebModule.cs`. When adding a new module:
|
|
||||||
|
|
||||||
1. Add `DependsOn` attribute in `YiAbpWebModule`
|
|
||||||
2. Add conventional controller in `PreConfigureServices`:
|
|
||||||
```csharp
|
|
||||||
options.ConventionalControllers.Create(typeof(YiFramework[Feature]ApplicationModule).Assembly,
|
|
||||||
option => option.RemoteServiceName = "[service-name]");
|
|
||||||
```
|
|
||||||
|
|
||||||
### API Routing
|
|
||||||
|
|
||||||
All API routes use the unified prefix: `/api/app/{service-name}/{controller}/{action}`
|
|
||||||
|
|
||||||
Registered service names:
|
|
||||||
- `default` - Main application services
|
|
||||||
- `rbac` - Authentication, authorization, user/role management
|
|
||||||
- `ai-hub` - AI chat, models, sessions, agents
|
|
||||||
- `bbs` - Forum posts and comments
|
|
||||||
- `chat-hub` - Real-time messaging
|
|
||||||
- `tenant-management` - Multi-tenant configuration
|
|
||||||
- `code-gen` - Code generation utilities
|
|
||||||
- `digital-collectibles` - NFT/digital assets
|
|
||||||
- `ai-stock` - Stock analysis
|
|
||||||
|
|
||||||
## Database
|
|
||||||
|
|
||||||
**ORM:** SqlSugar (NOT Entity Framework Core)
|
|
||||||
|
|
||||||
**Configuration** (`appsettings.json`):
|
|
||||||
```json
|
|
||||||
"DbConnOptions": {
|
|
||||||
"Url": "DataSource=yi-abp-dev.db",
|
|
||||||
"DbType": "Sqlite", // Sqlite, Mysql, Sqlserver, Oracle, PostgreSQL
|
|
||||||
"EnabledCodeFirst": true, // Auto-create tables
|
|
||||||
"EnabledDbSeed": true, // Auto-seed data
|
|
||||||
"EnabledSaasMultiTenancy": true
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Multi-tenancy:** Tenant isolation via `HeaderTenantResolveContributor` (NOT cookie-based). Tenant is resolved from `__tenant` header.
|
|
||||||
|
|
||||||
## Key Technologies
|
|
||||||
|
|
||||||
| Component | Technology |
|
|
||||||
|-----------|-----------|
|
|
||||||
| Framework | ABP 8.3.4 |
|
|
||||||
| .NET Version | .NET 8.0 |
|
|
||||||
| ORM | SqlSugar 5.1.4.197-preview22 |
|
|
||||||
| Authentication | JWT Bearer + Refresh Tokens |
|
|
||||||
| OAuth | QQ, Gitee |
|
|
||||||
| Caching | FreeRedis (optional) |
|
|
||||||
| Background Jobs | Hangfire (in-memory or Redis) |
|
|
||||||
| Logging | Serilog (daily rolling files) |
|
|
||||||
| Testing | xUnit + NSubstitute + Shouldly |
|
|
||||||
| Container | Autofac |
|
|
||||||
|
|
||||||
## Important Notes
|
|
||||||
|
|
||||||
- **JSON Serialization:** Uses Microsoft's `System.Text.Json`, NOT Newtonsoft.Json. Date format handled via `DatetimeJsonConverter`.
|
|
||||||
- **Multi-tenancy:** Tenant resolved from `__tenant` header, NOT cookies.
|
|
||||||
- **Rate Limiting:** Disabled in development, enabled in production (1000 req/60s sliding window).
|
|
||||||
- **Swagger:** Available at `/swagger` in development.
|
|
||||||
- **Hangfire Dashboard:** Available at `/hangfire` (requires JWT authorization).
|
|
||||||
- **Background Workers:** Disabled in development (`AbpBackgroundWorkerOptions.IsEnabled = false`).
|
|
||||||
|
|
||||||
## Development Workflow
|
|
||||||
|
|
||||||
1. **Branch:** Main branch is `abp`, current development branch is `ai-hub`.
|
|
||||||
2. **Commit Convention:** Chinese descriptive messages with prefixes (`feat:`, `fix:`, `style:`).
|
|
||||||
3. **Testing:** Run `dotnet test` before committing.
|
|
||||||
4. **Building:** Use `dotnet build --no-restore` for faster builds after initial restore.
|
|
||||||
@@ -186,18 +186,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Stock.Domain.S
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Stock.SqlSugarCore", "module\ai-stock\Yi.Framework.Stock.SqlSugarCore\Yi.Framework.Stock.SqlSugarCore.csproj", "{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Stock.SqlSugarCore", "module\ai-stock\Yi.Framework.Stock.SqlSugarCore\Yi.Framework.Stock.SqlSugarCore.csproj", "{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ai-hub", "ai-hub", "{7AD5DBAE-44F9-474B-8F7B-837EDE908934}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.AiHub.Application", "module\ai-hub\Yi.Framework.AiHub.Application\Yi.Framework.AiHub.Application.csproj", "{1AD10DD2-535E-4EAB-A8A4-EC3FCA206895}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.AiHub.Application.Contracts", "module\ai-hub\Yi.Framework.AiHub.Application.Contracts\Yi.Framework.AiHub.Application.Contracts.csproj", "{123D1C81-D667-4060-8E85-FFE7FB4584AD}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.AiHub.Domain", "module\ai-hub\Yi.Framework.AiHub.Domain\Yi.Framework.AiHub.Domain.csproj", "{8EB4C8BB-6B21-4811-9FAB-B98FA5CA754D}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.AiHub.Domain.Shared", "module\ai-hub\Yi.Framework.AiHub.Domain.Shared\Yi.Framework.AiHub.Domain.Shared.csproj", "{5FC6CA90-D5B4-433E-9B2C-94330FFB4C48}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.AiHub.SqlSugarCore", "module\ai-hub\Yi.Framework.AiHub.SqlSugarCore\Yi.Framework.AiHub.SqlSugarCore.csproj", "{8698C812-4DDC-4E80-BCD6-24C5D56AEDB1}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -480,26 +468,6 @@ Global
|
|||||||
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Release|Any CPU.Build.0 = Release|Any CPU
|
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{1AD10DD2-535E-4EAB-A8A4-EC3FCA206895}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{1AD10DD2-535E-4EAB-A8A4-EC3FCA206895}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{1AD10DD2-535E-4EAB-A8A4-EC3FCA206895}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{1AD10DD2-535E-4EAB-A8A4-EC3FCA206895}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{123D1C81-D667-4060-8E85-FFE7FB4584AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{123D1C81-D667-4060-8E85-FFE7FB4584AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{123D1C81-D667-4060-8E85-FFE7FB4584AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{123D1C81-D667-4060-8E85-FFE7FB4584AD}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{8EB4C8BB-6B21-4811-9FAB-B98FA5CA754D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{8EB4C8BB-6B21-4811-9FAB-B98FA5CA754D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{8EB4C8BB-6B21-4811-9FAB-B98FA5CA754D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8EB4C8BB-6B21-4811-9FAB-B98FA5CA754D}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{5FC6CA90-D5B4-433E-9B2C-94330FFB4C48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{5FC6CA90-D5B4-433E-9B2C-94330FFB4C48}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{5FC6CA90-D5B4-433E-9B2C-94330FFB4C48}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{5FC6CA90-D5B4-433E-9B2C-94330FFB4C48}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{8698C812-4DDC-4E80-BCD6-24C5D56AEDB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{8698C812-4DDC-4E80-BCD6-24C5D56AEDB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{8698C812-4DDC-4E80-BCD6-24C5D56AEDB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8698C812-4DDC-4E80-BCD6-24C5D56AEDB1}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -583,12 +551,6 @@ Global
|
|||||||
{162821E4-8FE0-4A68-B3C0-49BD6596446F} = {DB46873F-981A-43D8-91B0-D464CCB65943}
|
{162821E4-8FE0-4A68-B3C0-49BD6596446F} = {DB46873F-981A-43D8-91B0-D464CCB65943}
|
||||||
{10273544-715D-4BB3-893C-6F010D947BDD} = {DB46873F-981A-43D8-91B0-D464CCB65943}
|
{10273544-715D-4BB3-893C-6F010D947BDD} = {DB46873F-981A-43D8-91B0-D464CCB65943}
|
||||||
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983} = {DB46873F-981A-43D8-91B0-D464CCB65943}
|
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983} = {DB46873F-981A-43D8-91B0-D464CCB65943}
|
||||||
{7AD5DBAE-44F9-474B-8F7B-837EDE908934} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853}
|
|
||||||
{1AD10DD2-535E-4EAB-A8A4-EC3FCA206895} = {7AD5DBAE-44F9-474B-8F7B-837EDE908934}
|
|
||||||
{123D1C81-D667-4060-8E85-FFE7FB4584AD} = {7AD5DBAE-44F9-474B-8F7B-837EDE908934}
|
|
||||||
{8EB4C8BB-6B21-4811-9FAB-B98FA5CA754D} = {7AD5DBAE-44F9-474B-8F7B-837EDE908934}
|
|
||||||
{5FC6CA90-D5B4-433E-9B2C-94330FFB4C48} = {7AD5DBAE-44F9-474B-8F7B-837EDE908934}
|
|
||||||
{8698C812-4DDC-4E80-BCD6-24C5D56AEDB1} = {7AD5DBAE-44F9-474B-8F7B-837EDE908934}
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {23D6FBC9-C970-4641-BC1E-2AEA59F51C18}
|
SolutionGuid = {23D6FBC9-C970-4641-BC1E-2AEA59F51C18}
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Authentication;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Volo.Abp.DependencyInjection;
|
|
||||||
using Yi.Framework.Core.Authentication;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AspNetCore.Microsoft.AspNetCore.Authentication;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 可刷新的鉴权提供者
|
|
||||||
/// </summary>
|
|
||||||
public class RefreshAuthenticationHandlerProvider : IRefreshAuthenticationHandlerProvider
|
|
||||||
{
|
|
||||||
private Dictionary<string, IAuthenticationHandler> _handlerMap =
|
|
||||||
new Dictionary<string, IAuthenticationHandler>((IEqualityComparer<string>)StringComparer.Ordinal);
|
|
||||||
|
|
||||||
/// <summary>Constructor.</summary>
|
|
||||||
/// <param name="schemes">The <see cref="T:Microsoft.AspNetCore.Authentication.IAuthenticationHandlerProvider" />.</param>
|
|
||||||
public RefreshAuthenticationHandlerProvider(IAuthenticationSchemeProvider schemes)
|
|
||||||
{
|
|
||||||
this.Schemes = schemes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The <see cref="T:Microsoft.AspNetCore.Authentication.IAuthenticationHandlerProvider" />.
|
|
||||||
/// </summary>
|
|
||||||
public IAuthenticationSchemeProvider Schemes { get; }
|
|
||||||
|
|
||||||
/// <summary>Returns the handler instance that will be used.</summary>
|
|
||||||
/// <param name="context">The context.</param>
|
|
||||||
/// <param name="authenticationScheme">The name of the authentication scheme being handled.</param>
|
|
||||||
/// <returns>The handler instance.</returns>
|
|
||||||
public async Task<IAuthenticationHandler?> GetHandlerAsync(
|
|
||||||
HttpContext context,
|
|
||||||
string authenticationScheme)
|
|
||||||
{
|
|
||||||
IAuthenticationHandler handlerAsync;
|
|
||||||
if (this._handlerMap.TryGetValue(authenticationScheme, out handlerAsync))
|
|
||||||
return handlerAsync;
|
|
||||||
AuthenticationScheme schemeAsync = await this.Schemes.GetSchemeAsync(authenticationScheme);
|
|
||||||
if (schemeAsync == null)
|
|
||||||
return (IAuthenticationHandler)null;
|
|
||||||
|
|
||||||
if ((context.RequestServices.GetService(schemeAsync.HandlerType) ??
|
|
||||||
ActivatorUtilities.CreateInstance(context.RequestServices, schemeAsync.HandlerType)) is
|
|
||||||
IAuthenticationHandler handler)
|
|
||||||
{
|
|
||||||
handlerAsync = handler;
|
|
||||||
await handler.InitializeAsync(schemeAsync, context);
|
|
||||||
this._handlerMap[authenticationScheme] = handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
return handlerAsync;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 刷新鉴权
|
|
||||||
/// </summary>
|
|
||||||
public void RefreshAuthentication()
|
|
||||||
{
|
|
||||||
_handlerMap = new Dictionary<string, IAuthenticationHandler>((IEqualityComparer<string>)StringComparer.Ordinal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,17 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Xml.Linq;
|
||||||
using Microsoft.AspNetCore.Mvc.Controllers;
|
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
using Microsoft.OpenApi.Any;
|
using Microsoft.OpenApi.Any;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
using Volo.Abp.AspNetCore.Mvc;
|
using Volo.Abp.AspNetCore.Mvc;
|
||||||
using Volo.Abp.AspNetCore.Mvc.Conventions;
|
using Volo.Abp.AspNetCore.Mvc.Conventions;
|
||||||
|
using Volo.Abp.DependencyInjection;
|
||||||
|
using Volo.Abp.Options;
|
||||||
|
|
||||||
namespace Yi.Framework.AspNetCore.Microsoft.Extensions.DependencyInjection
|
namespace Yi.Framework.AspNetCore.Microsoft.Extensions.DependencyInjection
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
using Microsoft.AspNetCore.Authentication;
|
using System.Reflection;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Microsoft.OpenApi.Models;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
|
using Volo.Abp;
|
||||||
|
using Volo.Abp.AspNetCore.Mvc;
|
||||||
using Volo.Abp.AspNetCore.WebClientInfo;
|
using Volo.Abp.AspNetCore.WebClientInfo;
|
||||||
using Yi.Framework.AspNetCore.Microsoft.AspNetCore.Authentication;
|
using Volo.Abp.DependencyInjection;
|
||||||
|
using Volo.Abp.Modularity;
|
||||||
|
using Yi.Framework.AspNetCore.Mvc;
|
||||||
using Yi.Framework.Core;
|
using Yi.Framework.Core;
|
||||||
using Yi.Framework.Core.Authentication;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AspNetCore
|
namespace Yi.Framework.AspNetCore
|
||||||
{
|
{
|
||||||
@@ -24,14 +35,8 @@ namespace Yi.Framework.AspNetCore
|
|||||||
// 替换默认的WebClientInfoProvider为支持代理的实现
|
// 替换默认的WebClientInfoProvider为支持代理的实现
|
||||||
services.Replace(new ServiceDescriptor(
|
services.Replace(new ServiceDescriptor(
|
||||||
typeof(IWebClientInfoProvider),
|
typeof(IWebClientInfoProvider),
|
||||||
typeof(RealIpHttpContextWebClientInfoProvider),
|
typeof(RealIpHttpContextWebClientInfoProvider),
|
||||||
ServiceLifetime.Transient));
|
ServiceLifetime.Transient));
|
||||||
|
|
||||||
// 替换默认的AuthenticationHandlerProvider为支持刷新鉴权
|
|
||||||
services.Replace(new ServiceDescriptor(
|
|
||||||
typeof(IAuthenticationHandlerProvider),
|
|
||||||
typeof(RefreshAuthenticationHandlerProvider),
|
|
||||||
ServiceLifetime.Scoped));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
using Hangfire;
|
using Hangfire;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using Volo.Abp.BackgroundJobs.Hangfire;
|
using Volo.Abp.BackgroundJobs.Hangfire;
|
||||||
using Volo.Abp.BackgroundWorkers;
|
using Volo.Abp.BackgroundWorkers;
|
||||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||||
@@ -33,19 +32,13 @@ public sealed class YiFrameworkBackgroundWorkersHangfireModule : AbpModule
|
|||||||
/// <param name="context">应用程序初始化上下文</param>
|
/// <param name="context">应用程序初始化上下文</param>
|
||||||
public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
||||||
{
|
{
|
||||||
if (!context.ServiceProvider.GetRequiredService<IOptions<AbpBackgroundWorkerOptions>>().Value.IsEnabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 获取后台任务管理器和所有 Hangfire 后台任务
|
// 获取后台任务管理器和所有 Hangfire 后台任务
|
||||||
var backgroundWorkerManager = context.ServiceProvider.GetRequiredService<IBackgroundWorkerManager>();
|
var backgroundWorkerManager = context.ServiceProvider.GetRequiredService<IBackgroundWorkerManager>();
|
||||||
var workers = context.ServiceProvider.GetServices<IHangfireBackgroundWorker>();
|
var workers = context.ServiceProvider.GetServices<IHangfireBackgroundWorker>();
|
||||||
|
|
||||||
// 获取配置
|
// 获取配置
|
||||||
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
|
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
|
||||||
|
|
||||||
// 检查是否启用 Redis
|
// 检查是否启用 Redis
|
||||||
var isRedisEnabled = configuration.GetValue<bool>("Redis:IsEnabled");
|
var isRedisEnabled = configuration.GetValue<bool>("Redis:IsEnabled");
|
||||||
|
|
||||||
@@ -63,11 +56,11 @@ public sealed class YiFrameworkBackgroundWorkersHangfireModule : AbpModule
|
|||||||
{
|
{
|
||||||
// 内存模式:直接使用 Hangfire
|
// 内存模式:直接使用 Hangfire
|
||||||
var unProxyWorker = ProxyHelper.UnProxy(worker);
|
var unProxyWorker = ProxyHelper.UnProxy(worker);
|
||||||
|
|
||||||
// 添加或更新循环任务
|
// 添加或更新循环任务
|
||||||
RecurringJob.AddOrUpdate(
|
RecurringJob.AddOrUpdate(
|
||||||
worker.RecurringJobId,
|
worker.RecurringJobId,
|
||||||
(Expression<Func<Task>>)(() =>
|
(Expression<Func<Task>>)(() =>
|
||||||
((IHangfireBackgroundWorker)unProxyWorker).DoWorkAsync(default)),
|
((IHangfireBackgroundWorker)unProxyWorker).DoWorkAsync(default)),
|
||||||
worker.CronExpression,
|
worker.CronExpression,
|
||||||
new RecurringJobOptions
|
new RecurringJobOptions
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Authentication;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Core.Authentication;
|
|
||||||
|
|
||||||
public static class AuthenticationExtensions
|
|
||||||
{
|
|
||||||
public static void RefreshAuthentication(this HttpContext context)
|
|
||||||
{
|
|
||||||
var currentAuthenticationHandler =
|
|
||||||
context.RequestServices.GetRequiredService<IAuthenticationHandlerProvider>();
|
|
||||||
if (currentAuthenticationHandler is IRefreshAuthenticationHandlerProvider refreshAuthenticationHandler)
|
|
||||||
{
|
|
||||||
refreshAuthenticationHandler.RefreshAuthentication();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Authentication;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Core.Authentication;
|
|
||||||
|
|
||||||
public interface IRefreshAuthenticationHandlerProvider: IAuthenticationHandlerProvider
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 刷新鉴权
|
|
||||||
/// </summary>
|
|
||||||
void RefreshAuthentication();
|
|
||||||
}
|
|
||||||
@@ -199,11 +199,11 @@ namespace Yi.Framework.Ddd.Application
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 批量删除实体
|
/// 批量删除实体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">实体ID集合</param>
|
/// <param name="ids">实体ID集合</param>
|
||||||
[RemoteService(isEnabled: true)]
|
[RemoteService(isEnabled: true)]
|
||||||
public virtual async Task DeleteAsync(IEnumerable<TKey> id)
|
public virtual async Task DeleteAsync(IEnumerable<TKey> ids)
|
||||||
{
|
{
|
||||||
await Repository.DeleteManyAsync(id);
|
await Repository.DeleteManyAsync(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
<Import Project="..\..\common.props" />
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.SemanticKernel" Version="1.57.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.SemanticKernel;
|
|
||||||
using Yi.Framework.Core.Options;
|
|
||||||
|
|
||||||
namespace Yi.Framework.SemanticKernel;
|
|
||||||
|
|
||||||
public class YiFrameworkSemanticKernelModule : AbpModule
|
|
||||||
{
|
|
||||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
||||||
{
|
|
||||||
var configuration = context.Services.GetConfiguration();
|
|
||||||
var services = context.Services;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Nito.AsyncEx;
|
using Nito.AsyncEx;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.ActivationCode;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 批量生成激活码输入
|
|
||||||
/// </summary>
|
|
||||||
public class ActivationCodeCreateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 商品类型
|
|
||||||
/// </summary>
|
|
||||||
public ActivationCodeGoodsTypeEnum GoodsType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数量
|
|
||||||
/// </summary>
|
|
||||||
public int Count { get; set; } = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 批量生成激活码列表输入
|
|
||||||
/// </summary>
|
|
||||||
public class ActivationCodeCreateListInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 生成项列表
|
|
||||||
/// </summary>
|
|
||||||
public List<ActivationCodeCreateInput> Items { get; set; } = new();
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.ActivationCode;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 批量生成激活码输出
|
|
||||||
/// </summary>
|
|
||||||
public class ActivationCodeCreateOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 商品类型
|
|
||||||
/// </summary>
|
|
||||||
public ActivationCodeGoodsTypeEnum GoodsType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数量
|
|
||||||
/// </summary>
|
|
||||||
public int Count { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 激活码列表
|
|
||||||
/// </summary>
|
|
||||||
public List<string> Codes { get; set; } = new();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 批量生成激活码列表输出
|
|
||||||
/// </summary>
|
|
||||||
public class ActivationCodeCreateListOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 分组输出
|
|
||||||
/// </summary>
|
|
||||||
public List<ActivationCodeCreateOutput> Items { get; set; } = new();
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.ActivationCode;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 激活码兑换输入
|
|
||||||
/// </summary>
|
|
||||||
public class ActivationCodeRedeemInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 激活码
|
|
||||||
/// </summary>
|
|
||||||
public string Code { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.ActivationCode;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 激活码兑换输出
|
|
||||||
/// </summary>
|
|
||||||
public class ActivationCodeRedeemOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 商品类型
|
|
||||||
/// </summary>
|
|
||||||
public ActivationCodeGoodsTypeEnum GoodsType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品名称
|
|
||||||
/// </summary>
|
|
||||||
public string PackageName { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内容描述
|
|
||||||
/// </summary>
|
|
||||||
public string Content { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
using Yi.Framework.Rbac.Domain.Shared.Dtos;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class AiUserRoleMenuDto:UserRoleMenuDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 是否绑定服务号
|
|
||||||
/// </summary>
|
|
||||||
public bool IsBindFuwuhao { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否为VIP用户
|
|
||||||
/// </summary>
|
|
||||||
public bool IsVip { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// VIP到期时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? VipExpireTime { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Announcement;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告缓存 DTO
|
|
||||||
/// </summary>
|
|
||||||
public class AnnouncementCacheDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 版本号
|
|
||||||
/// </summary>
|
|
||||||
public string Version { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告日志列表
|
|
||||||
/// </summary>
|
|
||||||
public List<AnnouncementLogDto> Logs { get; set; } = new List<AnnouncementLogDto>();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 跳转链接
|
|
||||||
/// </summary>
|
|
||||||
public string? Url { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Announcement;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建公告输入
|
|
||||||
/// </summary>
|
|
||||||
public class AnnouncementCreateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 标题
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "标题不能为空")]
|
|
||||||
[StringLength(200, ErrorMessage = "标题不能超过200个字符")]
|
|
||||||
public string Title { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内容列表
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "内容不能为空")]
|
|
||||||
[MinLength(1, ErrorMessage = "至少需要一条内容")]
|
|
||||||
public List<string> Content { get; set; } = new List<string>();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "备注不能超过500个字符")]
|
|
||||||
public string? Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片url
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "图片URL不能超过500个字符")]
|
|
||||||
public string? ImageUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开始时间
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "开始时间不能为空")]
|
|
||||||
public DateTime StartTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 活动结束时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? EndTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告类型
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "公告类型不能为空")]
|
|
||||||
public AnnouncementTypeEnum Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 跳转链接
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "跳转链接不能超过500个字符")]
|
|
||||||
public string? Url { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Announcement;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告 DTO(后台管理使用)
|
|
||||||
/// </summary>
|
|
||||||
public class AnnouncementDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 公告ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 标题
|
|
||||||
/// </summary>
|
|
||||||
public string Title { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内容列表
|
|
||||||
/// </summary>
|
|
||||||
public List<string> Content { get; set; } = new List<string>();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
public string? Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片url
|
|
||||||
/// </summary>
|
|
||||||
public string? ImageUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开始时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime StartTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 活动结束时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? EndTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告类型
|
|
||||||
/// </summary>
|
|
||||||
public AnnouncementTypeEnum Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 跳转链接
|
|
||||||
/// </summary>
|
|
||||||
public string? Url { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Announcement;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取公告列表输入
|
|
||||||
/// </summary>
|
|
||||||
public class AnnouncementGetListInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 搜索关键字
|
|
||||||
/// </summary>
|
|
||||||
public string? SearchKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 跳过数量
|
|
||||||
/// </summary>
|
|
||||||
public int SkipCount { get; set; } = 0;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 最大结果数量
|
|
||||||
/// </summary>
|
|
||||||
public int MaxResultCount { get; set; } = 10;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告类型
|
|
||||||
/// </summary>
|
|
||||||
public AnnouncementTypeEnum? Type { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Announcement;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告日志 DTO
|
|
||||||
/// </summary>
|
|
||||||
public class AnnouncementLogDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 标题
|
|
||||||
/// </summary>
|
|
||||||
public string Title { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内容列表
|
|
||||||
/// </summary>
|
|
||||||
public List<string> Content { get; set; } = new List<string>();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片url
|
|
||||||
/// </summary>
|
|
||||||
public string? ImageUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开始时间(系统公告时间、活动开始时间)
|
|
||||||
/// </summary>
|
|
||||||
public DateTime StartTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 活动结束时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? EndTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告类型(系统、活动)
|
|
||||||
/// </summary>
|
|
||||||
public AnnouncementTypeEnum Type{ get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 跳转链接
|
|
||||||
/// </summary>
|
|
||||||
public string? Url { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Announcement;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告输出 DTO
|
|
||||||
/// </summary>
|
|
||||||
public class AnnouncementOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 版本号
|
|
||||||
/// </summary>
|
|
||||||
public string Version { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告日志列表
|
|
||||||
/// </summary>
|
|
||||||
public List<AnnouncementLogDto> Logs { get; set; } = new List<AnnouncementLogDto>();
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Announcement;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 更新公告输入
|
|
||||||
/// </summary>
|
|
||||||
public class AnnouncementUpdateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 公告ID
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "公告ID不能为空")]
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 标题
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "标题不能为空")]
|
|
||||||
[StringLength(200, ErrorMessage = "标题不能超过200个字符")]
|
|
||||||
public string Title { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内容列表
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "内容不能为空")]
|
|
||||||
[MinLength(1, ErrorMessage = "至少需要一条内容")]
|
|
||||||
public List<string> Content { get; set; } = new List<string>();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "备注不能超过500个字符")]
|
|
||||||
public string? Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片url
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "图片URL不能超过500个字符")]
|
|
||||||
public string? ImageUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开始时间
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "开始时间不能为空")]
|
|
||||||
public DateTime StartTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 活动结束时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? EndTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 公告类型
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "公告类型不能为空")]
|
|
||||||
public AnnouncementTypeEnum Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 跳转链接
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "跳转链接不能超过500个字符")]
|
|
||||||
public string? Url { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌任务状态输出
|
|
||||||
/// </summary>
|
|
||||||
public class CardFlipStatusOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 本周总翻牌次数
|
|
||||||
/// </summary>
|
|
||||||
public int TotalFlips { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 剩余免费次数
|
|
||||||
/// </summary>
|
|
||||||
public int RemainingFreeFlips { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 剩余赠送次数
|
|
||||||
/// </summary>
|
|
||||||
public int RemainingBonusFlips { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 剩余邀请解锁次数
|
|
||||||
/// </summary>
|
|
||||||
public int RemainingInviteFlips { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否可以翻牌
|
|
||||||
/// </summary>
|
|
||||||
public bool CanFlip { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户的邀请码
|
|
||||||
/// </summary>
|
|
||||||
public string? MyInviteCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 本周邀请人数
|
|
||||||
/// </summary>
|
|
||||||
public int InvitedCount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌记录
|
|
||||||
/// </summary>
|
|
||||||
public List<CardFlipRecord> FlipRecords { get; set; } = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 下次可翻牌提示
|
|
||||||
/// </summary>
|
|
||||||
public string? NextFlipTip { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当前用户是否已经填写过邀请码
|
|
||||||
/// </summary>
|
|
||||||
public bool IsFilledInviteCode { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌记录
|
|
||||||
/// </summary>
|
|
||||||
public class CardFlipRecord
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌序号(1-10)
|
|
||||||
/// </summary>
|
|
||||||
public int FlipNumber { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否已翻
|
|
||||||
/// </summary>
|
|
||||||
public bool IsFlipped { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否中奖
|
|
||||||
/// </summary>
|
|
||||||
public bool IsWin { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 奖励金额(token数)
|
|
||||||
/// </summary>
|
|
||||||
public long? RewardAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌类型描述
|
|
||||||
/// </summary>
|
|
||||||
public string? FlipTypeDesc { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 在翻牌顺序中的位置(1-10,表示第几个翻)
|
|
||||||
/// </summary>
|
|
||||||
public int FlipOrderIndex { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌输入
|
|
||||||
/// </summary>
|
|
||||||
public class FlipCardInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌序号(1-10)
|
|
||||||
/// </summary>
|
|
||||||
public int FlipNumber { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌输出
|
|
||||||
/// </summary>
|
|
||||||
public class FlipCardOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 翻牌序号(1-10)
|
|
||||||
/// </summary>
|
|
||||||
public int FlipNumber { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否中奖
|
|
||||||
/// </summary>
|
|
||||||
public bool IsWin { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 奖励金额(token数)
|
|
||||||
/// </summary>
|
|
||||||
public long? RewardAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 奖励描述
|
|
||||||
/// </summary>
|
|
||||||
public string? RewardDesc { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 剩余可翻次数
|
|
||||||
/// </summary>
|
|
||||||
public int RemainingFlips { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 邀请码信息输出
|
|
||||||
/// </summary>
|
|
||||||
public class InviteCodeOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 我的邀请码
|
|
||||||
/// </summary>
|
|
||||||
public string? MyInviteCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 本周邀请人数
|
|
||||||
/// </summary>
|
|
||||||
public int InvitedCount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否已被邀请
|
|
||||||
/// </summary>
|
|
||||||
public bool IsInvited { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 邀请历史记录
|
|
||||||
/// </summary>
|
|
||||||
public List<InvitationHistoryItem> InvitationHistory { get; set; } = new();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 邀请历史记录项
|
|
||||||
/// </summary>
|
|
||||||
public class InvitationHistoryItem
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 被邀请人昵称(脱敏)
|
|
||||||
/// </summary>
|
|
||||||
public string InvitedUserName { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 邀请时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime InvitationTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 本周所在
|
|
||||||
/// </summary>
|
|
||||||
public string WeekDescription { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 使用邀请码输入
|
|
||||||
/// </summary>
|
|
||||||
public class UseInviteCodeInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 邀请码
|
|
||||||
/// </summary>
|
|
||||||
public string InviteCode { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建AI应用输入
|
|
||||||
/// </summary>
|
|
||||||
public class AiAppCreateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 应用名称
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "应用名称不能为空")]
|
|
||||||
[StringLength(100, ErrorMessage = "应用名称不能超过100个字符")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用终结点
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "应用终结点不能为空")]
|
|
||||||
[StringLength(500, ErrorMessage = "应用终结点不能超过500个字符")]
|
|
||||||
public string Endpoint { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 额外URL
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "额外URL不能超过500个字符")]
|
|
||||||
public string? ExtraUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用Key
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "应用Key不能为空")]
|
|
||||||
[StringLength(500, ErrorMessage = "应用Key不能超过500个字符")]
|
|
||||||
public string ApiKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
[Range(0, int.MaxValue, ErrorMessage = "排序必须大于等于0")]
|
|
||||||
public int OrderNum { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// AI应用DTO
|
|
||||||
/// </summary>
|
|
||||||
public class AiAppDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 应用ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用终结点
|
|
||||||
/// </summary>
|
|
||||||
public string Endpoint { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 额外URL
|
|
||||||
/// </summary>
|
|
||||||
public string? ExtraUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用Key
|
|
||||||
/// </summary>
|
|
||||||
public string ApiKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
public int OrderNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取AI应用列表输入
|
|
||||||
/// </summary>
|
|
||||||
public class AiAppGetListInput : PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 搜索关键词(搜索应用名称)
|
|
||||||
/// </summary>
|
|
||||||
public string? SearchKey { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// AI应用快捷配置DTO
|
|
||||||
/// </summary>
|
|
||||||
public class AiAppShortcutDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 应用ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用终结点
|
|
||||||
/// </summary>
|
|
||||||
public string Endpoint { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 额外URL
|
|
||||||
/// </summary>
|
|
||||||
public string? ExtraUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用Key
|
|
||||||
/// </summary>
|
|
||||||
public string ApiKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
public int OrderNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 更新AI应用输入
|
|
||||||
/// </summary>
|
|
||||||
public class AiAppUpdateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 应用ID
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "应用ID不能为空")]
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用名称
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "应用名称不能为空")]
|
|
||||||
[StringLength(100, ErrorMessage = "应用名称不能超过100个字符")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用终结点
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "应用终结点不能为空")]
|
|
||||||
[StringLength(500, ErrorMessage = "应用终结点不能超过500个字符")]
|
|
||||||
public string Endpoint { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 额外URL
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "额外URL不能超过500个字符")]
|
|
||||||
public string? ExtraUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用Key
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "应用Key不能为空")]
|
|
||||||
[StringLength(500, ErrorMessage = "应用Key不能超过500个字符")]
|
|
||||||
public string ApiKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
[Range(0, int.MaxValue, ErrorMessage = "排序必须大于等于0")]
|
|
||||||
public int OrderNum { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建AI模型输入
|
|
||||||
/// </summary>
|
|
||||||
public class AiModelCreateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 处理名
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "处理名不能为空")]
|
|
||||||
[StringLength(100, ErrorMessage = "处理名不能超过100个字符")]
|
|
||||||
public string HandlerName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型ID不能为空")]
|
|
||||||
[StringLength(200, ErrorMessage = "模型ID不能超过200个字符")]
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型名称
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型名称不能为空")]
|
|
||||||
[StringLength(200, ErrorMessage = "模型名称不能超过200个字符")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型描述
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(1000, ErrorMessage = "模型描述不能超过1000个字符")]
|
|
||||||
public string? Description { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
[Range(0, int.MaxValue, ErrorMessage = "排序必须大于等于0")]
|
|
||||||
public int OrderNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// AI应用ID
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "AI应用ID不能为空")]
|
|
||||||
public Guid AiAppId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 额外信息
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(2000, ErrorMessage = "额外信息不能超过2000个字符")]
|
|
||||||
public string? ExtraInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型类型不能为空")]
|
|
||||||
public ModelTypeEnum ModelType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型API类型
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型API类型不能为空")]
|
|
||||||
public ModelApiTypeEnum ModelApiType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型倍率
|
|
||||||
/// </summary>
|
|
||||||
[Range(0.01, double.MaxValue, ErrorMessage = "模型倍率必须大于0")]
|
|
||||||
public decimal Multiplier { get; set; } = 1;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型显示倍率
|
|
||||||
/// </summary>
|
|
||||||
[Range(0.01, double.MaxValue, ErrorMessage = "模型显示倍率必须大于0")]
|
|
||||||
public decimal MultiplierShow { get; set; } = 1;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 供应商分组名称
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(100, ErrorMessage = "供应商分组名称不能超过100个字符")]
|
|
||||||
public string? ProviderName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型图标URL
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "模型图标URL不能超过500个字符")]
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否为尊享模型
|
|
||||||
/// </summary>
|
|
||||||
public bool IsPremium { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool IsEnabled { get; set; } = true;
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// AI模型DTO
|
|
||||||
/// </summary>
|
|
||||||
public class AiModelDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 处理名
|
|
||||||
/// </summary>
|
|
||||||
public string HandlerName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型描述
|
|
||||||
/// </summary>
|
|
||||||
public string? Description { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
public int OrderNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// AI应用ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid AiAppId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 额外信息
|
|
||||||
/// </summary>
|
|
||||||
public string? ExtraInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型
|
|
||||||
/// </summary>
|
|
||||||
public ModelTypeEnum ModelType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型API类型
|
|
||||||
/// </summary>
|
|
||||||
public ModelApiTypeEnum ModelApiType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型倍率
|
|
||||||
/// </summary>
|
|
||||||
public decimal Multiplier { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型显示倍率
|
|
||||||
/// </summary>
|
|
||||||
public decimal MultiplierShow { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 供应商分组名称
|
|
||||||
/// </summary>
|
|
||||||
public string? ProviderName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型图标URL
|
|
||||||
/// </summary>
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否为尊享模型
|
|
||||||
/// </summary>
|
|
||||||
public bool IsPremium { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool IsEnabled { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取AI模型列表输入
|
|
||||||
/// </summary>
|
|
||||||
public class AiModelGetListInput : PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 搜索关键词(搜索模型名称、模型ID)
|
|
||||||
/// </summary>
|
|
||||||
public string? SearchKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// AI应用ID筛选
|
|
||||||
/// </summary>
|
|
||||||
public Guid? AiAppId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否只显示尊享模型
|
|
||||||
/// </summary>
|
|
||||||
public bool? IsPremiumOnly { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Channel;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 更新AI模型输入
|
|
||||||
/// </summary>
|
|
||||||
public class AiModelUpdateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型ID不能为空")]
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 处理名
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "处理名不能为空")]
|
|
||||||
[StringLength(100, ErrorMessage = "处理名不能超过100个字符")]
|
|
||||||
public string HandlerName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型ID不能为空")]
|
|
||||||
[StringLength(200, ErrorMessage = "模型ID不能超过200个字符")]
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型名称
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型名称不能为空")]
|
|
||||||
[StringLength(200, ErrorMessage = "模型名称不能超过200个字符")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型描述
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(1000, ErrorMessage = "模型描述不能超过1000个字符")]
|
|
||||||
public string? Description { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
[Range(0, int.MaxValue, ErrorMessage = "排序必须大于等于0")]
|
|
||||||
public int OrderNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// AI应用ID
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "AI应用ID不能为空")]
|
|
||||||
public Guid AiAppId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 额外信息
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(2000, ErrorMessage = "额外信息不能超过2000个字符")]
|
|
||||||
public string? ExtraInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型类型不能为空")]
|
|
||||||
public ModelTypeEnum ModelType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型API类型
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "模型API类型不能为空")]
|
|
||||||
public ModelApiTypeEnum ModelApiType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型倍率
|
|
||||||
/// </summary>
|
|
||||||
[Range(0.01, double.MaxValue, ErrorMessage = "模型倍率必须大于0")]
|
|
||||||
public decimal Multiplier { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型显示倍率
|
|
||||||
/// </summary>
|
|
||||||
[Range(0.01, double.MaxValue, ErrorMessage = "模型显示倍率必须大于0")]
|
|
||||||
public decimal MultiplierShow { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 供应商分组名称
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(100, ErrorMessage = "供应商分组名称不能超过100个字符")]
|
|
||||||
public string? ProviderName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型图标URL
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(500, ErrorMessage = "模型图标URL不能超过500个字符")]
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否为尊享模型
|
|
||||||
/// </summary>
|
|
||||||
public bool IsPremium { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool IsEnabled { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
public class AgentResultOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 类型
|
|
||||||
/// </summary>
|
|
||||||
[JsonIgnore]
|
|
||||||
public AgentResultTypeEnum TypeEnum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 类型
|
|
||||||
/// </summary>
|
|
||||||
public string Type => TypeEnum.GetJsonName();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内容载体
|
|
||||||
/// </summary>
|
|
||||||
public object Content { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum AgentResultTypeEnum
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 文本内容
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("text")]
|
|
||||||
Text,
|
|
||||||
/// <summary>
|
|
||||||
/// 工具调用中
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("toolCalling")]
|
|
||||||
ToolCalling,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 工具调用完成
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("toolCalled")]
|
|
||||||
ToolCalled,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用量
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("usage")]
|
|
||||||
Usage,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 工具调用用量
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("toolCallUsage")]
|
|
||||||
ToolCallUsage
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class AgentResultTypeEnumExtensions
|
|
||||||
{
|
|
||||||
public static string GetJsonName(this AgentResultTypeEnum value)
|
|
||||||
{
|
|
||||||
var member = typeof(AgentResultTypeEnum).GetMember(value.ToString()).FirstOrDefault();
|
|
||||||
var attr = member?.GetCustomAttribute<JsonPropertyNameAttribute>();
|
|
||||||
return attr?.Name ?? value.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
public class AgentSendInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 会话id
|
|
||||||
/// </summary>
|
|
||||||
public Guid SessionId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户内容
|
|
||||||
/// </summary>
|
|
||||||
public string Content { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// api密钥Id
|
|
||||||
/// </summary>
|
|
||||||
public Guid TokenId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型id
|
|
||||||
/// </summary>
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 已选择工具
|
|
||||||
/// </summary>
|
|
||||||
public List<string> Tools { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
public class AgentToolOutput
|
|
||||||
{
|
|
||||||
public string Code { get; set; }
|
|
||||||
|
|
||||||
public string Name { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片生成输入
|
|
||||||
/// </summary>
|
|
||||||
public class ImageGenerationInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 密钥id
|
|
||||||
/// </summary>
|
|
||||||
public Guid? TokenId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提示词
|
|
||||||
/// </summary>
|
|
||||||
public string Prompt { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public string ModelId { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 参考图PrefixBase64列表(可选,包含前缀如 data:image/png;base64,...)
|
|
||||||
/// </summary>
|
|
||||||
public List<string>? ReferenceImagesPrefixBase64 { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
using Volo.Abp.Application.Dtos;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片任务分页查询输入
|
|
||||||
/// </summary>
|
|
||||||
public class ImageMyTaskPageInput: PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 提示词
|
|
||||||
/// </summary>
|
|
||||||
public string? Prompt { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务状态筛选(可选)
|
|
||||||
/// </summary>
|
|
||||||
public TaskStatusEnum? TaskStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 发布状态
|
|
||||||
/// </summary>
|
|
||||||
public PublishStatusEnum? PublishStatus { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
using Volo.Abp.Application.Dtos;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片任务分页查询输入
|
|
||||||
/// </summary>
|
|
||||||
public class ImagePlazaPageInput: PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 分类
|
|
||||||
/// </summary>
|
|
||||||
public string? Categories { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提示词
|
|
||||||
/// </summary>
|
|
||||||
public string? Prompt { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务状态筛选(可选)
|
|
||||||
/// </summary>
|
|
||||||
public TaskStatusEnum? TaskStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户名
|
|
||||||
/// </summary>
|
|
||||||
public string? UserName{ get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片任务输出
|
|
||||||
/// </summary>
|
|
||||||
public class ImageTaskOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 任务ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提示词
|
|
||||||
/// </summary>
|
|
||||||
public string Prompt { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否匿名
|
|
||||||
/// </summary>
|
|
||||||
public bool IsAnonymous { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生成图片URL
|
|
||||||
/// </summary>
|
|
||||||
public string? StoreUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务状态
|
|
||||||
/// </summary>
|
|
||||||
public TaskStatusEnum TaskStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 发布状态
|
|
||||||
/// </summary>
|
|
||||||
public PublishStatusEnum PublishStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分类标签
|
|
||||||
/// </summary>
|
|
||||||
[SqlSugar.SugarColumn( IsJson = true)]
|
|
||||||
public List<string> Categories { get; set; } = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 错误信息
|
|
||||||
/// </summary>
|
|
||||||
public string? ErrorInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户名称
|
|
||||||
/// </summary>
|
|
||||||
public string? UserName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户名称Id
|
|
||||||
/// </summary>
|
|
||||||
public Guid? UserId { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 消息创建结果输出
|
|
||||||
/// </summary>
|
|
||||||
public class MessageCreatedOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 消息类型
|
|
||||||
/// </summary>
|
|
||||||
[JsonIgnore]
|
|
||||||
public ChatMessageTypeEnum TypeEnum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 消息类型
|
|
||||||
/// </summary>
|
|
||||||
public string Type => TypeEnum.ToString();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 消息ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid MessageId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 消息创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 消息类型枚举
|
|
||||||
/// </summary>
|
|
||||||
public enum ChatMessageTypeEnum
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 用户消息
|
|
||||||
/// </summary>
|
|
||||||
UserMessage,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 系统消息
|
|
||||||
/// </summary>
|
|
||||||
SystemMessage
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Chat;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 发布图片输入
|
|
||||||
/// </summary>
|
|
||||||
public class PublishImageInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 是否匿名
|
|
||||||
/// </summary>
|
|
||||||
public bool IsAnonymous { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid TaskId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分类标签
|
|
||||||
/// </summary>
|
|
||||||
public List<string> Categories { get; set; } = new();
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.DailyTask;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 领取任务奖励输入
|
|
||||||
/// </summary>
|
|
||||||
public class ClaimTaskRewardInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 任务等级(1=1000w任务,2=3000w任务)
|
|
||||||
/// </summary>
|
|
||||||
public int TaskLevel { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.DailyTask;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 每日任务配置缓存DTO
|
|
||||||
/// </summary>
|
|
||||||
public class DailyTaskConfigCacheDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 任务配置列表
|
|
||||||
/// </summary>
|
|
||||||
public List<DailyTaskConfigItem> Tasks { get; set; } = new();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 每日任务配置项
|
|
||||||
/// </summary>
|
|
||||||
public class DailyTaskConfigItem
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 任务等级
|
|
||||||
/// </summary>
|
|
||||||
public int Level { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 需要消耗的Token数量
|
|
||||||
/// </summary>
|
|
||||||
public long RequiredTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 奖励的Token数量
|
|
||||||
/// </summary>
|
|
||||||
public long RewardTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务描述
|
|
||||||
/// </summary>
|
|
||||||
public string Description { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.DailyTask;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 每日任务状态输出
|
|
||||||
/// </summary>
|
|
||||||
public class DailyTaskStatusOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 今日消耗的尊享包Token数
|
|
||||||
/// </summary>
|
|
||||||
public long TodayConsumedTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务列表
|
|
||||||
/// </summary>
|
|
||||||
public List<DailyTaskItem> Tasks { get; set; } = new();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 每日任务项
|
|
||||||
/// </summary>
|
|
||||||
public class DailyTaskItem
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 任务等级(1=1000w任务,2=3000w任务)
|
|
||||||
/// </summary>
|
|
||||||
public int Level { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务描述
|
|
||||||
/// </summary>
|
|
||||||
public string Description { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务要求的Token消耗量
|
|
||||||
/// </summary>
|
|
||||||
public long RequiredTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 奖励的Token数量
|
|
||||||
/// </summary>
|
|
||||||
public long RewardTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务状态:0=未完成,1=可领取,2=已领取
|
|
||||||
/// </summary>
|
|
||||||
public int Status { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务进度百分比(0-100)
|
|
||||||
/// </summary>
|
|
||||||
public decimal Progress { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.FileMaster;
|
|
||||||
|
|
||||||
public class VerifyNextInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 文件数
|
|
||||||
/// </summary>
|
|
||||||
public int FileCount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 文件夹数
|
|
||||||
/// </summary>
|
|
||||||
public int DirectoryCount { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Fuwuhao;
|
|
||||||
|
|
||||||
public class QrCodeOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Qrcode url
|
|
||||||
/// </summary>
|
|
||||||
public string QrCodeUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 场景值
|
|
||||||
/// </summary>
|
|
||||||
public string Scene { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums.Fuwuhao;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Fuwuhao;
|
|
||||||
|
|
||||||
public class QrCodeResultOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 返回状态
|
|
||||||
/// </summary>
|
|
||||||
public SceneResultEnum SceneResult { get; set; } = SceneResultEnum.Wait;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 如果是已登录,返回token
|
|
||||||
/// </summary>
|
|
||||||
public string? Token { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 刷新token
|
|
||||||
/// </summary>
|
|
||||||
public string? RefreshToken { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums.Fuwuhao;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Fuwuhao;
|
|
||||||
|
|
||||||
public class SceneCacheDto
|
|
||||||
{
|
|
||||||
public SceneResultEnum SceneResult { get; set; } = SceneResultEnum.Wait;
|
|
||||||
|
|
||||||
public SceneTypeEnum SceneType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 如果是绑定类型,需要用户id
|
|
||||||
/// </summary>
|
|
||||||
public Guid? UserId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using Volo.Abp.Application.Dtos;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class MessageDto : FullAuditedEntityDto<Guid>
|
|
||||||
{
|
|
||||||
public Guid UserId { get; set; }
|
|
||||||
public Guid SessionId { get; set; }
|
|
||||||
public string Content { get; set; }
|
|
||||||
public string Role { get; set; }
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
public string Remark { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class MessageGetListInput:PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
[Required]
|
|
||||||
public Guid SessionId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class MessageDeleteInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 要删除的消息Id列表
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public List<Guid> Ids { get; set; } = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否同时隐藏后续消息(同一会话中时间大于当前消息的所有消息)
|
|
||||||
/// </summary>
|
|
||||||
public bool IsDeleteSubsequent { get; set; } = false;
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Model;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// API类型选项
|
|
||||||
/// </summary>
|
|
||||||
public class ModelApiTypeOption
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 显示名称
|
|
||||||
/// </summary>
|
|
||||||
public string Label { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 枚举值
|
|
||||||
/// </summary>
|
|
||||||
public int Value { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Extensions;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Model;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型库展示数据
|
|
||||||
/// </summary>
|
|
||||||
public class ModelLibraryDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型描述
|
|
||||||
/// </summary>
|
|
||||||
public string? Description { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型
|
|
||||||
/// </summary>
|
|
||||||
public ModelTypeEnum ModelType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型名称
|
|
||||||
/// </summary>
|
|
||||||
public string ModelTypeName => ModelType.GetDescription();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型支持的API类型
|
|
||||||
/// </summary>
|
|
||||||
public List<ModelApiTypeOutput> ModelApiTypes { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型显示倍率
|
|
||||||
/// </summary>
|
|
||||||
public decimal MultiplierShow { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 供应商分组名称
|
|
||||||
/// </summary>
|
|
||||||
public string? ProviderName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型图标URL
|
|
||||||
/// </summary>
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否为尊享模型(PremiumChat类型)
|
|
||||||
/// </summary>
|
|
||||||
public bool IsPremium { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
public int OrderNum { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ModelApiTypeOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型
|
|
||||||
/// </summary>
|
|
||||||
public ModelApiTypeEnum ModelApiType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型名称
|
|
||||||
/// </summary>
|
|
||||||
public string ModelApiTypeName => ModelApiType.GetDescription();
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Model;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取模型库列表查询参数
|
|
||||||
/// </summary>
|
|
||||||
public class ModelLibraryGetListInput : PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 搜索关键词(搜索模型名称、模型ID)
|
|
||||||
/// </summary>
|
|
||||||
public string? SearchKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 供应商名称筛选
|
|
||||||
/// </summary>
|
|
||||||
public List<string>? ProviderNames { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型筛选
|
|
||||||
/// </summary>
|
|
||||||
public List<ModelTypeEnum>? ModelTypes { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// API类型筛选
|
|
||||||
/// </summary>
|
|
||||||
public List<ModelApiTypeEnum>? ModelApiTypes { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否只显示尊享模型
|
|
||||||
/// </summary>
|
|
||||||
public bool? IsPremiumOnly { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Model;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型类型选项
|
|
||||||
/// </summary>
|
|
||||||
public class ModelTypeOption
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 显示名称
|
|
||||||
/// </summary>
|
|
||||||
public string Label { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 枚举值
|
|
||||||
/// </summary>
|
|
||||||
public int Value { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class ModelGetListOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型id
|
|
||||||
/// </summary>
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型名称
|
|
||||||
/// </summary>
|
|
||||||
public string ModelName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型描述
|
|
||||||
/// </summary>
|
|
||||||
public string? ModelDescribe { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注信息
|
|
||||||
/// </summary>
|
|
||||||
public string? Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否为尊享包
|
|
||||||
/// </summary>
|
|
||||||
public bool IsPremiumPackage { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否免费模型
|
|
||||||
/// </summary>
|
|
||||||
public bool IsFree { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型Api类型,现支持同一个模型id,多种接口格式
|
|
||||||
/// </summary>
|
|
||||||
public ModelApiTypeEnum ModelApiType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型图标URL
|
|
||||||
/// </summary>
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 供应商分组名称(如:OpenAI、Anthropic、Google等)
|
|
||||||
/// </summary>
|
|
||||||
public string? ProviderName { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Pay;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建订单输入DTO
|
|
||||||
/// </summary>
|
|
||||||
public class CreateOrderInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 商品类型
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public GoodsTypeEnum GoodsType { get; set; }
|
|
||||||
|
|
||||||
public string? ReturnUrl{ get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Pay;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建订单输出DTO
|
|
||||||
/// </summary>
|
|
||||||
public class CreateOrderOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 订单ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid OrderId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商家订单号
|
|
||||||
/// </summary>
|
|
||||||
public string OutTradeNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 支付页面HTML内容
|
|
||||||
/// </summary>
|
|
||||||
public object PaymentPageHtml { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Pay;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取商品列表输入DTO
|
|
||||||
/// </summary>
|
|
||||||
public class GetGoodsListInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 商品类别(可选)
|
|
||||||
/// 如果不传,则返回所有商品
|
|
||||||
/// 如果传了,则只返回指定类别的商品(VIP服务或尊享包)
|
|
||||||
/// </summary>
|
|
||||||
public GoodsCategoryType? GoodsCategoryType { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Pay;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品列表输出DTO
|
|
||||||
/// </summary>
|
|
||||||
public class GoodsListOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 商品名称
|
|
||||||
/// </summary>
|
|
||||||
public string GoodsName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品原价
|
|
||||||
/// </summary>
|
|
||||||
public decimal OriginalPrice { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品参考价格
|
|
||||||
/// </summary>
|
|
||||||
public decimal ReferencePrice { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品实际价格(折扣后的价格)
|
|
||||||
/// </summary>
|
|
||||||
public decimal GoodsPrice { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 折扣金额(仅尊享包)
|
|
||||||
/// </summary>
|
|
||||||
public decimal? DiscountAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品类别
|
|
||||||
/// </summary>
|
|
||||||
public string GoodsCategory { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品备注
|
|
||||||
/// </summary>
|
|
||||||
public string Remark { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 折扣说明(仅尊享包)
|
|
||||||
/// </summary>
|
|
||||||
public string? DiscountDescription { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品类型
|
|
||||||
/// </summary>
|
|
||||||
public GoodsTypeEnum GoodsType { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Pay;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查询订单状态输入DTO
|
|
||||||
/// </summary>
|
|
||||||
public class QueryOrderStatusInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 商家订单号
|
|
||||||
/// </summary>
|
|
||||||
public string OutTradeNo { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Pay;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查询订单状态输出DTO
|
|
||||||
/// </summary>
|
|
||||||
public class QueryOrderStatusOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 订单ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid OrderId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商家订单号
|
|
||||||
/// </summary>
|
|
||||||
public string OutTradeNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 支付宝交易号
|
|
||||||
/// </summary>
|
|
||||||
public string? TradeNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 交易状态
|
|
||||||
/// </summary>
|
|
||||||
public TradeStatusEnum TradeStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 交易状态描述
|
|
||||||
/// </summary>
|
|
||||||
public string TradeStatusDescription { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单金额
|
|
||||||
/// </summary>
|
|
||||||
public decimal TotalAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品名称
|
|
||||||
/// </summary>
|
|
||||||
public string GoodsName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 商品类型
|
|
||||||
/// </summary>
|
|
||||||
public GoodsTypeEnum GoodsType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 最后修改时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? LastModificationTime { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排行榜查询输入
|
|
||||||
/// </summary>
|
|
||||||
public class RankingGetListInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 排行榜类型:0-模型,1-工具,不传返回全部
|
|
||||||
/// </summary>
|
|
||||||
public RankingTypeEnum? Type { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排行榜项DTO
|
|
||||||
/// </summary>
|
|
||||||
public class RankingItemDto
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; } = null!;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 描述
|
|
||||||
/// </summary>
|
|
||||||
public string Description { get; set; } = null!;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Logo地址
|
|
||||||
/// </summary>
|
|
||||||
public string? LogoUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 得分
|
|
||||||
/// </summary>
|
|
||||||
public decimal Score { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提供者
|
|
||||||
/// </summary>
|
|
||||||
public string Provider { get; set; } = null!;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排行榜类型
|
|
||||||
/// </summary>
|
|
||||||
public RankingTypeEnum Type { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Recharge;
|
|
||||||
|
|
||||||
public class RechargeCreateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 用户ID
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public Guid UserId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 充值金额
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
[Range(0.01, double.MaxValue, ErrorMessage = "充值金额必须大于0")]
|
|
||||||
public decimal RechargeAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 充值内容
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
[StringLength(500, ErrorMessage = "充值内容不能超过500个字符")]
|
|
||||||
public string Content { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// VIP月数(为空或0表示永久VIP,1个月按31天计算)
|
|
||||||
/// </summary>
|
|
||||||
[Range(0, int.MaxValue, ErrorMessage = "月数必须大于等于0")]
|
|
||||||
public int? Months { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// VIP天数(为空或0表示不使用天数充值)
|
|
||||||
/// </summary>
|
|
||||||
[Range(0, int.MaxValue, ErrorMessage = "天数必须大于等于0")]
|
|
||||||
public int? Days { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(1000, ErrorMessage = "备注不能超过1000个字符")]
|
|
||||||
public string? Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 联系方式
|
|
||||||
/// </summary>
|
|
||||||
[StringLength(200, ErrorMessage = "联系方式不能超过200个字符")]
|
|
||||||
public string? ContactInfo { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Recharge;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 充值记录查询输入
|
|
||||||
/// </summary>
|
|
||||||
public class RechargeGetListInput : PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 是否免费(充值金额等于0)
|
|
||||||
/// </summary>
|
|
||||||
public bool? IsFree { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 充值金额最小值
|
|
||||||
/// </summary>
|
|
||||||
public decimal? MinRechargeAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 充值金额最大值
|
|
||||||
/// </summary>
|
|
||||||
public decimal? MaxRechargeAmount { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Recharge;
|
|
||||||
|
|
||||||
public class RechargeGetListOutput
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 充值金额
|
|
||||||
/// </summary>
|
|
||||||
public decimal RechargeAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户
|
|
||||||
/// </summary>
|
|
||||||
public Guid UserId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
public string? Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 充值内容
|
|
||||||
/// </summary>
|
|
||||||
public string Content { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 到期时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ExpireDateTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 联系方式
|
|
||||||
/// </summary>
|
|
||||||
public string? ContactInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class SendMessageInput
|
|
||||||
{
|
|
||||||
public List<Message> Messages { get; set; }
|
|
||||||
public string Model { get; set; }
|
|
||||||
|
|
||||||
public Guid? SessionId{ get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Message
|
|
||||||
{
|
|
||||||
public string Role { get; set; }
|
|
||||||
public string Content { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class SendMessageStreamOutputDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 唯一标识符
|
|
||||||
/// </summary>
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 对象类型
|
|
||||||
/// </summary>
|
|
||||||
public string Object { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间,Unix时间戳格式
|
|
||||||
/// </summary>
|
|
||||||
public long Created { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型名称
|
|
||||||
/// </summary>
|
|
||||||
public string Model { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 选择项列表
|
|
||||||
/// </summary>
|
|
||||||
public List<Choice> Choices { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 系统指纹(可能为空)
|
|
||||||
/// </summary>
|
|
||||||
public string SystemFingerprint { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 使用情况信息
|
|
||||||
/// </summary>
|
|
||||||
public Usage Usage { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 选择项类,表示模型返回的一个选择
|
|
||||||
/// </summary>
|
|
||||||
public class Choice
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 选择索引
|
|
||||||
/// </summary>
|
|
||||||
public int Index { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 变化内容,包括内容字符串和角色
|
|
||||||
/// </summary>
|
|
||||||
public Delta Delta { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 结束原因,可能为空
|
|
||||||
/// </summary>
|
|
||||||
public string? FinishReason { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内容过滤结果
|
|
||||||
/// </summary>
|
|
||||||
public ContentFilterResults ContentFilterResults { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 变化内容
|
|
||||||
/// </summary>
|
|
||||||
public class Delta
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 内容文本
|
|
||||||
/// </summary>
|
|
||||||
public string Content { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 角色,例如"assistant"
|
|
||||||
/// </summary>
|
|
||||||
public string Role { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内容过滤结果
|
|
||||||
/// </summary>
|
|
||||||
public class ContentFilterResults
|
|
||||||
{
|
|
||||||
public FilterStatus Hate { get; set; }
|
|
||||||
public FilterStatus SelfHarm { get; set; }
|
|
||||||
public FilterStatus Sexual { get; set; }
|
|
||||||
public FilterStatus Violence { get; set; }
|
|
||||||
public FilterStatus Jailbreak { get; set; }
|
|
||||||
public FilterStatus Profanity { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 过滤状态,表示是否经过过滤以及检测是否命中
|
|
||||||
/// </summary>
|
|
||||||
public class FilterStatus
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 是否被过滤
|
|
||||||
/// </summary>
|
|
||||||
public bool Filtered { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否检测到该类型(例如 Jailbreak 中存在此字段)
|
|
||||||
/// </summary>
|
|
||||||
public bool? Detected { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 使用情况,记录 token 数量等信息
|
|
||||||
/// </summary>
|
|
||||||
public class Usage
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 提示词数量
|
|
||||||
/// </summary>
|
|
||||||
public int PromptTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 补全词数量
|
|
||||||
/// </summary>
|
|
||||||
public int CompletionTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总的 Token 数量
|
|
||||||
/// </summary>
|
|
||||||
public int TotalTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提示词详细信息
|
|
||||||
/// </summary>
|
|
||||||
public PromptTokensDetails PromptTokensDetails { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 补全文字详细信息
|
|
||||||
/// </summary>
|
|
||||||
public CompletionTokensDetails CompletionTokensDetails { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提示词相关 token 详细信息
|
|
||||||
/// </summary>
|
|
||||||
public class PromptTokensDetails
|
|
||||||
{
|
|
||||||
public int AudioTokens { get; set; }
|
|
||||||
public int CachedTokens { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 补全相关 token 详细信息
|
|
||||||
/// </summary>
|
|
||||||
public class CompletionTokensDetails
|
|
||||||
{
|
|
||||||
public int AudioTokens { get; set; }
|
|
||||||
|
|
||||||
public int ReasoningTokens { get; set; }
|
|
||||||
|
|
||||||
public int AcceptedPredictionTokens { get; set; }
|
|
||||||
|
|
||||||
public int RejectedPredictionTokens { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class SessionCreateAndUpdateInput
|
|
||||||
{
|
|
||||||
public string SessionTitle { get; set; }
|
|
||||||
public string SessionContent { get; set; }
|
|
||||||
public string? Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 会话类型
|
|
||||||
/// </summary>
|
|
||||||
public SessionTypeEnum SessionType { get; set; } = SessionTypeEnum.Chat;
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using Volo.Abp.Application.Dtos;
|
|
||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class SessionDto : FullAuditedEntityDto<Guid>
|
|
||||||
{
|
|
||||||
public string SessionTitle { get; set; }
|
|
||||||
public string SessionContent { get; set; }
|
|
||||||
public string Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 会话类型
|
|
||||||
/// </summary>
|
|
||||||
public SessionTypeEnum SessionType { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using Yi.Framework.AiHub.Domain.Shared.Enums;
|
|
||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos;
|
|
||||||
|
|
||||||
public class SessionGetListInput : PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
public string? SessionTitle { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 会话类型
|
|
||||||
/// </summary>
|
|
||||||
public SessionTypeEnum? SessionType { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.SystemStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型Token统计DTO
|
|
||||||
/// </summary>
|
|
||||||
public class ModelTokenStatisticsDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型名称
|
|
||||||
/// </summary>
|
|
||||||
public string ModelName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token消耗量
|
|
||||||
/// </summary>
|
|
||||||
public long Tokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token消耗量(万)
|
|
||||||
/// </summary>
|
|
||||||
public decimal TokensInWan { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 使用次数
|
|
||||||
/// </summary>
|
|
||||||
public long Count { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 成本(RMB)
|
|
||||||
/// </summary>
|
|
||||||
public decimal Cost { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 1亿Token成本(RMB)
|
|
||||||
/// </summary>
|
|
||||||
public decimal CostPerHundredMillion { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.SystemStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 利润统计输入
|
|
||||||
/// </summary>
|
|
||||||
public class ProfitStatisticsInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 当前成本(RMB)
|
|
||||||
/// </summary>
|
|
||||||
public decimal CurrentCost { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.SystemStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 利润统计输出
|
|
||||||
/// </summary>
|
|
||||||
public class ProfitStatisticsOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 日期
|
|
||||||
/// </summary>
|
|
||||||
public string Date { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包已消耗Token数(单位:个)
|
|
||||||
/// </summary>
|
|
||||||
public long TotalUsedTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包已消耗Token数(单位:亿)
|
|
||||||
/// </summary>
|
|
||||||
public decimal TotalUsedTokensInHundredMillion { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包剩余库存Token数(单位:个)
|
|
||||||
/// </summary>
|
|
||||||
public long TotalRemainingTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包剩余库存Token数(单位:亿)
|
|
||||||
/// </summary>
|
|
||||||
public decimal TotalRemainingTokensInHundredMillion { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当前成本(RMB)
|
|
||||||
/// </summary>
|
|
||||||
public decimal CurrentCost { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 1亿Token成本(RMB)
|
|
||||||
/// </summary>
|
|
||||||
public decimal CostPerHundredMillion { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总成本(RMB)
|
|
||||||
/// </summary>
|
|
||||||
public decimal TotalCost { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总收益(RMB)
|
|
||||||
/// </summary>
|
|
||||||
public decimal TotalRevenue { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 利润率(%)
|
|
||||||
/// </summary>
|
|
||||||
public decimal ProfitRate { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 按200售价计算的成本(RMB)
|
|
||||||
/// </summary>
|
|
||||||
public decimal CostAt200Price { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.SystemStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token统计输入
|
|
||||||
/// </summary>
|
|
||||||
public class TokenStatisticsInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 指定日期(当天零点)
|
|
||||||
/// </summary>
|
|
||||||
public DateTime Date { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.SystemStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token统计输出
|
|
||||||
/// </summary>
|
|
||||||
public class TokenStatisticsOutput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 日期
|
|
||||||
/// </summary>
|
|
||||||
public string Date { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型统计列表
|
|
||||||
/// </summary>
|
|
||||||
public List<ModelTokenStatisticsDto> ModelStatistics { get; set; } = new();
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Token;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建Token输入
|
|
||||||
/// </summary>
|
|
||||||
public class TokenCreateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 名称(同一用户不能重复)
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "名称不能为空")]
|
|
||||||
[StringLength(100, ErrorMessage = "名称长度不能超过100个字符")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 过期时间(空为永不过期)
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ExpireTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包额度限制(空为不限制)
|
|
||||||
/// </summary>
|
|
||||||
public long? PremiumQuotaLimit { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Token;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token列表输出
|
|
||||||
/// </summary>
|
|
||||||
public class TokenGetListOutputDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Token Id
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token密钥
|
|
||||||
/// </summary>
|
|
||||||
public string ApiKey { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 过期时间(空为永不过期)
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ExpireTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包额度限制(空为不限制)
|
|
||||||
/// </summary>
|
|
||||||
public long? PremiumQuotaLimit { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包已使用额度
|
|
||||||
/// </summary>
|
|
||||||
public long PremiumUsedQuota { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否禁用
|
|
||||||
/// </summary>
|
|
||||||
public bool IsDisabled { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Token;
|
|
||||||
|
|
||||||
public class TokenOutput
|
|
||||||
{
|
|
||||||
public string? ApiKey { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Token;
|
|
||||||
|
|
||||||
public class TokenSelectListOutputDto
|
|
||||||
{
|
|
||||||
public Guid TokenId { get; set; }
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
public bool IsDisabled { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Token;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 编辑Token输入
|
|
||||||
/// </summary>
|
|
||||||
public class TokenUpdateInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Token Id
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "Id不能为空")]
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 名称(同一用户不能重复)
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "名称不能为空")]
|
|
||||||
[StringLength(100, ErrorMessage = "名称长度不能超过100个字符")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 过期时间(空为永不过期)
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ExpireTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包额度限制(空为不限制)
|
|
||||||
/// </summary>
|
|
||||||
public long? PremiumQuotaLimit { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 每日Token使用量统计DTO
|
|
||||||
/// </summary>
|
|
||||||
public class DailyTokenUsageDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 日期
|
|
||||||
/// </summary>
|
|
||||||
public DateTime Date { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token消耗量
|
|
||||||
/// </summary>
|
|
||||||
public long Tokens { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 每小时Token使用量统计DTO(柱状图)
|
|
||||||
/// </summary>
|
|
||||||
public class HourlyTokenUsageDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 小时时间点
|
|
||||||
/// </summary>
|
|
||||||
public DateTime Hour { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 该小时总Token消耗量
|
|
||||||
/// </summary>
|
|
||||||
public long TotalTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 各模型Token消耗明细
|
|
||||||
/// </summary>
|
|
||||||
public List<ModelTokenBreakdownDto> ModelBreakdown { get; set; } = new();
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型今日使用量统计DTO(卡片列表)
|
|
||||||
/// </summary>
|
|
||||||
public class ModelTodayUsageDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 今日使用次数
|
|
||||||
/// </summary>
|
|
||||||
public int UsageCount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 今日消耗总Token数
|
|
||||||
/// </summary>
|
|
||||||
public long TotalTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型图标URL
|
|
||||||
/// </summary>
|
|
||||||
public string? IconUrl { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型Token堆叠数据DTO(用于柱状图)
|
|
||||||
/// </summary>
|
|
||||||
public class ModelTokenBreakdownDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public string ModelId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token消耗量
|
|
||||||
/// </summary>
|
|
||||||
public long Tokens { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模型Token使用量统计DTO
|
|
||||||
/// </summary>
|
|
||||||
public class ModelTokenUsageDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型ID
|
|
||||||
/// </summary>
|
|
||||||
public string Model { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总消耗量
|
|
||||||
/// </summary>
|
|
||||||
public long Tokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 占比(百分比)
|
|
||||||
/// </summary>
|
|
||||||
public decimal Percentage { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享服务Token用量统计DTO
|
|
||||||
/// </summary>
|
|
||||||
public class PremiumTokenUsageDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 总Token数
|
|
||||||
/// </summary>
|
|
||||||
public long PremiumTotalTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 已使用Token数
|
|
||||||
/// </summary>
|
|
||||||
public long PremiumUsedTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 剩余Token数
|
|
||||||
/// </summary>
|
|
||||||
public long PremiumRemainingTokens { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Volo.Abp.Application.Dtos;
|
|
||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
public class PremiumTokenUsageGetListInput : PagedAllResultRequestDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 是否免费
|
|
||||||
/// </summary>
|
|
||||||
public bool? IsFree { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
using Volo.Abp.Application.Dtos;
|
|
||||||
using Yi.Framework.Ddd.Application.Contracts;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
public class PremiumTokenUsageGetListOutput : CreationAuditedEntityDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// id
|
|
||||||
/// </summary>
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户ID
|
|
||||||
/// </summary>
|
|
||||||
public Guid UserId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 包名称
|
|
||||||
/// </summary>
|
|
||||||
public string PackageName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总用量(总token数)
|
|
||||||
/// </summary>
|
|
||||||
public long TotalTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 剩余用量(剩余token数)
|
|
||||||
/// </summary>
|
|
||||||
public long RemainingTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 已使用token数
|
|
||||||
/// </summary>
|
|
||||||
public long UsedTokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 到期时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ExpireDateTime { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否激活
|
|
||||||
/// </summary>
|
|
||||||
public bool IsActive { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 购买金额
|
|
||||||
/// </summary>
|
|
||||||
public decimal PurchaseAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
public string? Remark { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 尊享包不同Token用量占比DTO(饼图)
|
|
||||||
/// </summary>
|
|
||||||
public class TokenPremiumUsageDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Token Id
|
|
||||||
/// </summary>
|
|
||||||
public Guid TokenId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token名称
|
|
||||||
/// </summary>
|
|
||||||
public string TokenName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token消耗量
|
|
||||||
/// </summary>
|
|
||||||
public long Tokens { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 占比(百分比)
|
|
||||||
/// </summary>
|
|
||||||
public decimal Percentage { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.UsageStatistics;
|
|
||||||
|
|
||||||
public class UsageStatisticsGetInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// tokenId
|
|
||||||
/// </summary>
|
|
||||||
public Guid? TokenId { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using Volo.Abp.Application.Services;
|
|
||||||
using Yi.Framework.AiHub.Application.Contracts.Dtos.ActivationCode;
|
|
||||||
|
|
||||||
namespace Yi.Framework.AiHub.Application.Contracts.IServices;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 激活码服务接口
|
|
||||||
/// </summary>
|
|
||||||
public interface IActivationCodeService : IApplicationService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 批量生成激活码
|
|
||||||
/// </summary>
|
|
||||||
Task<ActivationCodeCreateListOutput> CreateBatchAsync(ActivationCodeCreateListInput input);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 兑换激活码
|
|
||||||
/// </summary>
|
|
||||||
Task<ActivationCodeRedeemOutput> RedeemAsync(ActivationCodeRedeemInput input);
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user