Przeglądaj źródła

mv DefaultSession xf.domain

xf 1 rok temu
rodzic
commit
f1468ade1d

+ 0 - 11
src/Hotline.Api/Context/ClaimExtensions.cs

@@ -1,11 +0,0 @@
-using System.Security.Claims;
-
-namespace Hotline.Api.Token;
-
-public static class ClaimExtensions
-{
-    public static string? FindFirstValue(this ClaimsPrincipal user, string claimType)
-    {
-        return user.Claims.FirstOrDefault(d => d.Type == claimType)?.Value;
-    }
-}

+ 0 - 1
src/Hotline.Api/Hotline.Api.csproj

@@ -10,7 +10,6 @@
 
   <ItemGroup>
     <PackageReference Include="FluentValidation.AspNetCore" Version="11.2.2" />
-    <PackageReference Include="IdentityModel" Version="6.0.0" />
     <PackageReference Include="Mapster.DependencyInjection" Version="1.0.0" />
     <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.10" />
     <PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.8" />

+ 0 - 2
src/Hotline.Application/Hotline.Application.csproj

@@ -8,9 +8,7 @@
 
   <ItemGroup>
     <PackageReference Include="Dapr.AspNetCore" Version="1.9.0" />
-    <PackageReference Include="IdentityModel" Version="6.0.0" />
     <PackageReference Include="XC.RSAUtil" Version="1.3.6" />
-    <PackageReference Include="XF.Utility.AppIdentityModel" Version="1.0.4" />
   </ItemGroup>
 
   <ItemGroup>

+ 5 - 0
src/Hotline.Share/Dtos/FlowEngine/WorkflowStepDto.cs

@@ -100,6 +100,11 @@ public class WorkflowStepDto
     /// </summary>
     public string? OrgAreaCode { get; set; }
 
+    /// <summary>
+    /// 办理人部门行政区划名称
+    /// </summary>
+    public string? OrgAreaName { get; set; }
+
     /// <summary>
     /// 办理完成时间
     /// </summary>

+ 6 - 0
src/Hotline/FlowEngine/Workflows/StepBasicEntity.cs

@@ -108,6 +108,12 @@ public abstract class StepBasicEntity : CreationEntity
     [SugarColumn(IsNullable = true)]
     public string? OrgAreaCode{ get; set; }
 
+    /// <summary>
+    /// 部门行政区划名称
+    /// </summary>
+    [SugarColumn(IsNullable = true)]
+    public string? OrgAreaName{ get; set; }
+
     /// <summary>
     /// 办理完成时间
     /// </summary>

+ 1 - 1
src/XF.Domain.Repository/XF.Domain.Repository.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <Version>1.0.2</Version>
+    <Version>1.0.4</Version>
   </PropertyGroup>
 
   <ItemGroup>

+ 5 - 7
src/Hotline.Api/Context/DefaultSessionContext.cs → src/XF.Domain/Authentications/DefaultSessionContext.cs

@@ -1,19 +1,15 @@
 using System.Security.Authentication;
 using System.Security.Claims;
-using Hotline.Repository.SqlSugar;
-using Hotline.Users;
 using IdentityModel;
-using SqlSugar;
-using XF.Domain.Authentications;
+using Microsoft.AspNetCore.Http;
 using XF.Domain.Dependency;
-using XF.Domain.Exceptions;
 using XF.Utility.AppIdentityModel;
 
-namespace Hotline.Api.Token
+namespace XF.Domain.Authentications
 {
     public class DefaultSessionContext : ISessionContext, IScopeDependency
     {
-        public DefaultSessionContext(IHttpContextAccessor httpContextAccessor, ISugarUnitOfWork<HotlineDbContext> uow)
+        public DefaultSessionContext(IHttpContextAccessor httpContextAccessor)
         {
             var httpContext = httpContextAccessor.HttpContext;
             if (httpContext is null)
@@ -30,6 +26,7 @@ namespace Hotline.Api.Token
             OrgId = user.FindFirstValue(AppClaimTypes.DepartmentId);
             OrgCode = user.FindFirstValue(AppClaimTypes.DepartmentCode);
             OrgName = user.FindFirstValue(AppClaimTypes.DepartmentName);
+            ClientId = user.FindFirstValue(JwtClaimTypes.ClientId);
         }
 
         /// <summary>
@@ -57,5 +54,6 @@ namespace Hotline.Api.Token
         public string? OrgName { get; set; }
         public string RequiredOrgId => OrgId ?? throw new ArgumentNullException();
         public string RequiredOrgCode => OrgCode ?? throw new ArgumentNullException();
+        public string? ClientId { get; }
     }
 }

+ 2 - 0
src/XF.Domain/Authentications/ISessionContext.cs

@@ -37,5 +37,7 @@ public interface ISessionContext
 
     string RequiredOrgId { get; }
     string RequiredOrgCode { get; }
+
+    string? ClientId { get; }
 }
 

+ 3 - 1
src/XF.Domain/XF.Domain.csproj

@@ -5,17 +5,19 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <Version>1.0.6</Version>
+    <Version>1.0.8</Version>
     <Authors>xf</Authors>
   </PropertyGroup>
 
   <ItemGroup>
+    <PackageReference Include="IdentityModel" Version="6.1.0" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
     <PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
     <PackageReference Include="Serilog.Enrichers.Span" Version="2.3.0" />
     <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.25.1" />
     <PackageReference Include="XF.Utility.UnifyResponse" Version="1.0.6" />
+    <PackageReference Include="XF.Utility.AppIdentityModel" Version="1.0.4" />
   </ItemGroup>
 
 </Project>