Skip to content

Commit

Permalink
Merge branch 'dev/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
gmf520 committed Jan 12, 2024
2 parents 47ba926 + 58cd226 commit daac4ce
Show file tree
Hide file tree
Showing 20 changed files with 180 additions and 83 deletions.
4 changes: 2 additions & 2 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>
<PropertyGroup>
<VersionMain>8.0</VersionMain>
<VersionPrefix>0</VersionPrefix>
<VersionPrefix>1</VersionPrefix>
<VersionSuffix>-preview.</VersionSuffix>
<VersionSuffixVersion>1120</VersionSuffixVersion>
<VersionSuffixVersion>113</VersionSuffixVersion>
<Version>$(VersionMain).$(VersionPrefix)$(VersionSuffix)$(VersionSuffixVersion)</Version>
<FileVersion>$(VersionMain).$(VersionPrefix).$(VersionSuffixVersion)</FileVersion>
<!--<Version>$(VersionMain).$(VersionPrefix)</Version>
Expand Down
4 changes: 2 additions & 2 deletions samples/web/Liuliu.Demo.Web/Liuliu.Demo.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<PackageReference Include="AspectCore.Extensions.Hosting" Version="2.4.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="[6.0.22, 7.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="[6.0.22, 7.0.0)">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="[6.0.26, 7.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="[6.0.26, 7.0.0)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
47 changes: 26 additions & 21 deletions samples/web/Liuliu.Demo.WebApi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj", "samples/web/Liuliu.Demo.WebApi/"]
COPY ["src/OSharp.EntityFrameworkCore.Sqlite/OSharp.EntityFrameworkCore.Sqlite.csproj", "src/OSharp.EntityFrameworkCore.Sqlite/"]
COPY ["src/OSharp.EntityFrameworkCore/OSharp.EntityFrameworkCore.csproj", "src/OSharp.EntityFrameworkCore/"]
COPY ["src/OSharp.Utils/OSharp.Utils.csproj", "src/OSharp.Utils/"]
COPY ["src/OSharp/OSharp.csproj", "src/OSharp/"]
COPY ["src/OSharp.MiniProfiler/OSharp.MiniProfiler.csproj", "src/OSharp.MiniProfiler/"]
COPY ["src/OSharp.AspNetCore/OSharp.AspNetCore.csproj", "src/OSharp.AspNetCore/"]
COPY ["src/OSharp.Swagger/OSharp.Swagger.csproj", "src/OSharp.Swagger/"]
COPY ["src/OSharp.Log4Net/OSharp.Log4Net.csproj", "src/OSharp.Log4Net/"]
COPY ["src/OSharp.AutoMapper/OSharp.AutoMapper.csproj", "src/OSharp.AutoMapper/"]
COPY ["src/OSharp.Hosting.Apis/OSharp.Hosting.Apis.csproj", "src/OSharp.Hosting.Apis/"]
COPY ["src/OSharp.Hosting.EntityConfiguration/OSharp.Hosting.EntityConfiguration.csproj", "src/OSharp.Hosting.EntityConfiguration/"]
COPY ["src/OSharp.Hosting.Core/OSharp.Hosting.Core.csproj", "src/OSharp.Hosting.Core/"]
COPY ["src/OSharp.Authorization.Functions/OSharp.Authorization.Functions.csproj", "src/OSharp.Authorization.Functions/"]
COPY ["src/OSharp.Identity/OSharp.Identity.csproj", "src/OSharp.Identity/"]
COPY ["src/OSharp.Authorization.Datas/OSharp.Authorization.Datas.csproj", "src/OSharp.Authorization.Datas/"]
COPY ["src/OSharp.AspNetCore/OSharp.AspNetCore.csproj", "src/OSharp.AspNetCore/"]
COPY ["src/OSharp.EntityFrameworkCore/OSharp.EntityFrameworkCore.csproj", "src/OSharp.EntityFrameworkCore/"]
COPY ["src/OSharp.EntityFrameworkCore.MySql/OSharp.EntityFrameworkCore.MySql.csproj", "src/OSharp.EntityFrameworkCore.MySql/"]
COPY ["src/OSharp.Hangfire/OSharp.Hangfire.csproj", "src/OSharp.Hangfire/"]
COPY ["src/OSharp.EntityFrameworkCore.PostgreSql/OSharp.EntityFrameworkCore.PostgreSql.csproj", "src/OSharp.EntityFrameworkCore.PostgreSql/"]
COPY ["src/OSharp.Redis/OSharp.Redis.csproj", "src/OSharp.Redis/"]
COPY ["src/OSharp.EntityFrameworkCore.Sqlite/OSharp.EntityFrameworkCore.Sqlite.csproj", "src/OSharp.EntityFrameworkCore.Sqlite/"]
COPY ["src/OSharp.EntityFrameworkCore.SqlServer/OSharp.EntityFrameworkCore.SqlServer.csproj", "src/OSharp.EntityFrameworkCore.SqlServer/"]
RUN dotnet restore "samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj"
COPY ["src/OSharp.Identity/OSharp.Identity.csproj", "src/OSharp.Identity/"]
COPY ["src/OSharp.Authorization.Functions/OSharp.Authorization.Functions.csproj", "src/OSharp.Authorization.Functions/"]
COPY ["src/OSharp.Authorization.Datas/OSharp.Authorization.Datas.csproj", "src/OSharp.Authorization.Datas/"]
COPY ["src/OSharp.Log4Net/OSharp.Log4Net.csproj", "src/OSharp.Log4Net/"]
COPY ["src/OSharp.MiniProfiler/OSharp.MiniProfiler.csproj", "src/OSharp.MiniProfiler/"]
COPY ["src/OSharp.Redis/OSharp.Redis.csproj", "src/OSharp.Redis/"]
COPY ["src/OSharp.Swagger/OSharp.Swagger.csproj", "src/OSharp.Swagger/"]
COPY ["src/OSharp.Hangfire/OSharp.Hangfire.csproj", "src/OSharp.Hangfire/"]
COPY ["src/OSharp.Hosting.Core/OSharp.Hosting.Core.csproj", "src/OSharp.Hosting.Core/"]
COPY ["src/OSharp.Hosting.EntityConfiguration/OSharp.Hosting.EntityConfiguration.csproj", "src/OSharp.Hosting.EntityConfiguration/"]
COPY ["src/OSharp.Hosting.Apis/OSharp.Hosting.Apis.csproj", "src/OSharp.Hosting.Apis/"]
COPY ["samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj", "samples/web/Liuliu.Demo.WebApi/"]

RUN dotnet restore "./samples/web/Liuliu.Demo.WebApi/./Liuliu.Demo.WebApi.csproj"
COPY . .
WORKDIR "/src/samples/web/Liuliu.Demo.WebApi"
RUN dotnet build "Liuliu.Demo.WebApi.csproj" -c Release -o /app/build
RUN dotnet build "./Liuliu.Demo.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
RUN dotnet publish "Liuliu.Demo.WebApi.csproj" -c Release -o /app/publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Liuliu.Demo.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
Expand Down
13 changes: 7 additions & 6 deletions samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,31 @@
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.25" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.26" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.26">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\..\..\src\OSharp.EntityFrameworkCore.Oracle\OSharp.EntityFrameworkCore.Oracle.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.14" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.15" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.14">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\..\..\src\OSharp.EntityFrameworkCore.Oracle\OSharp.EntityFrameworkCore.Oracle.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\..\..\src\OSharp.EntityFrameworkCore.Oracle\OSharp.EntityFrameworkCore.Oracle.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// <last-date>2019-04-18 20:57</last-date>
// -----------------------------------------------------------------------

#if !NET8_0_OR_GREATER

using System;
using System.ComponentModel;

Expand Down Expand Up @@ -47,4 +47,3 @@ protected override DefaultDbContext CreateDbContext(IServiceProvider scopedProvi
}
}
}
#endif
93 changes: 91 additions & 2 deletions samples/web/Liuliu.Demo.WebApi/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,99 @@
{
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"CaptchaOptions": {
"CaptchaType": 9, // 验证码类型
"CodeLength": 4, // 验证码长度, 要放在CaptchaType设置后 当类型为算术表达式时,长度代表操作的个数
"ExpirySeconds": 60, // 验证码过期秒数
"IgnoreCase": true, // 比较时是否忽略大小写
"StoreageKeyPrefix": "Common:Captcha:", // 存储键前缀
"ImageOption": {
"Animation": true, // 是否启用动画
"FontSize": 32, // 字体大小
"Width": 100, // 验证码宽度
"Height": 40, // 验证码高度
"BubbleMinRadius": 5, // 气泡最小半径
"BubbleMaxRadius": 15, // 气泡最大半径
"BubbleCount": 5, // 气泡数量
"BubbleThickness": 1.5, // 气泡边沿厚度
"InterferenceLineCount": 4, // 干扰线数量
"FontFamily": "actionj" // 包含中文时请使用kaiti。可设置字体:actionj,epilog,fresnel,headache,lexo,prefix,progbot,ransom,robot,scandal,kaiti
}
},
"OSharp": {
"DbContexts": {
"SqlServer": {
"DbContextTypeName": "OSharp.Entity.DefaultDbContext,OSharp.EntityFrameworkCore",
"ConnectionString": "Server=127.0.0.1;Database=osharpns-api-dev;User Id=sa;Password=Abc123456!;TrustServerCertificate=True;",
"DatabaseType": "SqlServer",
"AuditEntityEnabled": true,
"AutoMigrationEnabled": true
}
},
"MailSender": {
"Host": "smtp.66soft.net",
"Port": 465,
"EnableSsl": true,
"DisplayName": "OSharp邮件发送",
"UserName": "osharpsender@66soft.net",
"Password": "Cculm3WYoAjuEbwl"
},
"Jwt": {
"Issuer": "osharp identity",
"Audience": "osharp api client",
"Secret": "{8619F7C3-B53C-4B85-99F0-983D351ECD82}",
"AccessExpireMins": 20,
"RefreshExpireMins": 10080, // 7天
"IsRefreshAbsoluteExpired": false,
"Enabled": true
},
"Cookie": {
"Enabled": true
},
"Mvc": {
"IsLowercaseJsonProperty": true,
"IsLowercaseUrls": true
},
"Cors": {
"PolicyName": "MyCors",
"AllowAnyHeader": true,
"WithMethods": [ "POST", "PUT", "DELETE" ],
"WithOrigins": [],
"Enabled": true
},
"Redis": {
"Configuration": "localhost",
"InstanceName": "Liuliu.Demo:"
},
"Swagger": {
"Endpoints": [
{
"Title": "框架API",
"Version": "v1",
"Url": "/swagger/v1/swagger.json"
},
{
"Title": "业务API",
"Version": "buss",
"Url": "/swagger/buss/swagger.json"
}
],
"RoutePrefix": "swagger",
"IsHideSchemas": false,
"MiniProfiler": false,
"Enabled": true
},
"Hangfire": {
"WorkerCount": 20,
//"StorageConnectionString": "Server=.;Database=osharpns.hangfire-dev;User Id=sa;Password=Abc123456!;MultipleActiveResultSets=true",
"DashboardUrl": "/hangfire",
"Roles": ""
}
}
}
18 changes: 9 additions & 9 deletions src/OSharp.AspNetCore/OSharp.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[6.0.25, 7.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[6.0.25, 7.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[6.0.25, 7.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[6.0.26, 7.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[6.0.26, 7.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[6.0.26, 7.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[7.0.14, 8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[7.0.14, 8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[7.0.14, 8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[7.0.15, 8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[7.0.15, 8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[7.0.15, 8.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[8.0.0, 9.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[8.0.0, 9.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[8.0.0, 9.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[8.0.1, 9.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[8.0.1, 9.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[8.0.1, 9.0.0)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OSharp\OSharp.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
<Import Project="../../build/version.props" />

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<PackageId>OSharp.EntityFrameworkCore.Oracle</PackageId>
<Description>OSharp 数据访问组件,封装EntityFrameworkCore的Oracle数据访问功能的实现</Description>
<Summary>OSharp 数据访问组件Oracle</Summary>
<RootNamespace>OSharp.Entity.Oracle</RootNamespace>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="Oracle.EntityFrameworkCore" Version="[6.21.120, 7.0.0)" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="[6.21.130, 7.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Oracle.EntityFrameworkCore" Version="[7.21.12, 8.0.0)" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="[7.21.13, 8.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Oracle.EntityFrameworkCore" Version="[8.21.121, 9.0.0)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OSharp.EntityFrameworkCore\OSharp.EntityFrameworkCore.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="[7.0.11, 8.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="[8.0.0-rc.2, 9.0.0)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="[8.0.0, 9.0.0)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="[6.0.25, 7.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="[6.0.26, 7.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="[7.0.14, 8.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="[7.0.15, 8.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="[8.0.0, 9.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="[8.0.1, 9.0.0)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[6.0.25, 7.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[6.0.26, 7.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[7.0.14, 8.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[7.0.15, 8.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[8.0.0, 9.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[8.0.1, 9.0.0)" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit daac4ce

Please sign in to comment.