Commit 88fb5d25 authored by 文旺-丰林-DEV's avatar 文旺-丰林-DEV

add BE code

parent e1d7f610

Too many changes to show.

To preserve performance only 1000 of ${real_size} files are displayed.

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# Zzz
content/src/Zzz.Web/Logs/*
content/src/Zzz.Web.Host/Logs/*
content/src/Zzz.IdentityServer/Logs/*
content/src/Zzz.HttpApi.Host/Logs/*
content/src/Zzz.HttpApi.Host/Logs/*
content/src/Zzz.DbMigrator/Logs/*
/content/aspnetcore/src/Zzz.HttpApi.Host/App_Data
/aspnet-core/services/src/CompanyName.ProjectName.HttpApi.Host/Logs
/aspnet-core/services/src/CompanyName.ProjectName.IdentityServer/appsettings.Production.json
/aspnet-core/services/src/CompanyName.ProjectName.HttpApi.Host/appsettings.Production.json
/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Production.json
/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Logs
/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/Logs
/vben271/dist.zip
/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/publish.zip
/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/appsettings.Production.json
/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/publish.zip
vben271/yarn.lock
/vben271/_nginx.zip
/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/logs
/aspnet-core/services/host/Lion.AbpPro.IdentityServer/Logs
/aspnet-core/services/host/Lion.AbpPro.IdentityServer/Logs
/aspnet-core/gateways/Lion.AbpPro.WebGateway/appsettings.Production.json
/aspnet-core/services/host/Lion.AbpPro.IdentityServer/appsettings.Production.json
/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.Production.json
aspnet-core/services/host/Lion.AbpPro.Web.Blazor.Server/Logs/logs.txt
/nupkgs
/aspnet-core/Lion.AbpPro.sln.DotSettings
/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/logs
/vben271/package-lock.json
/docs/site
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
**/node_modules
# roadhog-api-doc ignore
/src/utils/request-temp.js
react/src/utils/request-temp.js
_roadhog-api-doc
# production
/dist
react/dist
# misc
.DS_Store
npm-debug.log*
yarn-error.log
/coverage
react/coverage
.idea
yarn.lock
package-lock.json
......@@ -39,3 +326,5 @@ screenshot
build
node_modules
@ECHO off
cls
ECHO Deleting all BIN and OBJ folders...
ECHO.
FOR /d /r . %%d in (bin,obj) DO (
IF EXIST "%%d" (
ECHO %%d | FIND /I "\node_modules\" > Nul && (
ECHO.Skipping: %%d
) || (
ECHO.Deleting: %%d
rd /s/q "%%d"
)
)
)
ECHO.
ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit.
pause > nul
\ No newline at end of file
This diff is collapsed.
@ECHO off
cls
ECHO Deleting all BIN and OBJ folders...
ECHO.
FOR /d /r . %%d in (bin,obj) DO (
IF EXIST "%%d" (
ECHO %%d | FIND /I "\node_modules\" > Nul && (
ECHO.Skipping: %%d
) || (
ECHO.Deleting: %%d
rd /s/q "%%d"
)
)
)
ECHO.
ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit.
pause > nul
\ No newline at end of file
<Project>
<!-- Lion.AbpPro包-->
<ItemGroup>
<PackageReference Update="Lion.AbpPro.Core" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Application" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Application.Contracts" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi.Client" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Application" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Application.Contracts" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi.Client" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application.Contracts" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.0.3.1"/>
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" Version="7.0.3.1"/>
</ItemGroup>
</Project>
\ No newline at end of file
<Project>
<!-- 微软官方包-->
<ItemGroup>
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="7.0.2"/>
<PackageReference Update="Microsoft.Extensions.Http" Version="7.0.2"/>
<PackageReference Update="Microsoft.Extensions.Diagnostics.HealthChecks" Version="7.0.2"/>
<PackageReference Update="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.2"/>
<PackageReference Update="Microsoft.EntityFrameworkCore.Tools" Version="7.0.2"/>
<PackageReference Update="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="7.0.2"/>
<PackageReference Update="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.2"/>
<PackageReference Update="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="7.0.2"/>
<PackageReference Update="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.2"/>
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="7.0.2"/>
<PackageReference Update="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.2"/>
<PackageReference Update="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.2"/>
<PackageReference Update="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Update="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0"/>
<PackageReference Update="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0"/>
<PackageReference Update="Microsoft.CSharp" Version="4.7.0"/>
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.7.0"/>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.2.0"/>
</ItemGroup>
</Project>
\ No newline at end of file
<Project>
<!-- Volo.Abp官方包-->
<ItemGroup>
<PackageReference Update="Volo.Abp.Autofac" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Json" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Validation" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Ddd.Domain" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AutoMapper" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.ObjectMapping" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Identity.AspNetCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Caching" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.BlobStoring.Aliyun" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.BackgroundJobs" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.BackgroundJobs.HangFire" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.SignalR" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.TestBase" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.EntityFrameworkCore.MySQL" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Identity.EntityFrameworkCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.Mvc.Contracts" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Account.Web" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Caching.StackExchangeRedis" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.Serilog" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Swashbuckle" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Ddd.Application" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Ddd.Application.Contracts" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Authorization" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Dapper" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.Mvc" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Http.Client" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.MongoDB" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.EntityFrameworkCore.Sqlite" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Http.Client.IdentityModel" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.MultiTenancy" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Account.Application" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Identity.Application" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.PermissionManagement.Application" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.TenantManagement.Application" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.FeatureManagement.Application" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.SettingManagement.Application" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.ObjectExtending" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Account.Application.Contracts" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Identity.Application.Contracts" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.PermissionManagement.Application.Contracts" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.TenantManagement.Application.Contracts" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.FeatureManagement.Application.Contracts" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.SettingManagement.Application.Contracts" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Emailing" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.PermissionManagement.Domain.Identity" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.BackgroundJobs.Domain" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AuditLogging.Domain" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.TenantManagement.Domain" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.FeatureManagement.Domain" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.SettingManagement.Domain" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Identity.Domain" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Identity.Domain.Shared" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.BackgroundJobs.Domain.Shared" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AuditLogging.Domain.Shared" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.TenantManagement.Domain.Shared" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.FeatureManagement.Domain.Shared" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.PermissionManagement.Domain.Shared" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.SettingManagement.Domain.Shared" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Account.HttpApi" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Identity.HttpApi" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.PermissionManagement.HttpApi" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.TenantManagement.HttpApi" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.FeatureManagement.HttpApi" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.SettingManagement.HttpApi" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Account.HttpApi.Client" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Identity.HttpApi.Client" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.PermissionManagement.HttpApi.Client" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.TenantManagement.HttpApi.Client" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.FeatureManagement.HttpApi.Client" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.SettingManagement.HttpApi.Client" Version="7.0.3"/>
<PackageReference Update="Volo.Abp" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Core" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.EntityFrameworkCore" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.TestBase" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.EventBus.Kafka" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.EventBus" Version="7.0.3"/>
<PackageReference Update="Volo.Abp.Kafka" Version="7.0.3"/>
</ItemGroup>
</Project>
\ No newline at end of file
<Project>
<Import Project="Directory.Build.Microsoft.targets"/>
<Import Project="Directory.Build.Volo.targets"/>
<Import Project="Directory.Build.Lion.targets"/>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>1.0.0</Version>
<NoWarn>$(NoWarn);CS1591;CS0436;NU1504</NoWarn>
<AbpProjectType>app</AbpProjectType>
<ImplicitUsings>true</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<!-- 基础包-->
<ItemGroup>
<PackageReference Update="Humanizer.Core.zh-Hans" Version="2.14.1"/>
<PackageReference Update="NSubstitute" Version="4.2.2"/>
<PackageReference Update="Shouldly" Version="4.0.3"/>
<PackageReference Update="coverlet.collector" Version="3.1.0"/>
<PackageReference Update="JunitXml.TestLogger" Version="3.0.98"/>
<PackageReference Update="Mongo2Go" Version="3.1.3"/>
<PackageReference Update="NEST" Version="7.15.1"/>
<PackageReference Update="System.ComponentModel.Annotations" Version="6.0.0-preview.4.21253.7"/>
<PackageReference Update="Ocelot" Version="18.0.0"/>
<PackageReference Update="Ocelot.Provider.Consul" Version="18.0.0"/>
<PackageReference Update="Ocelot.Provider.Polly" Version="18.0.0"/>
<PackageReference Update="FreeSql" Version="3.2.682"/>
<PackageReference Update="FreeSql.Provider.MySql" Version="3.2.682"/>
<PackageReference Update="FreeSql.Provider.Sqlite" Version="3.2.682"/>
<PackageReference Update="xunit" Version="2.4.1"/>
<PackageReference Update="xunit.extensibility.execution" Version="2.4.1"/>
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5"/>
<PackageReference Update="Hangfire.Redis.StackExchange" Version="1.8.5"/>
<PackageReference Update="DotNetCore.CAP" Version="7.0.2"/>
<PackageReference Update="DotNetCore.CAP.Dashboard" Version="7.0.2"/>
<PackageReference Update="DotNetCore.CAP.Mysql" Version="7.0.2"/>
<PackageReference Update="DotNetCore.CAP.RabbitMQ" Version="7.0.2"/>
<PackageReference Update="DotNetCore.CAP.InMemoryStorage" Version="7.0.2"/>
<PackageReference Update="Savorboard.CAP.InMemoryMessageQueue" Version="7.0.0"/>
<PackageReference Update="Swashbuckle.AspNetCore.SwaggerUI" Version="6.3.1"/>
<PackageReference Update="Swashbuckle.AspNetCore" Version="6.3.1"/>
<PackageReference Update="Swashbuckle.AspNetCore.Annotations" Version="6.3.1"/>
<PackageReference Update="Serilog" Version="2.11.0"/>
<PackageReference Update="Serilog.Extensions.Logging" Version="3.1.0"/>
<PackageReference Update="Serilog.Sinks.Async" Version="1.5.0"/>
<PackageReference Update="Serilog.Sinks.File" Version="5.0.0"/>
<PackageReference Update="Serilog.Sinks.Console" Version="4.0.1"/>
<PackageReference Update="Serilog.AspNetCore" Version="5.0.0"/>
<PackageReference Update="Serilog.Exceptions" Version="8.2.0"/>
<PackageReference Update="Serilog.Settings.Configuration" Version="3.3.0"/>
<PackageReference Update="Serilog.Sinks.Elasticsearch" Version="8.4.1"/>
<PackageReference Update="Magicodes.IE.Excel" Version="2.7.0"/>
<PackageReference Update="Magicodes.IE.Excel.AspNetCore" Version="2.7.0"/>
<PackageReference Update="MiniProfiler.AspNetCore.Mvc" Version="4.2.22"/>
<PackageReference Update="MiniProfiler.EntityFrameworkCore" Version="4.2.22"/>
<PackageReference Update="MiniProfiler.Shared" Version="4.2.22"/>
<PackageReference Update="AutoFixture.Xunit2" Version="4.17.0"/>
<PackageReference Update="prometheus-net.AspNetCore" Version="5.0.2"/>
<PackageReference Update="Aliyun.OSS.SDK.NetCore" Version="2.13.0"/>
<PackageReference Update="Zack.EFCore.Batch.MySQL.Pomelo_NET6" Version="6.1.3"/>
<PackageReference Update="Zack.EFCore.Batch.Sqlite_NET6" Version="6.1.3"/>
<PackageReference Update="Polly" Version="7.2.3"/>
<PackageReference Update="Confluent.Kafka" Version="1.8.2.0"/>
<!-- Idenity 一下三个包升级到最新版导致鉴权不通过-->
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.10.0"/>
<PackageReference Update="System.IdentityModel.Tokens.Jwt" Version="6.10.0"/>
<PackageReference Update="IdentityModel" Version="5.1.0"/>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
\ No newline at end of file
{
"sdk": {
"version": "7.0.102",
"rollForward": "latestFeature"
}
}
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "7.0.5",
"commands": [
"dotnet-ef"
]
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>BBM.ChatGLM</RootNamespace>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>BBM.ChatGLM-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="Volo.Abp.Account.Web" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" />
<PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" />
<PackageReference Include="Serilog" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Exceptions" />
<PackageReference Include="Serilog.Extensions.Logging" />
<PackageReference Include="Serilog.Settings.Configuration" />
<PackageReference Include="Serilog.Sinks.Console" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Serilog.Sinks.Async" />
<PackageReference Include="Hangfire.Redis.StackExchange" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.InMemoryStorage" />
<PackageReference Include="Savorboard.CAP.InMemoryMessageQueue" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" />
<PackageReference Include="MiniProfiler.Shared" />
<PackageReference Include="Lion.AbpPro.Shared.Hosting.Microservices" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\BBM.ChatGLM.Application\BBM.ChatGLM.Application.csproj" />
<ProjectReference Include="..\..\src\BBM.ChatGLM.EntityFrameworkCore\BBM.ChatGLM.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\src\BBM.ChatGLM.HttpApi\BBM.ChatGLM.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>
</Project>
namespace BBM.ChatGLM
{
public static class ChatGLMHttpApiHostConst
{
/// <summary>
/// 跨域策略名
/// </summary>
public const string DefaultCorsPolicyName = "Default";
/// <summary>
/// Cookies名称
/// </summary>
public const string DefaultCookieName = "BBM.ChatGLM.Http.Api";
/// <summary>
/// SwaggerUi 端点
/// </summary>
public const string SwaggerUiEndPoint = "/swagger";
/// <summary>
/// CAP 端点
/// </summary>
public const string CapDashboardEndPoint = "/cap";
public const string MoreEndPoint = "https://doc.cncore.club/";
/// <summary>
/// HMiniprofiler端点
/// </summary>
public const string MiniprofilerEndPoint = "/profiler/results-index";
}
}
\ No newline at end of file
namespace BBM.ChatGLM.Controllers
{
public class HomeController : AbpController
{
public ActionResult Index()
{
return Redirect("/Login");
}
}
}
FROM mcr.microsoft.com/dotnet/aspnet:6.0
# 创建目录
RUN mkdir /app
COPY publish /app
RUN echo "deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib" > /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib" >> /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" >> /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" >> /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >> /etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install libgdiplus libc6-dev -y && \
ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll && \
ln -s /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/libdl.dll && apt-get clean
# 设置工作目录
WORKDIR /app
# 暴露80端口
EXPOSE 80
# 设置时区 .net6 才有这个问题
ENV TZ=Asia/Shanghai
# 设置环境变量
ENV ASPNETCORE_ENVIRONMENT=Production
ENTRYPOINT ["dotnet", "BBM.ChatGLM.HttpApi.Host.dll"]
namespace BBM.ChatGLM.Extensions.Hangfire;
public class AutoDeleteAfterSuccessAttributer : JobFilterAttribute, IApplyStateFilter
{
private readonly TimeSpan _deleteAfter;
public AutoDeleteAfterSuccessAttributer(TimeSpan timeSpan)
{
_deleteAfter = timeSpan;
}
public void OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
context.JobExpirationTimeout = _deleteAfter;
}
public void OnStateUnapplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
}
}
\ No newline at end of file
namespace BBM.ChatGLM.Extensions.Hangfire
{
/// <summary>
/// Cron类型
/// </summary>
public static class CronType
{
/// <summary>
/// 周期性为分钟的任务
/// </summary>
/// <param name="interval">执行周期的间隔,默认为每分钟一次</param>
/// <returns></returns>
public static string Minute(int interval = 1)
{
return "1 0/" + interval.ToString() + " * * * ? ";
}
/// <summary>
/// 周期性为小时的任务
/// </summary>
/// <param name="minute">第几分钟开始,默认为第一分钟</param>
/// <param name="interval">执行周期的间隔,默认为每小时一次</param>
/// <returns></returns>
public static string Hour(int minute = 1, int interval = 1)
{
return "1 " + minute + " 0/" + interval.ToString() + " * * ? ";
}
/// <summary>
/// 周期性为天的任务
/// </summary>
/// <param name="hour">第几小时开始,默认从1点开始</param>
/// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
/// <param name="interval">执行周期的间隔,默认为每天一次</param>
/// <returns></returns>
public static string Day(int hour = 1, int minute = 1, int interval = 1)
{
return "1 " + minute.ToString() + " " + hour.ToString() + " 1/" + interval.ToString() + " * ? ";
}
/// <summary>
/// 周期性为周的任务
/// </summary>
/// <param name="dayOfWeek">星期几开始,默认从星期一点开始</param>
/// <param name="hour">第几小时开始,默认从1点开始</param>
/// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
/// <returns></returns>
public static string Week(DayOfWeek dayOfWeek = DayOfWeek.Monday, int hour = 1, int minute = 1)
{
return Cron.Weekly(dayOfWeek, hour, minute);
}
/// <summary>
/// 周期性为月的任务
/// </summary>
/// <param name="day">几号开始,默认从一号开始</param>
/// <param name="hour">第几小时开始,默认从1点开始</param>
/// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
/// <returns></returns>
public static string Month(int day = 1, int hour = 1, int minute = 1)
{
return Cron.Monthly(day, hour, minute);
}
/// <summary>
/// 周期性为年的任务
/// </summary>
/// <param name="month">几月开始,默认从一月开始</param>
/// <param name="day">几号开始,默认从一号开始</param>
/// <param name="hour">第几小时开始,默认从1点开始</param>
/// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
/// <returns></returns>
public static string Year(int month = 1, int day = 1, int hour = 1, int minute = 1)
{
return Cron.Yearly(month, day, hour, minute);
}
}
}
\ No newline at end of file
namespace BBM.ChatGLM.Extensions.Hangfire
{
public class CustomHangfireAuthorizeFilter : IDashboardAuthorizationFilter
{
public bool Authorize(DashboardContext context)
{
var _currentUser = context.GetHttpContext().RequestServices.GetRequiredService<ICurrentUser>();
return _currentUser.IsAuthenticated;
}
}
}
namespace BBM.ChatGLM.Extensions.Hangfire;
/// <summary>
/// 重试最后一次
/// </summary>
public class JobRetryLastFilter : JobFilterAttribute, IElectStateFilter
{
private int RetryCount { get; }
public JobRetryLastFilter(int retryCount)
{
RetryCount = retryCount;
}
public void OnStateElection(ElectStateContext context)
{
var retryAttempt = context.GetJobParameter<int>("RetryCount");
if (RetryCount == retryAttempt)
{
Log.Error("最后一次重试");
}
}
}
\ No newline at end of file
using BBM.ChatGLM.Jobs;
namespace BBM.ChatGLM.Extensions
{
public static class RecurringJobsExtensions
{
public static void CreateRecurringJob(this ApplicationInitializationContext context)
{
//using var scope = context.ServiceProvider.CreateScope();
//var testJob = scope.ServiceProvider.GetService<TestJob>();
//RecurringJob.AddOrUpdate("测试Job", () => testJob.ExecuteAsync(), CronType.Minute(1), TimeZoneInfo.Local);
}
}
}
\ No newline at end of file
namespace Microsoft.AspNetCore.Builder;
public static class ChatGLMApplicationBuilderExtensionsExtensions
{
/// <summary>
/// 记录请求响应日志
/// </summary>
/// <returns></returns>
public static IApplicationBuilder UseRequestLog(this IApplicationBuilder app)
{
return app.UseMiddleware<RequestLogMiddleware>();
}
}
\ No newline at end of file
namespace BBM.ChatGLM.Extensions.Middlewares;
public class RequestLogMiddleware
{
private readonly RequestDelegate _next;
private readonly ILogger<RequestLogMiddleware> _logger;
public RequestLogMiddleware(RequestDelegate next,
ILogger<RequestLogMiddleware> logger)
{
_next = next;
_logger = logger;
}
public async Task InvokeAsync(HttpContext context)
{
context.Request.EnableBuffering();
var originalBody = context.Response.Body;
if (context.Request.Path.ToString().ToLower().Contains("swagger")
|| context.Request.Path.ToString().ToLower().Contains("login")
|| context.Request.Path.ToString().ToLower().Contains("monitor")
|| context.Request.Path.ToString().ToLower().Contains("cap")
|| context.Request.Path.ToString().ToLower().Contains("hangfire")
|| context.Request.Path.ToString() == "/"
)
{
await _next(context);
}
else
{
try
{
var logRequestId = Guid.NewGuid().ToString();
await RequestDataLog(context, logRequestId);
using (var ms = new MemoryStream())
{
context.Response.Body = ms;
await _next(context);
ResponseDataLog(ms, logRequestId);
ms.Position = 0;
await ms.CopyToAsync(originalBody);
}
}
catch (Exception ex)
{
// 记录异常
_logger.LogError(ex.Message + "" + ex.InnerException);
}
finally
{
context.Response.Body = originalBody;
}
}
}
private async Task RequestDataLog(HttpContext context,
string requestId)
{
var request = context.Request;
var body = new StreamReader(request.Body);
var requestData = $" 请求路径:{request.Path}\r\n 请求Body参数:{await body.ReadToEndAsync()}";
_logger.LogInformation($"日志中间件[Request],LogRequestId:{requestId}:请求接口信息:{requestData}");
request.Body.Position = 0;
}
private void ResponseDataLog(MemoryStream ms, string requestId)
{
ms.Position = 0;
var responseBody = new StreamReader(ms).ReadToEnd();
// 去除 Html
var isHtml = Regex.IsMatch(responseBody, "<[^>]+>");
if (!isHtml && !string.IsNullOrEmpty(responseBody))
{
_logger.LogInformation($"日志中间件[Response],LogRequestId:{requestId}:响应接口信息:{responseBody}");
}
}
}
\ No newline at end of file
namespace BBM.ChatGLM.Extensions.System
{
public class DontWrapResultAttribute : Attribute
{
}
}
\ No newline at end of file
// Global using directives
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Text;
global using System.Text.RegularExpressions;
global using System.Threading.Tasks;
global using Hangfire;
global using Hangfire.Common;
global using Hangfire.Dashboard;
global using Hangfire.States;
global using Hangfire.Storage;
global using BBM.ChatGLM.EntityFrameworkCore;
global using BBM.ChatGLM.Extensions;
global using BBM.ChatGLM.Extensions.Hangfire;
global using BBM.ChatGLM.Extensions.Middlewares;
global using BBM.ChatGLM.Extensions.System;
global using BBM.ChatGLM.MultiTenancy;
global using Microsoft.AspNetCore.Authentication.JwtBearer;
global using Microsoft.AspNetCore.Builder;
global using Microsoft.AspNetCore.DataProtection;
global using Microsoft.AspNetCore.Hosting;
global using Microsoft.AspNetCore.Http;
global using Microsoft.AspNetCore.Identity;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.AspNetCore.Mvc.Abstractions;
global using Microsoft.AspNetCore.Mvc.Filters;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Hosting;
global using Microsoft.Extensions.Localization;
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Logging.Abstractions;
global using Microsoft.Extensions.Options;
global using Microsoft.IdentityModel.Tokens;
global using Microsoft.OpenApi.Models;
global using Serilog;
global using StackExchange.Redis;
global using Swashbuckle.AspNetCore.SwaggerUI;
global using Volo.Abp;
global using Volo.Abp.Account.Web;
global using Volo.Abp.AspNetCore.Auditing;
global using Volo.Abp.AspNetCore.Authentication.JwtBearer;
global using Volo.Abp.AspNetCore.ExceptionHandling;
global using Volo.Abp.AspNetCore.Mvc;
global using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
global using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
global using Volo.Abp.AspNetCore.Serilog;
global using Volo.Abp.Auditing;
global using Volo.Abp.Authorization;
global using Volo.Abp.BackgroundJobs;
global using Volo.Abp.BackgroundJobs.Hangfire;
global using Volo.Abp.Caching;
global using Volo.Abp.Caching.StackExchangeRedis;
global using Volo.Abp.DependencyInjection;
global using Volo.Abp.Domain.Entities;
global using Volo.Abp.ExceptionHandling;
global using Volo.Abp.Http;
global using Volo.Abp.Json;
global using Volo.Abp.Modularity;
global using Volo.Abp.Users;
global using Volo.Abp.Validation;
\ No newline at end of file
@page
@model BBM.ChatGLM.Pages.Login
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>后台服务登录</title>
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.staticfile.org/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-offset-3 col-md-6">
<form class="form-horizontal" method="post">
@Html.AntiForgeryToken()
<span class="heading">后台服务登录</span>
<div class="form-group">
<input type="text" class="form-control" name="userName" placeholder="用户名">
<i class="fa fa-user"></i>
</div>
<div class="form-group help">
<input type="password" class="form-control" name="password" placeholder="密码">
<i class="fa fa-lock"></i>
</div>
<div class="form-group">
<button type="submit" class="btn btn-default">登录</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
<style>
.row {
width: 800 px;
height: auto;
margin: auto;
box-sizing: border-box;
transform: translate(0, 50%);
}
.form-horizontal {
background: #fff;
padding-bottom: 40px;
border-radius: 15px;
text-align: center;
}
.form-horizontal .heading {
display: block;
font-size: 35px;
font-weight: 700;
padding: 35px 0;
border-bottom: 1px solid #f0f0f0;
margin-bottom: 30px;
}
.form-horizontal .form-group {
padding: 0 40px;
margin: 0 0 25px 0;
position: relative;
}
.form-horizontal .form-control {
background: #f0f0f0;
border: none;
border-radius: 20px;
box-shadow: none;
padding: 0 20px 0 45px;
height: 40px;
transition: all 0.3s ease 0s;
}
.form-horizontal .form-control:focus {
background: #e0e0e0;
box-shadow: none;
outline: 0 none;
}
.form-horizontal .form-group i {
position: absolute;
top: 12px;
left: 60px;
font-size: 17px;
color: #c8c8c8;
transition: all 0.5s ease 0s;
}
.form-horizontal .form-control:focus + i {
color: #00b4ef;
}
.form-horizontal .fa-question-circle {
display: inline-block;
position: absolute;
top: 12px;
right: 60px;
font-size: 20px;
color: #808080;
transition: all 0.5s ease 0s;
}
.form-horizontal .fa-question-circle:hover {
color: #000;
}
.form-horizontal .main-checkbox {
float: left;
width: 20px;
height: 20px;
background: #11a3fc;
border-radius: 50%;
position: relative;
margin: 5px 0 0 5px;
border: 1px solid #11a3fc;
}
.form-horizontal .main-checkbox label {
width: 20px;
height: 20px;
position: absolute;
top: 0;
left: 0;
cursor: pointer;
}
.form-horizontal .main-checkbox label:after {
content: "";
width: 10px;
height: 5px;
position: absolute;
top: 5px;
left: 4px;
border: 3px solid #fff;
border-top: none;
border-right: none;
background: transparent;
opacity: 0;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.form-horizontal .main-checkbox input[type="checkbox"] {
visibility: hidden;
}
.form-horizontal .main-checkbox input[type="checkbox"]:checked + label:after {
opacity: 1;
}
.form-horizontal .text {
float: left;
margin-left: 7px;
line-height: 20px;
padding-top: 5px;
text-transform: capitalize;
}
.form-horizontal .btn {
text-align: center;
font-size: 14px;
color: #fff;
background: #00b4ef;
border-radius: 30px;
padding: 10px 25px;
border: none;
text-transform: capitalize;
transition: all 0.5s ease 0s;
}
</style>
\ No newline at end of file
using Lion.AbpPro.BasicManagement.ConfigurationOptions;
using Lion.AbpPro.BasicManagement.Users;
using Lion.AbpPro.BasicManagement.Users.Dtos;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace BBM.ChatGLM.Pages
{
public class Login : PageModel
{
private readonly IAccountAppService _accountAppService;
private readonly ILogger<Login> _logger;
private readonly IHostEnvironment _hostEnvironment;
private readonly JwtOptions _jwtOptions;
public Login(IAccountAppService accountAppService,
ILogger<Login> logger,
IHostEnvironment hostEnvironment,
IOptionsSnapshot<JwtOptions> jwtOptions)
{
_accountAppService = accountAppService;
_logger = logger;
_hostEnvironment = hostEnvironment;
_jwtOptions = jwtOptions.Value;
}
public void OnGet()
{
}
public async Task OnPost()
{
string userName = Request.Form["userName"];
string password = Request.Form["password"];
if (userName.IsNullOrWhiteSpace() || password.IsNullOrWhiteSpace())
{
Response.Redirect("/Login");
return;
}
try
{
var options = new CookieOptions
{
Expires = DateTime.Now.AddHours(_jwtOptions.ExpirationTime),
SameSite = SameSiteMode.Unspecified,
};
// 设置cookies domain
//options.Domain = "ChatGLM.cn";
var result = await _accountAppService.LoginAsync(new LoginInput()
{ Name = userName, Password = password });
Response.Cookies.Append(ChatGLMHttpApiHostConst.DefaultCookieName,
result.Token, options);
}
catch (Exception e)
{
_logger.LogError($"登录失败:{e.Message}");
Response.Redirect("/Login");
return;
}
Response.Redirect("/monitor");
}
}
}
\ No newline at end of file
@page
@using BBM.ChatGLM
@model BBM.ChatGLM.Pages.Monitor
@{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet"/>
<title>后端服务</title>
</head>
<body>
<div class="container projects">
<div class="projects-header page-header">
<h2>后端服务列表</h2>
@* <p>这些项目或者是对Bootstrap进行了有益的补充,或者是基于Bootstrap开发的</p> *@
</div>
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="thumbnail" style="height: 180px">
<a href="@ChatGLMHttpApiHostConst.SwaggerUiEndPoint" target="_blank">
<img class="lazy" src="/images/swagger.png" width="300" height="150"/>
</a>
<div class="caption">
<h3>
<a href="@ChatGLMHttpApiHostConst.SwaggerUiEndPoint" target="_blank">SwaggerUI</a>
</h3>
</div>
</div>
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="thumbnail" style="height: 180px">
<a href="@ChatGLMHttpApiHostConst.MiniprofilerEndPoint" target="_blank">
<img class="lazy" src="/images/miniprofiler.png" width="300" height="150"/>
</a>
<div class="caption">
<h3>
<a href="@ChatGLMHttpApiHostConst.MiniprofilerEndPoint" target="_blank">Miniprofiler</a>
</h3>
</div>
</div>
</div>
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="thumbnail" style="height: 180px">
<a href="@ChatGLMHttpApiHostConst.MoreEndPoint" target="_blank">
<img class="lazy" src="/images/more.png" width="300" height="150"/>
</a>
<div class="caption">
<h3>
<a href="@ChatGLMHttpApiHostConst.MoreEndPoint" target="_blank">了解更多...</a>
</h3>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<style>
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.container {
width: 1170 px;
padding-right: 15 px;
padding-left: 15 px;
margin-right: auto;
margin-left: auto;
}
.projects-header {
width: 60%;
text-align: center;
font-weight: 200;
display: block;
margin: 60 px auto 40 px !important;
}
.page-header {
padding-bottom: 9px;
margin: 40px auto;
border-bottom: 1 px solid #eee;
}
.projects-header h2 {
font-size: 42px;
letter-spacing: -1px;
}
h2 {
margin-top: 20 px;
margin-bottom: 10 px;
font-weight: 500;
line-height: 1.1;
color: inherit;
/* text-align: center; */
}
p {
margin: 0 0 10 px;
}
.row {
margin-right: -15 px;
margin-left: -15 px;
}
.col-lg-3 {
width: 25%;
}
.projects .thumbnail {
display: block;
margin-right: auto;
margin-left: auto;
text-align: center;
margin-bottom: 30 px;
border-radius: 0;
}
.thumbnail {
display: block;
padding: 4px;
line-height: 1.42857143;
background-color: #fff;
border: 1 px solid #ddd;
.transition(border 0.2s ease-in-out);
}
a {
color: #337ab7;
text-decoration: none;
background-color: transparent;
}
.projects .thumbnail img {
max-width: 100%;
height: auto;
}
.thumbnail a > img,
.thumbnail > img {
margin-right: auto;
margin-left: auto;
}
img {
vertical-align: middle;
}
/* .projects .thumbnail .caption {
overflow-y: hidden;
color: #555;
} */
.caption {
padding: 9px;
overflow-y: hidden;
color: #555;
}
</style>
\ No newline at end of file
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace BBM.ChatGLM.Pages
{
public class Monitor : PageModel
{
public void OnGet()
{
}
}
}
\ No newline at end of file
namespace BBM.ChatGLM
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
private static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.ConfigureKestrel((context, options) => { options.Limits.MaxRequestBodySize = 1024 * 50; });
webBuilder.UseStartup<Startup>();
})
.UseSerilog((context, loggerConfiguration) =>
{
SerilogToEsExtensions.SetSerilogConfiguration(
loggerConfiguration,
context.Configuration);
}).UseAutofac();
}
}
{
"profiles": {
"BBM.ChatGLM.HttpApi.Host": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:44315",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
\ No newline at end of file
namespace BBM.ChatGLM
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<ChatGLMHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}
{
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File"
],
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Information",
"Volo.Abp": "Information",
"Hangfire": "Information",
"DotNetCore.CAP": "Information",
"Serilog.AspNetCore": "Information",
"Microsoft.EntityFrameworkCore": "Warning",
"Microsoft.AspNetCore": "Information"
}
},
"WriteTo": [
{
"Name": "Console"
},
{
"Name": "File",
"Args": {
"path": "logs/logs-.txt",
"rollingInterval": "Day"
}
}
]
},
"App": {
"SelfUrl": "http://localhost:44315",
"CorsOrigins": "",
"ApiKey": "Uicm6VMjVPdzepbqnwNvpl25xJjRxFekMV8QZdeTLTwacNBl"
},
"ConnectionStrings": {
"Default": "Host=yg-sql-dev-wan.pg.rds.aliyuncs.com;Port=5432;Database=BBMChatGLM;User ID=yg;Password=YG@sql!dev2022123;"
},
"Redis": {
"Configuration": "yg-redis-dev-wan.redis.rds.aliyuncs.com:6379,password=YG@redis!dev2022123,defaultDatabase=5"
},
"Jwt": {
"Audience": "BBM.ChatGLM",
"SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=",
"Issuer": "BBM.ChatGLM",
"ExpirationTime": 2
},
"ElasticSearch": {
"Enabled": "false",
"Url": "http://es.cn",
"IndexFormat": "BBM.ChatGLM.development.{0:yyyy.MM.dd}",
"UserName": "elastic",
"Password": "aVVhjQ95RP7nbwNy",
"SearchIndexFormat": "BBM.ChatGLM.development*"
}
}
\ No newline at end of file
{
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File"
],
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Information",
"Volo.Abp": "Information",
"Hangfire": "Information",
"DotNetCore.CAP": "Information",
"Serilog.AspNetCore": "Information",
"Microsoft.EntityFrameworkCore": "Warning",
"Microsoft.AspNetCore": "Information"
}
},
"WriteTo": [
{
"Name": "Console"
},
{
"Name": "File",
"Args": {
"path": "logs/logs-.txt",
"rollingInterval": "Day"
}
}
]
},
"App": {
"SelfUrl": "http://localhost:44315",
"CorsOrigins": null,
"ApiKey": "Uicm6VMjVPdzepbqnwNvpl25xJjRxFekMV8QZdeTLTwacNBl"
},
"ConnectionStrings": {
"Default": "Host=yg-sql-dev-wan.pg.rds.aliyuncs.com;Port=5432;Database=BBMChatGLM;User ID=yg;Password=YG@sql!dev2022123;",
},
"Redis": {
"Configuration": "yg-redis-dev-wan.redis.rds.aliyuncs.com:6379,password=YG@redis!dev2022123,defaultDatabase=5"
},
"Jwt": {
"Audience": "BBM.ChatGLM",
"SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=",
"Issuer": "BBM.ChatGLM",
"ExpirationTime": 12
},
"ElasticSearch": {
"Enabled": "false",
"Url": "http://es.cn",
"IndexFormat": "BBM.ChatGLM.development.{0:yyyy.MM.dd}",
"UserName": "elastic",
"Password": "aVVhjQ95RP7nbwNy",
"SearchIndexFormat": "BBM.ChatGLM.development*"
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"AdditionalData":{},"Alg":"RS256","Crv":null,"D":"eH-Ld45J684VguyI2jACQEEVGtTx79Nt7ElT20JeUi-pbVnhJxxAJwnAe68d9Q8skpv6BxZs5QuyIORwfGpJK-lKVuo8EtyUQTuUuPmP4o1YK4cv2FIi5xN18tddTltg2JmJi1sN2AD5z-zwm45YNvoFxdQYlnUlA9lJL8QfG0HQLMQX1sv2_lgND8RfRGQBCpVXC2kcap4GvkFVQpKaQ5xaUqvNdH6ftwkGMdFfMRlHGhyYyabIjs4T16HslofvXiHbOCAzk37HtBNNsBpeoQuZul1-G7tAndHe1XtuGvuE-k1fyqdm3YiCU8wK7FpvQU3x6JqvfqmWgMAPnWKOtQ","DP":"hd3I9Nc3LlaZDoPg20JZu48kpv9rMMQ0rLtcZ0UPB_HpZWBC_No-3t3t1HFRbD4iz0MCpCR6gb5q4UsL2N2xh3Q8OhQ1Zrl76UKDZrVKs3oE0VVr9K2VUU3s1sytE4OWSv7PAHYURygcx_MrunMn8Ryd4ZJBQ_g5M2GvpBj1o5M","DQ":"T3ibciK4KxGGHqau9dnWxE6l3fGtcNw1GcjV93Lxe0NKTbfrwPEIFVVAyPsFS8QdmRXEgyunkDFKLHyq2hXBi2fZCwXGoWkUqVUKAKMaNYZaDDd_XeJKOu7mwNY8rgxNETHCyMSnnNNPNabBf2iiXmrBnMwesle2L1kwky42yns","E":"AQAB","K":null,"KeyId":"0D94529E740F5FD50EC6B8A19FF460D6","Kid":"0D94529E740F5FD50EC6B8A19FF460D6","Kty":"RSA","N":"w2jhtWb6a3kH4VqAPfuuvdF5hBh7U6gwMRnddHAH7zaVL6aYwjpCzNW56RQy4W4Zabv1My4Yw9GZpjrOcyr3Bm669eZjn_JC0O00eRTNStNgmg2kB_6AB6ROkEW7br1JC0jKr_dXhOYPBMmR-KHvpwaZXA9R1xOqY02S3JD0KB-TGMSC9q1RlVydt81aMOHFzWVyruLsYGdmcKhRPKDtL6GXpU_DG1gzzOYbk795x_D_UUTOJYuhIDEj7aYi3o32yXLEBvh4Q7HPLjLcWzV-EzCn6Ossl-EVJ2TrR53Eln03R93Vmo63DzQbLIOi3yTcZD2a3O6mpGLiqyZjUducIQ","Oth":null,"P":"y84cEtE6IRBeU2sDJxjDYb50HB4nAF7-bfvbEq0haQL2sFBz-Q-uOUAeXhaS74Gh_IagmW1TzOKblVilijMHCsfOFTWlCljaDoNfdl31enh50HMFvUu8IFjcWiQ9fjR5no8n5-jDeRO5zVfgcWoRHfVTOq4Di7WlVHJRr8FB-R8","Q":"9XRZvvMIvoumlDAVxWZHkb7_an0_dFwBLqc8v74XBZhiK5SLuBqmsJICB5kwNTKzORH7yedx-RXOJWkchJLlEtmH_cQO_6WKQQAyc1PMnLPa0tYkhjotWo8VRE9bAdVmrR0cnJeudfSJ-6gDpUBQYy9g1m8cAfWbTAk3at2_gr8","QI":"xRLXLwhTdNbevlEzANlDDnU9lDeKZWV9-YrvUxHMJBBygBNVqkNFWiee7LNUi82YgTHRn46rpHY9TZf6oQbgk6xa86MyDYXGU2uGO8DHm5oh20Spp7A-RlzZ4JRXAJ3eAYMZHQIP45JApVvKbgHh_pUGjNaiqZKZ9IN6H_L9k1s","Use":null,"X":null,"X5t":null,"X5tS256":null,"X5u":null,"Y":null,"KeySize":2048,"HasPrivateKey":true,"CryptoProviderFactory":{"CryptoProviderCache":{},"CustomCryptoProvider":null,"CacheSignatureProviders":true}}
\ No newline at end of file
{"KeyId":"600caa200caf5d805eba9f06ace9e236","Parameters":{"D":"KCNDHA96eimN+UqchSKocgYITGflaAIwxzCS5KqSTkYAFliPthQx7LySuLor4F1+uLvwnh3ZocyI3y43GZu+eVHD256sxdV8/UsQz1HC23RRFqcUiAZjze8K5VMVStrBOxaa/Ds1U9/bpuNE7jZdcgFIEHsdZtCACqwtlE4nlIs1/GLiokqjBOESgxJMy9WUeDbWcvoo+YdwgKf5jt6AZHOYSS+TokLL+Y7TEfGMXe3jZD9VtSMkBSM8wGB89zNGR0FZB9maCG/BCoRJqxdYRyeb4FFXJclQtK3DexyDVqlNZQaNKVHu0tVAnVNKKcd7Iex8gA+5DNqqucUA7C/F6Q==","DP":"fr9iaNb1W4YZ/NJ56+N3SCeDQYuKobq1qeaQWmHlQsOHKoHhNZJQZ5x0M9PQilou16AwVlNGCJncMwxsSUxXn6itG0LcBnvfMeo2v3xKcij1BtFR9qfXecwEn2nnhI3mpXtZxyCdP3NIYUp9qViLJUjGJqrbQk+OIAGRQd2rRe0=","DQ":"o1umLkDodtwvpCsDguQYSjd3iob+WHNmfe/9HyjADmUehP8b9SpUgcrb+QF301J8YmQMnYZKWW5rEwKOtwsWNswgXfMnXeWerlZmz0tj9y38YczS70liU0vETsRefhrRCaXHraMvneqYNNedhsrCNalWK+DNwcixi4L59vA8ofs=","Exponent":"AQAB","InverseQ":"btd1nwwxl/E3ryfDi2bN12TuVDvv7yoPvryIlLgu+FiLpe4vaA1omDLliQBcl7oeyA563HBUop4D5oE7si+jD64N8XgFz37dD3KqUokeQ4lrTSSOePT1K+nWIl30sqDd7YE4auz4CvSjm2wXmN31+CXW1hp3YWN2972yrUt+R5U=","Modulus":"uwMB6reAVtm/Cq0BRPZ0ozBq6g3wDh2kzqFKBf8I7u8d9p7i5ExLSrOWPupHwPr/IW1VUn2TKHrJ8OnyYhznKIRxqlxj0U3D2GXijz5kfFOoHK+mlfKaDMqweRoS0UzEz58kMlgwUoDraUj6dTHTPCVPo3TqA2ImRw50j6D+jobFrY5321EFvlirZViMPDAgB8Ca7wGCqNBcCxvIPYw1O6WZmcVmjG7umelD3XjcUIQlEbIyAmi/3gXAo7NdPmgOamla6bnSWsy429HfsNpXyCfPBzV3QS3ubpTekWPoPcOVZbWwVPYtFQbhRh8PmWATRx0cV6oePZNZGxGeJl8WYQ==","P":"wplelBfVmiOPmr6iUxtOgIzuvwSqvP6Rqmh8dhaGDiJjU8OqZ0tZhuh0G+xnMLPIHb2fMeg0dqZMJZ5iXaIi1QycYn/JKz1i4cUonJ6IIQeKKf67tvzn/BY0V0N8rJw8hVfzou+/5sRBCbiHtJ2KIN1YJQuWGFFfrZJOJzc95ss=","Q":"9gTGKoDiOdrY8kqIXJ2nMhoeNryAH4q3EUrROJ7simqc28oYlGx24Sco/wOoeB2xxrdcF5JYOlyJ7H2YY/huLvJISaw/wHLPskiKiYQ78tuNwW0ip+5ceB1dSToHcEe3sR30+OeTh0Z4ZKoqthKziFGIt3EhEgiGq1gjZuWB5gM="}}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>BBM.ChatGLM</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BBM.ChatGLM.Domain.Shared\BBM.ChatGLM.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lion.AbpPro.BasicManagement.Application.Contracts" />
<PackageReference Include="Lion.AbpPro.NotificationManagement.Application.Contracts" />
<PackageReference Include="Lion.AbpPro.DataDictionaryManagement.Application.Contracts" />
</ItemGroup>
</Project>
using Lion.AbpPro.BasicManagement;
using Lion.AbpPro.DataDictionaryManagement;
using Lion.AbpPro.NotificationManagement;
namespace BBM.ChatGLM
{
[DependsOn(
typeof(ChatGLMDomainSharedModule),
typeof(AbpObjectExtendingModule),
typeof(BasicManagementApplicationContractsModule),
typeof(NotificationManagementApplicationContractsModule),
typeof(DataDictionaryManagementApplicationContractsModule)
)]
public class ChatGLMApplicationContractsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
ChatGLMDtoExtensions.Configure();
}
}
}
namespace BBM.ChatGLM
{
public static class ChatGLMDtoExtensions
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
/* You can add extension properties to DTOs
* defined in the depended modules.
*
* Example:
*
* ObjectExtensionManager.Instance
* .AddOrUpdateProperty<IdentityRoleDto, string>("Title");
*
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Object-Extensions
*/
});
}
}
}
\ No newline at end of file
using BBM.ChatGLM.Dtos;
using Volo.Abp.Application.Dtos;
namespace BBM.ChatGLM.ChatSession
{
public interface IChatSessionsAppService : IApplicationService
{
Task<PagedResultDto<ChatSessionDto>> PageAsync(ChatSessionPageInput input);
Task<ChatSessionDto> CreateAsync(ChatSessionCreateInput input);
Task<ChatSessionDto> UpdateAsync(ChatSessionUpdateInput input);
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class ChatSessionCreateInput
{
[Required]
public string Content { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class ChatSessionPageInput: PagingInput
{
public string Filter { get; set; } = null;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class ChatSessionUpdateInput
{
[Required]
public Guid Id { get; set; }
[Required]
public string Content { get; set; }
}
}
namespace BBM.ChatGLM.Dtos
{
public class GuidIdInput
{
public Guid Id { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class PagingInput
{
public int PageSize { get; set; }
public int PageIndex { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class PromptWordCreateInput
{
[Required]
[MaxLength(200, ErrorMessage = "The maximum length of the Content is 200")]
public string Content { get; set; }
[Required]
public string Type { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class PromptWordPageInput : PagingInput
{
public string Filter { get; set; } = null;
public string Type { get; set; } = null;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class PromptWordTypeCreateInput
{
[Required]
[MaxLength(30, ErrorMessage = "提示词类型最大长度为30个字符")]
public string Type { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class PromptWordTypePageInput : PagingInput
{
public string Filter { get; set; } = null;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class PromptWordTypeUpdateInput
{
[Required]
public Guid Id { get; set; }
[Required]
[MaxLength(30, ErrorMessage = "提示词类型最大长度为30个字符")]
public string Type { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class PromptWordUpdateInput
{
[Required]
public Guid Id { get; set; }
[Required]
[MaxLength(200, ErrorMessage = "The maximum length of the Content is 200")]
public string Content { get; set; }
[Required]
public string Type { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class TokenObject
{
public string token { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class UserCreateInput
{
[Required]
public string Name { get; set; }
[Required]
public string UserName { get; set; }
[Required]
public string Password { get; set; }
[Required]
public string Role { get; set; }
[Required]
public bool IsActive { get; set; } = true;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class UserPageInput : PagingInput
{
public string Name { get; set; } = null;
public bool? Enabled { get; set; } = null;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class UserResetPasswordInput
{
public Guid Id { get; set; }
public string Password { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBM.ChatGLM.Dtos
{
public class UserUpdateInput
{
[Required]
public Guid Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string Role { get; set; }
public bool IsActive { get; set; } = true;
}
}
// Global using directives
global using System;
global using System.Threading.Tasks;
global using Volo.Abp.Application.Services;
global using Volo.Abp.Authorization.Permissions;
global using Volo.Abp.DependencyInjection;
global using Volo.Abp.Identity;
global using Volo.Abp.Localization;
global using Volo.Abp.Modularity;
global using Volo.Abp.ObjectExtending;
global using Volo.Abp.Threading;
\ No newline at end of file
namespace BBM.ChatGLM.Jobs
{
public interface IRecurringJob : ITransientDependency
{
/// <summary>
/// 执行任务
/// </summary>
/// <returns></returns>
Task ExecuteAsync();
}
}
\ No newline at end of file
namespace BBM.ChatGLM.Permissions
{
public class ChatGLMPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var group = context.GetGroup("AbpIdentity");
var usersManagement = group.AddPermission(ChatGLMPermissions.UsersManagement.Default, L("Permission:UsersManagement"));
usersManagement.AddChild(ChatGLMPermissions.UsersManagement.Query, L("Permission:Query"));
usersManagement.AddChild(ChatGLMPermissions.UsersManagement.Create, L("Permission:Create"));
usersManagement.AddChild(ChatGLMPermissions.UsersManagement.Delete, L("Permission:Delete"));
usersManagement.AddChild(ChatGLMPermissions.UsersManagement.Update, L("Permission:Update"));
usersManagement.AddChild(ChatGLMPermissions.UsersManagement.Chat, L("Permission:Chat"));
usersManagement.AddChild(ChatGLMPermissions.UsersManagement.ResetPassword, L("Permission:ResetPassword"));
var promptWordManagement = group.AddPermission(ChatGLMPermissions.PromptWordManagement.Default, L("Permission:PromptWordManagement"));
promptWordManagement.AddChild(ChatGLMPermissions.PromptWordManagement.Query, L("Permission:Query"));
promptWordManagement.AddChild(ChatGLMPermissions.PromptWordManagement.Create, L("Permission:Create"));
promptWordManagement.AddChild(ChatGLMPermissions.PromptWordManagement.Delete, L("Permission:Delete"));
promptWordManagement.AddChild(ChatGLMPermissions.PromptWordManagement.Update, L("Permission:Update"));
var promptWordTypeManagement = group.AddPermission(ChatGLMPermissions.PromptWordTypeManagement.Default, L("Permission:PromptWordTypeManagement"));
promptWordTypeManagement.AddChild(ChatGLMPermissions.PromptWordTypeManagement.Query, L("Permission:Query"));
promptWordTypeManagement.AddChild(ChatGLMPermissions.PromptWordTypeManagement.Create, L("Permission:Create"));
promptWordTypeManagement.AddChild(ChatGLMPermissions.PromptWordTypeManagement.Delete, L("Permission:Delete"));
promptWordTypeManagement.AddChild(ChatGLMPermissions.PromptWordTypeManagement.Update, L("Permission:Update"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<ChatGLMResource>(name);
}
}
}
\ No newline at end of file
namespace BBM.ChatGLM.Permissions
{
public static class ChatGLMPermissions
{
public const string GroupName = "ChatGLM";
public static class UsersManagement
{
public const string Default = GroupName + ".Users";
public const string Query = Default + ".Query";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
public const string Chat = Default + ".Chat";
public const string ResetPassword = Default + ".ResetPassword";
}
public static class PromptWordManagement
{
public const string Default = GroupName + ".PromptWord";
public const string Query = Default + ".Query";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
}
public static class PromptWordTypeManagement
{
public const string Default = GroupName + ".PromptWordType";
public const string Query = Default + ".Query";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
}
}
}
\ No newline at end of file

using BBM.ChatGLM.Dtos;
using Volo.Abp.Application.Dtos;
namespace BBM.ChatGLM.PromptWord
{
public interface IPromptWordsAppService : IApplicationService
{
Task<PromptWordDto> CreateAsync(PromptWordCreateInput input);
Task<PromptWordDto> UpdateAsync(PromptWordUpdateInput input);
Task<int> DeleteAsync(GuidIdInput input);
Task<PagedResultDto<PromptWordDto>> PageAsync(PromptWordPageInput input);
}
}
using BBM.ChatGLM.Dtos;
using Volo.Abp.Application.Dtos;
namespace BBM.ChatGLM.PromptWordType
{
public interface IPromptWordTypesAppService : IApplicationService
{
Task<PromptWordTypeDto> CreateAsync(PromptWordTypeCreateInput input);
Task<PromptWordTypeDto> UpdateAsync(PromptWordTypeUpdateInput input);
Task<int> DeleteAsync(GuidIdInput input);
Task<PagedResultDto<PromptWordTypeDto>> PageAsync(PromptWordTypePageInput input);
Task<List<string>> Top1000Async();
}
}
using BBM.ChatGLM.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace BBM.ChatGLM.User
{
public interface IUsersAppService
{
Task<IdentityUserDto> CreateAsync(UserCreateInput input);
Task<IdentityUserDto> UpdateAsync(UserUpdateInput input);
Task<bool> DeleteAsync(GuidIdInput input);
Task<bool> ResetPasswordAsync(UserResetPasswordInput input);
Task<PagedResultDto<UserDto>> PageAsync(UserPageInput input);
Task<List<string>> GetRolesAsync();
Task<string> GetTokenAsync();
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>BBM.ChatGLM</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BBM.ChatGLM.Domain\BBM.ChatGLM.Domain.csproj" />
<ProjectReference Include="..\BBM.ChatGLM.Application.Contracts\BBM.ChatGLM.Application.Contracts.csproj" />
<ProjectReference Include="..\BBM.ChatGLM.FreeSqlRepository\BBM.ChatGLM.FreeSqlRepository.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" />
<PackageReference Include="Lion.AbpPro.BasicManagement.Application" />
<PackageReference Include="Lion.AbpPro.NotificationManagement.Application" />
<PackageReference Include="Lion.AbpPro.DataDictionaryManagement.Application" />
</ItemGroup>
</Project>
namespace BBM.ChatGLM
{
/* Inherit your application services from this class.
*/
public abstract class ChatGLMAppService : ApplicationService
{
protected ChatGLMAppService()
{
LocalizationResource = typeof(ChatGLMResource);
}
}
}
using BBM.ChatGLM.ChatSession.Aggregates;
using BBM.ChatGLM.Dtos;
using BBM.ChatGLM.PromptWord;
using BBM.ChatGLM.PromptWordType.Aggregates;
using Volo.Abp.Identity;
namespace BBM.ChatGLM
{
public class ChatGLMApplicationAutoMapperProfile : Profile
{
public ChatGLMApplicationAutoMapperProfile()
{
CreateMap<PromptWords, PromptWordDto>();
CreateMap<PromptWordTypes, PromptWordTypeDto>();
CreateMap<IdentityUser, IdentityUserDto>();
CreateMap<IdentityUser, UserDto>();
CreateMap<ChatSessions, ChatSessionDto>();
}
}
}
using Lion.AbpPro.DataDictionaryManagement;
namespace BBM.ChatGLM
{
[DependsOn(
typeof(ChatGLMDomainModule),
typeof(ChatGLMApplicationContractsModule),
typeof(BasicManagementApplicationModule),
typeof(NotificationManagementApplicationModule),
typeof(DataDictionaryManagementApplicationModule),
typeof(ChatGLMFreeSqlModule)
)]
public class ChatGLMApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<ChatGLMApplicationModule>();
});
}
}
}
using BBM.ChatGLM.ChatSession.Aggregates;
using BBM.ChatGLM.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Guids;
namespace BBM.ChatGLM.ChatSession
{
[Authorize]
public class ChatSessionsAppService : ChatGLMAppService, IChatSessionsAppService
{
private readonly IGuidGenerator _guidGenerator;
private readonly ChatSessionsManager _chatSessionsManager;
public ChatSessionsAppService(IGuidGenerator guidGenerator, ChatSessionsManager chatSessionsManager)
{
_guidGenerator = guidGenerator;
_chatSessionsManager = chatSessionsManager;
}
[Authorize(ChatGLMPermissions.UsersManagement.Chat)]
public async Task<ChatSessionDto> CreateAsync(ChatSessionCreateInput input)
{
var data = await _chatSessionsManager.CreateAsync(new ChatSessions(_guidGenerator.Create(), input.Content, CurrentUser.Id, CurrentTenant.Id));
return ObjectMapper.Map<ChatSessions, ChatSessionDto>(data);
}
[Authorize(ChatGLMPermissions.UsersManagement.Chat)]
public async Task<ChatSessionDto> UpdateAsync(ChatSessionUpdateInput input)
{
var data = await _chatSessionsManager.UpdateAsync(input.Id, input.Content);
return ObjectMapper.Map<ChatSessions, ChatSessionDto>(data);
}
[Authorize(ChatGLMPermissions.PromptWordManagement.Query)]
public async Task<PagedResultDto<ChatSessionDto>> PageAsync(ChatSessionPageInput input)
{
var result = new PagedResultDto<ChatSessionDto>
{
TotalCount = await _chatSessionsManager.CountAsync(input.Filter)
};
result.Items = await _chatSessionsManager.PageAsync(input.Filter, input.PageSize, input.PageIndex);
return result;
}
}
}
// Global using directives
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Threading.Tasks;
global using Lion.AbpPro.BasicManagement;
global using Lion.AbpPro.NotificationManagement;
global using BBM.ChatGLM.FreeSqlRepository;
global using BBM.ChatGLM.Permissions;
global using Microsoft.AspNetCore.Authorization;
global using Microsoft.Extensions.Configuration;
global using Volo.Abp.Application.Services;
global using Volo.Abp.AutoMapper;
global using Volo.Abp.BackgroundJobs.Hangfire;
global using Volo.Abp.DependencyInjection;
global using Volo.Abp.Modularity;
global using Profile = AutoMapper.Profile;
\ No newline at end of file
namespace BBM.ChatGLM.Jobs
{
public class TestJob : IRecurringJob
{
public Task ExecuteAsync()
{
Console.WriteLine($"job 测试- {DateTime.Now}");
return Task.CompletedTask;
}
}
}
\ No newline at end of file
using BBM.ChatGLM.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Guids;
namespace BBM.ChatGLM.PromptWord
{
[Authorize]
public class PromptWordsAppService : ChatGLMAppService, IPromptWordsAppService
{
private readonly PromptWordsManager _promptWordsManager;
private readonly IGuidGenerator _guidGenerator;
public PromptWordsAppService(PromptWordsManager promptWordsManager, IGuidGenerator guidGenerator)
{
_promptWordsManager = promptWordsManager;
_guidGenerator = guidGenerator;
}
[Authorize(ChatGLMPermissions.PromptWordManagement.Create)]
public async Task<PromptWordDto> CreateAsync(PromptWordCreateInput input)
{
var data = await _promptWordsManager.CreateAsync(new PromptWords(_guidGenerator.Create(), input.Type, input.Content, CurrentTenant.Id));
return ObjectMapper.Map<PromptWords, PromptWordDto>(data);
}
[Authorize(ChatGLMPermissions.PromptWordManagement.Update)]
public async Task<PromptWordDto> UpdateAsync(PromptWordUpdateInput input)
{
var data = await _promptWordsManager.UpdateAsync(new PromptWords(input.Id, input.Type, input.Content));
return ObjectMapper.Map<PromptWords, PromptWordDto>(data);
}
[Authorize(ChatGLMPermissions.PromptWordManagement.Delete)]
public async Task<int> DeleteAsync(GuidIdInput input)
{
return await _promptWordsManager.DeleteAsync(input.Id);
}
[Authorize(ChatGLMPermissions.PromptWordManagement.Query)]
public async Task<PagedResultDto<PromptWordDto>> PageAsync(PromptWordPageInput input)
{
var result = new PagedResultDto<PromptWordDto>
{
TotalCount = await _promptWordsManager.CountAsync(input.Filter, input.Type)
};
var data = await _promptWordsManager.PageAsync(input.Filter, input.Type, input.PageSize, input.PageIndex);
result.Items = ObjectMapper.Map<List<PromptWords>, List<PromptWordDto>>(data);
return result;
}
}
}
using Volo.Abp.Guids;
using BBM.ChatGLM.Dtos;
using Volo.Abp.Application.Dtos;
using BBM.ChatGLM.PromptWordType.Aggregates;
namespace BBM.ChatGLM.PromptWordType
{
public class PromptWordTypesAppService : ChatGLMAppService, IPromptWordTypesAppService
{
private readonly PromptWordTypesManager _promptWordTypesManager;
private readonly IGuidGenerator _guidGenerator;
public PromptWordTypesAppService(PromptWordTypesManager promptWordTypesManager, IGuidGenerator guidGenerator)
{
_promptWordTypesManager = promptWordTypesManager;
_guidGenerator = guidGenerator;
}
[Authorize(ChatGLMPermissions.PromptWordTypeManagement.Create)]
public async Task<PromptWordTypeDto> CreateAsync(PromptWordTypeCreateInput input)
{
var data = await _promptWordTypesManager.CreateAsync(new PromptWordTypes(_guidGenerator.Create(), input.Type, CurrentTenant.Id));
return ObjectMapper.Map<PromptWordTypes, PromptWordTypeDto>(data);
}
[Authorize(ChatGLMPermissions.PromptWordTypeManagement.Update)]
public async Task<PromptWordTypeDto> UpdateAsync(PromptWordTypeUpdateInput input)
{
var data = await _promptWordTypesManager.UpdateAsync(new PromptWordTypes(input.Id, input.Type));
return ObjectMapper.Map<PromptWordTypes, PromptWordTypeDto>(data);
}
[Authorize(ChatGLMPermissions.PromptWordTypeManagement.Delete)]
public async Task<int> DeleteAsync(GuidIdInput input)
{
return await _promptWordTypesManager.DeleteAsync(input.Id);
}
[Authorize(ChatGLMPermissions.PromptWordTypeManagement.Query)]
public async Task<PagedResultDto<PromptWordTypeDto>> PageAsync(PromptWordTypePageInput input)
{
var result = new PagedResultDto<PromptWordTypeDto>
{
TotalCount = await _promptWordTypesManager.CountAsync(input.Filter)
};
var data = await _promptWordTypesManager.PageAsync(input.Filter, input.PageSize, input.PageIndex);
result.Items = ObjectMapper.Map<List<PromptWordTypes>, List<PromptWordTypeDto>>(data);
return result;
}
[Authorize(ChatGLMPermissions.PromptWordTypeManagement.Query)]
public async Task<List<string>> Top1000Async()
{
var data = await _promptWordTypesManager.PageAsync(null, 1000, 0);
return data.Select(x => x.Type).ToList();
}
}
}
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleToAttribute("BBM.ChatGLM.Application.Tests")]
using BBM.ChatGLM.Dtos;
using Lion.AbpPro.BasicManagement.Roles;
using Lion.AbpPro.BasicManagement.Users;
using NetTopologySuite.Mathematics;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
using System.Text.Json;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Identity;
namespace BBM.ChatGLM.User
{
[Authorize]
public class UsersAppService : ChatGLMAppService, IUsersAppService
{
private readonly IdentityUserManager _userManager;
private readonly IUserAppService _userAppService;
private readonly UsersManager _usersManager;
private readonly IRoleAppService _roleAppService;
private readonly IConfiguration _configuration;
public UsersAppService(IdentityUserManager userManager, IUserAppService userAppService, UsersManager usersManager, IConfiguration configuration)
{
_userManager = userManager;
_userAppService = userAppService;
_usersManager = usersManager;
_configuration = configuration;
}
[Authorize(ChatGLMPermissions.UsersManagement.Query)]
public async Task<PagedResultDto<UserDto>> PageAsync(UserPageInput input)
{
var result = new PagedResultDto<UserDto>
{
TotalCount = await _usersManager.CountAsync(input.Name, input.Enabled)
};
result.Items = await _usersManager.PageAsync(input.Name, input.PageSize, input.PageIndex, input.Enabled);
return result;
}
[Authorize(ChatGLMPermissions.UsersManagement.Create)]
public async Task<IdentityUserDto> CreateAsync(UserCreateInput input)
{
var identityUser = new IdentityUserCreateDto
{
UserName = input.UserName,
Password = input.Password,
Name = input.Name,
RoleNames = new string[] { input.Role },
Email = "zs@baibaomen.com"
};
return await _userAppService.CreateAsync(identityUser);
}
[Authorize(ChatGLMPermissions.UsersManagement.Update)]
public async Task<IdentityUserDto> UpdateAsync(UserUpdateInput input)
{
var user = await _userManager.GetByIdAsync(input.Id);
await _userManager.SetRolesAsync(user, new string[] { input.Role });
var u = await _userManager.FindByIdAsync(input.Id.ToString());
u.Name = input.Name;
u.SetIsActive(input.IsActive);
await _userManager.UpdateAsync(u);
return ObjectMapper.Map<IdentityUser, IdentityUserDto>(user);
}
[Authorize(ChatGLMPermissions.UsersManagement.ResetPassword)]
public async Task<bool> ResetPasswordAsync(UserResetPasswordInput input)
{
var user = await _userManager.GetByIdAsync(input.Id);
var token = await _userManager.GeneratePasswordResetTokenAsync(user);
var result = await _userManager.ResetPasswordAsync(user, token, input.Password);
return result.Succeeded;
}
[Authorize(ChatGLMPermissions.UsersManagement.Delete)]
public async Task<bool> DeleteAsync(GuidIdInput input)
{
var user = await _userManager.FindByIdAsync(input.Id.ToString());
if (user == null)
{
return false;
}
user.IsDeleted = true;
var result = await _userManager.UpdateAsync(user);
return result.Succeeded;
}
[Authorize(ChatGLMPermissions.UsersManagement.Query)]
public async Task<List<string>> GetRolesAsync()
{
var user = CurrentUser.Name;
var roles = await _usersManager.GetRolesAsync();
return roles.WhereIf(user == "admin", item => item.Name != "admin").Select(role => role.Name).ToList();
}
[Authorize(ChatGLMPermissions.UsersManagement.Chat)]
public async Task<string> GetTokenAsync()
{
var client = new HttpClient();
var apiKey = _configuration.GetValue<string>("App:ApiKey");
var url = $"https://glm-api.baibaomen.com/token?appkey={apiKey}";
try
{
var response = await client.GetAsync(url);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
var data = JsonSerializer.Deserialize<TokenObject>(content);
return data.token;
}
else
{
throw new BusinessException("BBM.ChatGLM:100012");
}
}
catch
{
throw new BusinessException("BBM.ChatGLM:100012");
}
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" />
<PackageReference Include="Serilog.Sinks.Async" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Serilog.Sinks.Console" />
<PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BBM.ChatGLM.Application.Contracts\BBM.ChatGLM.Application.Contracts.csproj" />
<ProjectReference Include="..\BBM.ChatGLM.EntityFrameworkCore\BBM.ChatGLM.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
namespace BBM.ChatGLM.DbMigrator
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(ChatGLMEntityFrameworkCoreModule),
typeof(ChatGLMApplicationContractsModule)
)]
public class ChatGLMDbMigratorModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpBackgroundJobOptions>(options => options.IsJobExecutionEnabled = false);
}
}
}
namespace BBM.ChatGLM.DbMigrator
{
public class DbMigratorHostedService : IHostedService
{
private readonly IHostApplicationLifetime _hostApplicationLifetime;
private readonly IConfiguration _configuration;
private readonly IHostEnvironment _hostEnvironment;
public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime,
IConfiguration configuration, IHostEnvironment hostEnvironment)
{
_hostApplicationLifetime = hostApplicationLifetime;
_configuration = configuration;
_hostEnvironment = hostEnvironment;
}
public async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = await AbpApplicationFactory.CreateAsync<ChatGLMDbMigratorModule>(options =>
{
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
}))
{
await application.InitializeAsync();
var conn = _configuration.GetValue<string>("ConnectionStrings:Default");
Console.WriteLine("ConnectionStrings:" + conn);
var s = _hostEnvironment.EnvironmentName;
Console.WriteLine("EnvironmentName:" + s);
await application
.ServiceProvider
.GetRequiredService<ChatGLMDbMigrationService>()
.MigrateAsync();
await application.ShutdownAsync();
_hostApplicationLifetime.StopApplication();
}
}
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
}
FROM mcr.microsoft.com/dotnet/aspnet:6.0
# 创建目录
RUN mkdir /app
COPY publish /app
# 设置工作目录
WORKDIR /app
# 设置时区 .net6 才有这个问题
ENV TZ=Asia/Shanghai
# 设置环境变量
ENV ASPNETCORE_ENVIRONMENT=Production
ENTRYPOINT ["dotnet", "BBM.ChatGLM.DbMigrator.dll"]
// Global using directives
global using System;
global using System.IO;
global using System.Threading;
global using System.Threading.Tasks;
global using BBM.ChatGLM.Data;
global using BBM.ChatGLM.EntityFrameworkCore;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Hosting;
global using Microsoft.Extensions.Logging;
global using Serilog;
global using Serilog.Events;
global using Volo.Abp;
global using Volo.Abp.Autofac;
global using Volo.Abp.BackgroundJobs;
global using Volo.Abp.Modularity;
\ No newline at end of file
namespace BBM.ChatGLM.DbMigrator
{
class Program
{
static async Task Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning)
#if DEBUG
.MinimumLevel.Override("BBM.ChatGLM", LogEventLevel.Debug)
#else
.MinimumLevel.Override("BBM.ChatGLM", LogEventLevel.Information)
#endif
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
await CreateHostBuilder(args).RunConsoleAsync();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureLogging((context, logging) => logging.ClearProviders())
.ConfigureAppConfiguration
(
otpions =>
{
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
var appSettingFileName = "appsettings.json";
if (!environment.IsNullOrWhiteSpace())
appSettingFileName = $"appsettings.{environment}.json";
otpions.AddJsonFile(appSettingFileName, optional: true);
}
)
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<DbMigratorHostedService>();
});
}
}
{
"ConnectionStrings": {
"Default": "Host=yg-sql-dev-wan.pg.rds.aliyuncs.com;Port=5432;Database=BBMChatGLM;User ID=yg;Password=YG@sql!dev2022123;"
}
}
\ No newline at end of file
{
"KeyId": "f788zGVUZh9H-HbWL1S-Mg",
"Parameters": {
"D": "F19hbC5PLO872DszGiJnVoU55ee7XGXmNf0KEKndJ/uGBv5lWklXA0QF80h1ytWXde0jV5isQPB1t7mPhRQlDoDTkywLi1CeOgBPbxzHEfLjZZ5c4olfeX0IJX9BDqgUntY0H1a/+Om/eDu4OZUz3EIJFFZBgz46YZSyTT6ZDvAEdpC/o66sNJmxvJIp+8zVoVDSqBUzxmc+oEamXLg7r2jdymxJMxau1kQFxEGLOrJnNxGsEe8UrYA3qSsm8m/Xg4uOh7RYgnuEEt88+KTvRq+CAMWhN3YNLtOJ3NmXowwE7e1Ma+jih9+UVfxZn14P5+SOJbQ2bYV2sCV+2vBiCQ==",
"DP": "oPiGO/qdOQfFEAS9fMInQnsrNylIZVpDYEVoDJ6/jQfE/IpuwxGcmsaGvCob3SKxZiJRLCWpwJYo1hCh/JOSVGWMkVyELky56nbbkkV5ymKLSGZ4JoetdQs+GchnPdR+k2P9Ij1Kjk13ylubN3htzNhcBASJpOfSEv5pPVzGKX0=",
"DQ": "z6imxLABHkyftbfUUtpeOlPanEHgpuIjmUdp3T1Ju1jziE63UEhuj0GPAXOF17uYxixwYE8JhOJ7+TyIK9oZeI3zH2OzJqQh8f5PCQ/E+0ULXZDeNV/ShDLCTufu3Fis9Rt64uTp/H/l21oMQ79jc0ysa8DTz1ReJLRc5qjL41U=",
"Exponent": "AQAB",
"InverseQ": "ieZcvSt5XYukKJKhXpv5Dm/1RD7iH88cZnhLSTEVTMoOUHoYWmApY5pNLGahbfjA9bxnkBWDYex/i7wE9uNNY5CsA6ovUaQLVJDt3kHvR9W+9QtN8D6jjG2TuRbbOdEg4RqhfjUaDfDIgTJX2Wxc8U98FOvOyGw1HzwUPFZKecM=",
"Modulus": "vk4z1Bmtmbo+gxITcY+FIlXzcO2wTOGlOXK5GMYj/6PUMFt7lbqkc72AkPsrAo5/JE8LYLhWj7fzSKbjvtowHCz5m2t+FlUYmuiKpvvnJsTqvQrckNlbZ1nm071q5PhP3Dar/OksfBhPtAX+c3+NjDnM/w53ccJJNaBDO/s9JYoN7vH5n6ed1pMSK71hmg4MPsxChcnc1f1PpnG2mqyJ253+GEUbj/kRyeBSmCCr9aadov2ZzxIKVaFNagJEHOzanQmorSLpP25GfOHCuy27Zkef94V/qU9elzjbH4uIKslVGx5T6H99TYh0sUGu11NytYJa5WNAZWow95CzurC2vw==",
"P": "4GMCQy+XTNzR5TsgFcdAZv2K6TcQR13fHVvPoxQp/b32V5YUJOBFEUAtqociy5ro4+KzpXP5WPSk1ZtznGKuNZyLq8gTnhpB3rwd0sdo4zxKnQ5nu+n1UhlhWNxg5A9V5TaciUAyPrHWJfLoYTQWygNTgJELQH5zZXi2ihC2uiU=",
"Q": "2R36pamnLAJggkPJxiW5qH6HizZ+bkQVg0BBftMLzkAM8Y9CwTW75GRUzGEJFpMckkw0GZSYb1Uwl3DVUpkcQ8LZ91IPYdPpDlYUshhIxl184M55pnO14besKxJtMZ64zhHKVAR2pBMO0n6W4/1iBXkkQqyPViJxdfvXPJMBbhM="
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>BBM.ChatGLM</RootNamespace>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\ChatGLM\*.json" />
<Content Remove="Localization\ChatGLM\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lion.AbpPro.Core" />
<PackageReference Include="Lion.AbpPro.BasicManagement.Domain.Shared" />
<PackageReference Include="Lion.AbpPro.NotificationManagement.Domain.Shared" />
<PackageReference Include="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" />
</ItemGroup>
</Project>
namespace BBM.ChatGLM
{
public static class ChatGLMDomainErrorCodes
{
}
}
namespace BBM.ChatGLM;
public class ChatGLMDomainSharedConsts
{
/// <summary>名称空间</summary>
public const string NameSpace = "BBM.ChatGLM";
/// <summary>默认语言</summary>
public const string DefaultCultureName = "zh-Hans";
}
\ No newline at end of file
using Lion.AbpPro.BasicManagement;
using Lion.AbpPro.BasicManagement.Localization;
using Lion.AbpPro.Core;
using Lion.AbpPro.DataDictionaryManagement;
using Lion.AbpPro.NotificationManagement;
namespace BBM.ChatGLM
{
[DependsOn(
typeof(BasicManagementDomainSharedModule),
typeof(NotificationManagementDomainSharedModule),
typeof(DataDictionaryManagementDomainSharedModule),
typeof(LionAbpProCoreModule)
)]
public class ChatGLMDomainSharedModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
ChatGLMGlobalFeatureConfigurator.Configure();
ChatGLMModuleExtensionConfigurator.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<ChatGLMDomainSharedModule>(ChatGLMDomainSharedConsts.NameSpace);
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<ChatGLMResource>(ChatGLMDomainSharedConsts.DefaultCultureName)
.AddVirtualJson("/Localization/ChatGLM")
.AddBaseTypes(typeof(BasicManagementResource))
.AddBaseTypes(typeof(AbpTimingResource));
options.DefaultResourceType = typeof(ChatGLMResource);
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace(ChatGLMDomainSharedConsts.NameSpace, typeof(ChatGLMResource));
});
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment