.gitignore
@@ -13,3 +13,11 @@ DocumentServiceAPI.Web.Entry/obj/ DocumentServiceAPI.Model/bin/ DocumentServiceAPI.Utility/bin/ Document.Model/obj/Document.Model.csproj.nuget.dgspec.json Document.Model/obj/Document.Model.csproj.nuget.g.props Document.Model/obj/project.assets.json Document.Model/obj/Debug/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs Document.Model/obj/Debug/net6.0/Document.Model.AssemblyInfo.cs Document.Model/obj/Debug/net6.0/Document.Model.AssemblyInfoInputs.cache Document.Model/obj/ Document.Unility/obj/ .vs/DocumentServiceAPI/DesignTimeBuild/.dtbcache.v2Binary files differ
Document.Model/Document.Model.csproj
New file @@ -0,0 +1,17 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <PackageReference Include="SqlSugarCore" Version="5.1.4.93" /> </ItemGroup> <ItemGroup> <Folder Include="DTO\" /> </ItemGroup> </Project> Document.Model/SQL/Document_UserInfo.cs
New file @@ -0,0 +1,32 @@ using SqlSugar; namespace Document.Model { [SugarTable("Document_UserInfo")] public class Document_UserInfo { /// <summary> /// 账号 /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "账号")] public int UserId { get; set; } /// <summary> /// 用户名称 /// </summary> [SugarColumn(Length = 50, ColumnDescription = "用户名称")] public string UserName { get; set; } /// <summary> /// 是否管理员 /// </summary> [SugarColumn(ColumnDescription = "是否管理员")] public int IsManager { get; set; } /// <summary> /// 是否启用 /// </summary> [SugarColumn(ColumnDescription = "是否启用")] public int IsUsed { get; set; } } } Document.Unility/Document.Unility.csproj
New file @@ -0,0 +1,19 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <PackageReference Include="NLog" Version="5.2.2" /> </ItemGroup> <ItemGroup> <None Update="NLog.config"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> </Project> Document.Unility/NLog.config
New file @@ -0,0 +1,27 @@ <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"> <targets> <target xsi:type="File" name="info_file" fileName="${basedir}/logs/${shortdate}_info.log" layout="${longdate} ${uppercase:${level}} ${message}"/> <target xsi:type="File" name="error_file" fileName="${basedir}/logs/${shortdate}_error.log" layout="${longdate} ${uppercase:${level}} ${message} ${exception:stacktrace}" /> <!-- Write events to a file with the date in the filename. <target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate} ${uppercase:${level}} ${message}" /> --> </targets> <rules> <logger name="*" minlevel="Info" maxlevel="Info" writeTo="info_file" /> <logger name="*" minlevel="Error" maxlevel="Error" writeTo="error_file" /> <!-- Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f" <logger name="*" minlevel="Debug" writeTo="f" /> --> </rules> </nlog> Document.Unility/NLogProvider.cs
New file @@ -0,0 +1,59 @@ using NLog; namespace Document.Unility { public class NLogProvider { private NLogProvider() { logger = LogManager.GetLogger("Logger");//.GetCurrentClassLogger(); } private readonly Logger logger = null; private static NLogProvider logProvider = null; /// <summary> /// 静态实例 /// </summary> /// <returns></returns> public static NLogProvider GetInstance() { if (logProvider == null) { logProvider = new NLogProvider(); } return logProvider; } /// <summary> /// Info /// </summary> /// <param name="txt"></param> public void Info(string txt) { if (logger != null) logger.Info(txt); } /// <summary> /// Error /// </summary> /// <param name="er"></param> public void Error(Exception er) { if (logger != null) logger.Error(er); } /// <summary> /// Error /// </summary> /// <param name="str"></param> public void Error(string str) { if (logger != null) logger.Error(str); } } } Document.Unility/PageBaseSearch.cs
New file @@ -0,0 +1,28 @@ namespace Document.Unility { /// <summary> /// 分页查询条件基类 /// </summary> public class PageBaseSearch { /// <summary> /// 页码 /// </summary> public int PageIndex { get; set; } = 1; /// <summary> /// 分页大小 /// </summary> public int PageSize { get; set; } = 20; /// <summary> /// 开始日期 /// </summary> public DateTime? StartTime { get; set; } /// <summary> /// 结束日期 /// </summary> public DateTime? EndTime { get; set; } } } Document.Unility/PageResult.cs
New file @@ -0,0 +1,35 @@ namespace Document.Unility { /// <summary> /// 分页数据信息 /// </summary> /// <typeparam name="T"></typeparam> public class PageResult<T> { /// <summary> /// 页码 /// </summary> public int PageIndex { get; set; } /// <summary> /// 分页大小 /// </summary> public int PageSize { get; set; } /// <summary> /// 页总数 /// </summary> public int TotalPage { get; set; } /// <summary> /// 记录总数 /// </summary> public int TotalCount { get; set; } /// <summary> /// 记录集合 /// </summary> public List<T> Items { get; set; } = new(); } } DocumentServiceAPI.Application/DocumentServiceAPI.Application.csproj
@@ -25,8 +25,4 @@ <ProjectReference Include="..\DocumentServiceAPI.Core\DocumentServiceAPI.Core.csproj" /> </ItemGroup> <ItemGroup> <Folder Include="System\Services\" /> </ItemGroup> </Project> DocumentServiceAPI.Application/GlobalUsings.cs
DocumentServiceAPI.Application/System/Services/SystemService.cs
@@ -1,4 +1,6 @@ namespace DocumentServiceAPI.Application; using DocumentServiceAPI.Core; namespace DocumentServiceAPI.Application; public class SystemService : ISystemService, ITransient { DocumentServiceAPI.Core/DocumentServiceAPI.Core.csproj
@@ -17,7 +17,7 @@ <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.38" /> <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.38" /> <PackageReference Include="Furion.Pure" Version="4.8.8.38" /> <PackageReference Include="SqlSugarCore" Version="5.1.4.89" /> <PackageReference Include="SqlSugarCore" Version="5.1.4.93" /> </ItemGroup> <ItemGroup> DocumentServiceAPI.Web.Core/Startup.cs
@@ -1,4 +1,5 @@ using Furion; using DocumentServiceAPI.Core; using Furion; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; @@ -13,6 +14,7 @@ services.AddConsoleFormatter(); services.AddJwt<JwtHandler>(); services.AddCorsAccessor(); services.AddControllers() DocumentServiceAPI.Web.Entry/appsettings.json
@@ -18,7 +18,6 @@ } ], //swags 名称配置 默认分组 "[openapi:Default]": { "Title": "标书管理系统服务", @@ -50,6 +49,5 @@ "ClockSkew": 5, // 过期时间容错值,long 类型,单位秒,默认 5秒 "Algorithm": "HS256" // 加密算法,string 类型,默认 HS256 } }