diff --git a/src/Token.ManagementApi.Host/.dockerignore b/.dockerignore
similarity index 90%
rename from src/Token.ManagementApi.Host/.dockerignore
rename to .dockerignore
index cd967fc3a29985bd1e9bcc194d6d804d35689a5c..3729ff0cd1acce411e814ec416b82ac0f239a4e0 100644
--- a/src/Token.ManagementApi.Host/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,5 @@
-**/.dockerignore
+**/.classpath
+**/.dockerignore
**/.env
**/.git
**/.gitignore
@@ -7,7 +8,6 @@
**/.toolstarget
**/.vs
**/.vscode
-**/.idea
**/*.*proj.user
**/*.dbmdl
**/*.jfm
diff --git a/.drone.yml b/.drone.yml
new file mode 100644
index 0000000000000000000000000000000000000000..5c14a11128513df3eb6da9719c45e7bfdf759622
--- /dev/null
+++ b/.drone.yml
@@ -0,0 +1,44 @@
+kind: pipeline
+name: managementapi
+type: docker
+
+platform:
+ os: linux
+ arch: amd64
+
+steps:
+ - name: managementapi
+ when:
+ branch:
+ - master
+ image: docker:dind
+ environment:
+ IMAGE: managementapi
+ ASPNETCORE_ENVIRONMENT: Development
+ volumes:
+ - name: dockersock
+ path: /var/run/docker.sock
+ commands:
+ - docker build -f ./src/Token.ManagementApi.Host/Dockerfile -t managementapi .
+
+ - name: managementapi-push
+ image: docker:dind
+ when:
+ branch:
+ - master
+ environment:
+ IMAGE: managementapi
+ ASPNETCORE_ENVIRONMENT: Development
+ volumes:
+ - name: dockersock
+ path: /var/run/docker.sock
+ - name: logs
+ path: /root/logs/managementapi/logs:/app/logs
+ commands:
+ - docker stop managementapi && docker rm managementapi
+ - docker run -d -network token --name managementapi adminapi:latest
+
+volumes:
+ - name: dockersock
+ host:
+ path: /var/run/docker.sock
diff --git a/.vs/Management/DesignTimeBuild/.dtbcache.v2 b/.vs/Management/DesignTimeBuild/.dtbcache.v2
index 3b689f307ad848a3babf1d0f2a1aedc37151ffeb..fbb48ef7a0165b2066b675771082ce5f898651ab 100644
Binary files a/.vs/Management/DesignTimeBuild/.dtbcache.v2 and b/.vs/Management/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/.vs/Management/v17/.futdcache.v1 b/.vs/Management/v17/.futdcache.v1
index 03d87e85c9b5081e87aa4e06e6ba77c9c9acc892..cecc0b59d924791d3d895e3ecfad543829069267 100644
Binary files a/.vs/Management/v17/.futdcache.v1 and b/.vs/Management/v17/.futdcache.v1 differ
diff --git a/.vs/Management/v17/.suo b/.vs/Management/v17/.suo
index aed85fd0498862fa55d5aea4fde3d66cd25b33aa..c731485e2bc27d33129e9743084869ff6114e55b 100644
Binary files a/.vs/Management/v17/.suo and b/.vs/Management/v17/.suo differ
diff --git a/.vs/ProjectEvaluation/management.metadata.v2 b/.vs/ProjectEvaluation/management.metadata.v2
index 01eb341077a8b052d8e8a5d76ad3711013175ea0..25c7647039923b1ae8b465f02297add73736b95a 100644
Binary files a/.vs/ProjectEvaluation/management.metadata.v2 and b/.vs/ProjectEvaluation/management.metadata.v2 differ
diff --git a/.vs/ProjectEvaluation/management.projects.v2 b/.vs/ProjectEvaluation/management.projects.v2
index 1b9059b220c941c523efa8ce48d2063f02fedfce..a6b3f4a82a4f8eebb4e5143551d358a319a999af 100644
Binary files a/.vs/ProjectEvaluation/management.projects.v2 and b/.vs/ProjectEvaluation/management.projects.v2 differ
diff --git a/src/Token.HttpApi/IPrincipalAccessor.cs b/src/Token.HttpApi/IPrincipalAccessor.cs
index 9905baa52ee45c191929e51573121babe6a3d89e..b4fdfb5586ac95a602ea766f8fca1ef5b172376a 100644
--- a/src/Token.HttpApi/IPrincipalAccessor.cs
+++ b/src/Token.HttpApi/IPrincipalAccessor.cs
@@ -8,7 +8,7 @@ public interface IPrincipalAccessor
string Name { get; }
Guid ID { get; }
- string GetUser(string token);
+ UserInfo GetUser(string token);
bool? IsAuthenticated();
@@ -26,6 +26,12 @@ public interface IPrincipalAccessor
///
T GetUserInfo();
+ ///
+ /// 获取权限列表
+ ///
+ ///
+ List GetRoleIds();
+
List GetUserInfoFromToken(string claimType);
///
@@ -34,5 +40,5 @@ public interface IPrincipalAccessor
///
Guid UserId();
- Task CreateTokenAsync(T userInfo);
+ Task CreateTokenAsync(UserInfo userInfo);
}
diff --git a/src/Token.HttpApi/PrincipalAccessor.cs b/src/Token.HttpApi/PrincipalAccessor.cs
index 80e3f92447b1e8301bca52e961e6c8e87b57d71a..2d7b646abb695a62da03960d76793fc674b20036 100644
--- a/src/Token.HttpApi/PrincipalAccessor.cs
+++ b/src/Token.HttpApi/PrincipalAccessor.cs
@@ -7,6 +7,7 @@ using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using Token.HttpApi.Module;
using Token.Management.Domain;
+using Token.Management.Domain.Management.AccessFunction;
using Token.Management.Domain.Users;
using Volo.Abp.DependencyInjection;
@@ -42,7 +43,9 @@ public class PrincipalAccessor : IPrincipalAccessor, ITransientDependency
public IEnumerable GetClaimsIdentity()
{
- return _contextAccessor.HttpContext.User.Claims;
+ var token = GetToken();
+ JwtSecurityTokenHandler securityTokenHandler = new();
+ return securityTokenHandler.ReadJwtToken(token).Claims;
}
public List GetClaimValueByType(string claimType)
@@ -50,6 +53,15 @@ public class PrincipalAccessor : IPrincipalAccessor, ITransientDependency
return GetClaimsIdentity().Where(item => item.Type == claimType).Select(item => item.Value).ToList();
}
+ public List GetRoleIds()
+ {
+ var roleIds = GetClaimValueByType(Constants.Role).FirstOrDefault();
+ if (roleIds.IsNullOrEmpty())
+ throw new BusinessException(401, "账号未授权");
+
+ return JsonConvert.DeserializeObject>(roleIds);
+ }
+
public List GetUserInfoFromToken(string claimType)
{
JwtSecurityTokenHandler securityTokenHandler = new();
@@ -60,13 +72,15 @@ public class PrincipalAccessor : IPrincipalAccessor, ITransientDependency
: new List();
}
- public string GetUser(string token)
+ public UserInfo GetUser(string token)
{
JwtSecurityTokenHandler securityTokenHandler = new();
- return securityTokenHandler.ReadJwtToken(token).Claims.Where(item => item.Type == Constants.User)
- .Select(item => item.Value).FirstOrDefault() ?? "";
+ var userInfoStr= securityTokenHandler.ReadJwtToken(token).Claims.Where(item => item.Type == Constants.User)
+ .Select(item => item.Value).FirstOrDefault();
+ return JsonConvert.DeserializeObject(userInfoStr);
}
+
public string GetTenantId()
{
HttpContext? httpContext = _contextAccessor.HttpContext;
@@ -93,16 +107,20 @@ public class PrincipalAccessor : IPrincipalAccessor, ITransientDependency
return JsonConvert.DeserializeObject(result);
}
- public Task CreateTokenAsync(T userInfo)
+ public Task CreateTokenAsync(UserInfo userInfo)
{
- var user = userInfo as UserInfo;
// 添加一些需要的键值对
- Claim[] claims = { new Claim(Constants.User, JsonConvert.SerializeObject(userInfo)) };
- if (user != null)
+ List claims = new List()
{
- claims.AddFirst(new Claim(Constants.Role,JsonConvert.SerializeObject(user.UserRoleFunction.Select(x=>x.RoleId))));
- }
+ new Claim(Constants.Department,JsonConvert.SerializeObject(userInfo?.UserDepartmentFunction.Select(x=>x.DepartmentId))),
+ new Claim(Constants.Role,JsonConvert.SerializeObject(userInfo?.UserRoleFunction.Select(x=>x.RoleId)))
+ };
+
+ userInfo.UserRoleFunction.Clear();;
+ userInfo.UserDepartmentFunction.Clear();
+
+ claims.AddFirst(new Claim(Constants.User, JsonConvert.SerializeObject(userInfo)));
byte[] keyBytes = Encoding.UTF8.GetBytes(_tokenOptions.SecretKey!);
SigningCredentials cred = new(new SymmetricSecurityKey(keyBytes),
diff --git a/src/Token.HttpApi/Token.HttpApi.csproj b/src/Token.HttpApi/Token.HttpApi.csproj
index 2eb3a53c3b1b09252dfb8de59c95b665ca1277c1..53946878f41c8326bcc4a561af4cff0e80ce2a18 100644
--- a/src/Token.HttpApi/Token.HttpApi.csproj
+++ b/src/Token.HttpApi/Token.HttpApi.csproj
@@ -10,10 +10,10 @@
-
+
-
-
+
+
diff --git a/src/Token.HttpApi/TokenHttpApiModule.cs b/src/Token.HttpApi/TokenHttpApiModule.cs
index e7c4a510a3fbe61ead9eea17a7e61bed732d11d7..9170a5009dbf1c461e626c1745bde3b474bff852 100644
--- a/src/Token.HttpApi/TokenHttpApiModule.cs
+++ b/src/Token.HttpApi/TokenHttpApiModule.cs
@@ -165,5 +165,6 @@ public class TokenHttpApiModule : AbpModule
app.UseAuthentication();
app.UseAuthorization();
+
}
}
diff --git a/src/Token.Infrastructure/Extension/DESHelper.cs b/src/Token.Infrastructure/Extension/DESHelper.cs
new file mode 100644
index 0000000000000000000000000000000000000000..9acf9024f4f777e73388613ea098aba75aae3f78
--- /dev/null
+++ b/src/Token.Infrastructure/Extension/DESHelper.cs
@@ -0,0 +1,59 @@
+using System.Security.Cryptography;
+using System.Text;
+using Volo.Abp.DependencyInjection;
+
+namespace Token.Infrastructure.Extension;
+
+public class DESHelper:ISingletonDependency
+{
+ private const string Key = "TOKENKEY";
+
+ ///
+ /// DES加密
+ ///
+ ///
+ ///
+ public string DESEncrypt(string value)
+ {
+ DESCryptoServiceProvider des = new();
+ var inputByteArray = Encoding.Default.GetBytes(value);
+ des.Key = Encoding.ASCII.GetBytes(Key);
+ des.IV = Encoding.ASCII.GetBytes(Key);
+ var ms = new MemoryStream();
+ var cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write);
+ cs.Write(inputByteArray, 0, inputByteArray.Length);
+ cs.FlushFinalBlock();
+ var ret = new StringBuilder();
+ foreach (var b in ms.ToArray())
+ {
+ ret.AppendFormat("{0:X2}", b);
+ }
+ ret.ToString();
+ return ret.ToString();
+
+ }
+
+ ///
+ /// 解密
+ ///
+ ///
+ ///
+ public string DESDecrypt(string value)
+ {
+ DESCryptoServiceProvider des = new();
+ var inputByteArray = new byte[value.Length / 2];
+ for (var x = 0; x < value.Length / 2; x++)
+ {
+ var i = Convert.ToInt32(value.Substring(x * 2, 2), 16);
+ inputByteArray[x] = (byte)i;
+ }
+ des.Key = Encoding.ASCII.GetBytes(Key);
+ des.IV = Encoding.ASCII.GetBytes(Key);
+ var ms = new MemoryStream();
+ var cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
+ cs.Write(inputByteArray, 0, inputByteArray.Length);
+ cs.FlushFinalBlock();
+ return Encoding.Default.GetString(ms.ToArray());
+ }
+
+}
diff --git a/src/Token.Infrastructure/TokenInfrastructureModule.cs b/src/Token.Infrastructure/TokenInfrastructureModule.cs
new file mode 100644
index 0000000000000000000000000000000000000000..c16161b2a99e723a8780e32935d247b486da6cf1
--- /dev/null
+++ b/src/Token.Infrastructure/TokenInfrastructureModule.cs
@@ -0,0 +1,8 @@
+using Volo.Abp.Modularity;
+
+namespace Token.Infrastructure;
+
+public class TokenInfrastructureModule:AbpModule
+{
+
+}
diff --git a/src/Token.Management.Application.Contracts/AppServices/Management/IRoleService.cs b/src/Token.Management.Application.Contracts/AppServices/Management/IRoleService.cs
index 421b3ac0046d8bb06599ee5b9d40406ce082f6a2..861dc8918b329376f3e3ed28143cfa61155b9c91 100644
--- a/src/Token.Management.Application.Contracts/AppServices/Management/IRoleService.cs
+++ b/src/Token.Management.Application.Contracts/AppServices/Management/IRoleService.cs
@@ -3,6 +3,7 @@ using Token.Management.Application.Contracts.Module.Management;
using Token.Management.Application.Contracts.Module.Users;
using Token.Management.Domain.Management;
using Token.Management.Domain.Management.AccessFunction;
+using Token.Management.Domain.Users;
namespace Management.Application.Services.Management;
@@ -25,7 +26,7 @@ public interface IRoleService
Task> RecursionUserMenu(List
///
///
- Task GetUserInfo(LoginInput input);
+ Task<(UserInfoDto, string)> GetUserInfo(LoginInput input);
///
- /// 用户分页数据
+ /// 用户分页数据
///
+ ///
///
- Task, int>> GetUserInfoPaging(string? code, DateTime? startTime, DateTime? endTime,
- sbyte statue = -1, int pageNo = 1, int pageSize = 20);
+ Task, int>> GetUserInfoPaging(UserInfoPagingInput input);
///
/// 获取账号下所有部门
diff --git a/src/Token.Management.Application.Contracts/AppServices/Users/UserInfoPagingInput.cs b/src/Token.Management.Application.Contracts/AppServices/Users/UserInfoPagingInput.cs
new file mode 100644
index 0000000000000000000000000000000000000000..8f3106d1b0ad9fdfc42ec9800b7c103b264f981f
--- /dev/null
+++ b/src/Token.Management.Application.Contracts/AppServices/Users/UserInfoPagingInput.cs
@@ -0,0 +1,14 @@
+using Token.Management.Application.Contracts.Module;
+
+namespace Token.Management.Application.Contracts.AppServices.Users;
+
+///
+/// 获取用户列表input
+///
+public class UserInfoPagingInput:PageInput
+{
+ ///
+ /// 状态
+ ///
+ public sbyte? Status { get; set; }
+}
diff --git a/src/Token.Management.Application.Contracts/AppServices/WorkContent/IWorkDemoMainService.cs b/src/Token.Management.Application.Contracts/AppServices/WorkContent/IWorkDemoMainService.cs
new file mode 100644
index 0000000000000000000000000000000000000000..741f34e7a42c25cda49e01057e14c1eb779e54c6
--- /dev/null
+++ b/src/Token.Management.Application.Contracts/AppServices/WorkContent/IWorkDemoMainService.cs
@@ -0,0 +1,25 @@
+namespace Token.Management.Application.Contracts.AppServices.WorkContent;
+
+///
+/// WorkDemo实例
+///
+public interface IWorkDemoMainService
+{
+ ///
+ /// 创建一个Demo
+ ///
+ ///
+ ///
+ Task CreateWorkDemoMainAsync(WorkDemoMainDto dto);
+
+ ///
+ /// 获取Demo列表
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task<(List, int)> GetWorkDemoListAsync(DateTime? startTime,DateTime? endTime,string keyword,int pageNo,int pageSize);
+}
diff --git a/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkContentDemoDto.cs b/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkContentDemoDto.cs
new file mode 100644
index 0000000000000000000000000000000000000000..9d066bf2e65b31314b11f29a0e87b2f7b3af5ac9
--- /dev/null
+++ b/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkContentDemoDto.cs
@@ -0,0 +1,56 @@
+using Token.Management.Application.Contracts.Module.Users;
+using Token.Management.Domain.Shared;
+
+namespace Token.Management.Application.Contracts.AppServices.WorkContent;
+
+///
+/// WorkContent
+///
+public class WorkContentDemoDto
+{
+ ///
+ /// Id
+ ///
+ public Guid Id { get; set; }
+
+ ///
+ /// 表单工作流状态
+ ///
+ public WorkFlowNodeStatusEnum WorkFlowNodeStatus { get; set; }
+
+ ///
+ /// 表单工作流状态
+ ///
+ public string WorkFlowNodeStatusName { get; set; }
+
+ ///
+ /// 实例id
+ ///
+ public Guid? WorkflowInstanceId { get; set; }
+
+ ///
+ /// 提交时间
+ ///
+ public DateTime? SubmitTime { get; set; }
+
+ ///
+ /// 子项目名称
+ ///
+ public string? Name { get; set; }
+
+ ///
+ /// 子项目内容
+ ///
+ public string? Content { get; set; }
+
+ ///
+ /// 项目负责人
+ ///
+ public Guid PrincipalId { get; set; }
+
+ public Guid WorkDemoMainId { get; set; }
+
+ public virtual UserInfoDto Principal { get; set; }
+
+ public virtual WorkDemoMainDto WorkDemoMain { get; set; }
+}
diff --git a/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkDemoMainDto.cs b/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkDemoMainDto.cs
new file mode 100644
index 0000000000000000000000000000000000000000..929cbcd4bdc7634e325b28e2af83ec2ce26884ce
--- /dev/null
+++ b/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkDemoMainDto.cs
@@ -0,0 +1,53 @@
+using Token.Management.Domain.Shared;
+
+namespace Token.Management.Application.Contracts.AppServices.WorkContent;
+
+///
+/// WorkDemo
+///
+public class WorkDemoMainDto
+{
+ ///
+ /// Id
+ ///
+ public Guid Id { get; set; }
+
+ ///
+ /// 工作流Dmeo名称
+ ///
+ public string? Name { get; set; }
+
+ ///
+ /// 工作流Demo备注
+ ///
+ public string? Remark { get; set; }
+
+ ///
+ /// 工作流Demo内容
+ ///
+ public string? Content { get; set; }
+
+ ///
+ /// 表单工作流状态
+ ///
+ public WorkFlowNodeStatusEnum WorkFlowNodeStatus { get; set; }
+
+ ///
+ /// 表单工作流状态
+ ///
+ public string WorkFlowNodeStatusName { get; set; }
+
+ ///
+ /// 项目开始时间
+ ///
+ public DateTime? StartTime { get; set; }
+
+ ///
+ /// 项目结束时间
+ ///
+ public DateTime? EndTime { get; set; }
+
+ public bool IsDeleted { get; set; }
+
+ public List WorkContentDemo { get; set; } = new List();
+}
diff --git a/src/Token.Management.Application.Contracts/AppServices/WorkFlow/IWorkflowTemplateService.cs b/src/Token.Management.Application.Contracts/AppServices/WorkFlow/IWorkflowTemplateService.cs
index a9e62b87fc667966962e8d5ea3b2080c6a2ceb81..461f3c651da702bf8940285d23cc3cb6b28e3994 100644
--- a/src/Token.Management.Application.Contracts/AppServices/WorkFlow/IWorkflowTemplateService.cs
+++ b/src/Token.Management.Application.Contracts/AppServices/WorkFlow/IWorkflowTemplateService.cs
@@ -1,4 +1,5 @@
-using Token.Management.Application.Contracts.Module.WorkFlow;
+using Token.Management.Application.Contracts.Module;
+using Token.Management.Application.Contracts.Module.WorkFlow;
using Token.Management.Domain.WorkFlow;
namespace Token.Management.Application.Contracts.AppServices.WorkFlow;
@@ -16,10 +17,9 @@ public interface IWorkflowTemplateService
/// 获取模板
///
///
- ///
- ///
+ ///
///
- Task<(List, int)> GetWorkflowTemplatePage(string? name, int pageNo = 1, int pageSize = 20);
+ Task<(List, int)> GetWorkflowTemplatePage(string? name, PageInput input);
///
/// 删除模板
@@ -43,7 +43,7 @@ public interface IWorkflowTemplateService
Task> GetWorkflowNodeTemplates(Guid workflowId);
///
- /// 获取节点已存在角色
+ /// 获取节点已存在角色
///
///
///
diff --git a/src/Token.Management.Application.Contracts/Module/PageInput.cs b/src/Token.Management.Application.Contracts/Module/PageInput.cs
index b3a7575ee118ce5bee557784872e6430bc28a9ce..687a35e59a87c2f960833e91c2b0bbe37c10e9dc 100644
--- a/src/Token.Management.Application.Contracts/Module/PageInput.cs
+++ b/src/Token.Management.Application.Contracts/Module/PageInput.cs
@@ -5,6 +5,16 @@
///
public class PageInput
{
+ ///
+ /// 开始时间
+ ///
+ public DateTime? StartTime { get; set; }
+
+ ///
+ /// 结束时间
+ ///
+ public DateTime? EndTime { get; set; }
+
///
/// 当前页
///
diff --git a/src/Token.Management.Application.Contracts/Module/Users/UserInfoDto.cs b/src/Token.Management.Application.Contracts/Module/Users/UserInfoDto.cs
index ab444b0de7e2923ac5fe1d75f0f9c5a71b854f71..2ff5f084574d9d7393fe3f08291fd26c570be956 100644
--- a/src/Token.Management.Application.Contracts/Module/Users/UserInfoDto.cs
+++ b/src/Token.Management.Application.Contracts/Module/Users/UserInfoDto.cs
@@ -1,4 +1,4 @@
-using Token.Management.Application.Contracts.Module.Management;
+using Token.Management.Application.Contracts.Module.Management;
using Token.Management.Domain.Base;
using Token.Management.Domain.Shared;
@@ -41,12 +41,12 @@ public class UserInfoDto : SerialNumberEntity
///
/// 账号状态
///
- public StatueEnum Statue { get; set; }
+ public StatusEnum Status { get; set; }
///
- /// 状态描述
+ /// 状态描述
///
- public string? StatueName { get; set; }
+ public string? StatusName { get; set; }
///
/// 性别
diff --git a/src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj b/src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj
index 0f3edc93c6e3e4e3330ef10073c8a32eed87d211..4dae1b285b1766231c7e709dadd40deac38432c8 100644
--- a/src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj
+++ b/src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/src/Token.Management.Application/MapperProfile.cs b/src/Token.Management.Application/MapperProfile.cs
index 8c42717a01698200f3c02cbdcfbd1747bf4bcf4c..b2246c396ab6188923d3ec3170b61fe201b06191 100644
--- a/src/Token.Management.Application/MapperProfile.cs
+++ b/src/Token.Management.Application/MapperProfile.cs
@@ -1,5 +1,6 @@
-using AutoMapper;
+using AutoMapper;
using Token.Infrastructure.Extension;
+using Token.Management.Application.Contracts.AppServices.WorkContent;
using Token.Management.Application.Contracts.Module.Management;
using Token.Management.Application.Contracts.Module.Management.AccessFunction;
using Token.Management.Application.Contracts.Module.Users;
@@ -8,11 +9,12 @@ using Token.Management.Domain.Management;
using Token.Management.Domain.Management.AccessFunction;
using Token.Management.Domain.Shared;
using Token.Management.Domain.Users;
+using Token.Management.Domain.WorkContent;
using Token.Management.Domain.WorkFlow;
namespace Token.Management.Application;
-public class MapperProfile: Profile
+public class MapperProfile : Profile
{
public MapperProfile()
{
@@ -20,10 +22,10 @@ public class MapperProfile: Profile
.ForMember(dest => dest.Role, l => l.MapFrom(a => a.UserRoleFunction.Select(a => a.Role)))
.ForMember(dest => dest.SexName, l => l.MapFrom(a => a.Sex.GetEnumString()))
.ForMember(dest => dest.Sex, l => l.MapFrom(a => (sbyte)a.Sex))
- .ForMember(dest => dest.StatueName, l => l.MapFrom(a => a.Statue.GetEnumString()))
+ .ForMember(dest => dest.StatusName, l => l.MapFrom(a => a.Status.GetEnumString()))
.ForMember(dest => dest.Department, l => l.MapFrom(a => a.UserDepartmentFunction.Select(a => a.Department)));
CreateMap()
- .ForMember(dest=>dest.Sex,l=>l.MapFrom(a=>(SexEnum)a.Sex));
+ .ForMember(dest => dest.Sex, l => l.MapFrom(a => (SexEnum)a.Sex));
CreateMap();
CreateMap();
CreateMap();
@@ -53,5 +55,19 @@ public class MapperProfile: Profile
CreateMap();
CreateMap();
#endregion
+
+ #region WorkDemo
+
+ CreateMap();
+ CreateMap()
+ .ForMember(x=>x.WorkFlowNodeStatusName,
+ x=>x.MapFrom(x=>x.WorkFlowNodeStatus.GetEnumString()));
+ CreateMap();
+ CreateMap()
+ .ForMember(x=>x.WorkFlowNodeStatusName,
+ x=>x.MapFrom(x=>x.WorkFlowNodeStatus.GetEnumString()));
+
+
+ #endregion
}
}
diff --git a/src/Token.Management.Application/Services/Management/RoleService.cs b/src/Token.Management.Application/Services/Management/RoleService.cs
index 4bd191c161833c73649805af7c89e9ba37282ea8..d73ab1c1634e0793a36b8db6d88481507830a84d 100644
--- a/src/Token.Management.Application/Services/Management/RoleService.cs
+++ b/src/Token.Management.Application/Services/Management/RoleService.cs
@@ -16,7 +16,6 @@ namespace Token.Management.Application.Services.Management;
public class RoleService : ApplicationService, IRoleService
{
- private readonly IMapper _mapper;
private readonly IPrincipalAccessor _principalAccessor;
private readonly IRepository _roleRepository;
private readonly IRepository