diff --git a/.gitignore b/.gitignore
index fa852bd173e755dd27e77a2bceca2ad3a74f9651..3dab4af7f94855f5ffdf0cc3df38374a8c1cc2a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,11 +16,15 @@ bin-release/
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
-/backend/Dilon.Web.Entry/wwwroot
/backend/Dilon.Web.Entry/Logs
/backend/.vs
+/backend/.idea
/backend/Dilon.Web.Entry/publish
/backend/Dilon.Database.Migrations/Migrations
/backend/Dilon.Web.Entry/Properties/PublishProfiles
/backend/Dilon.Core/Dilon.Core.csproj.user
/backend/Dilon.Web.Entry/Dilon.Web.Entry.csproj.user
+/.vs
+/.idea
+/backend/Dilon.Web.Entry/templates
+/backend/Dilon.Web.Entry/wwwroot/Upload
diff --git a/LICENSE b/LICENSE
index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..79b452bdd5e8c3ba4f5252959d39ebfb0f939c11 100644
--- a/LICENSE
+++ b/LICENSE
@@ -2,7 +2,7 @@
Version 2.0, January 2004
http://www.apache.org/licenses/
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright [yyyy] [name of copyright owner]
+ Copyright © 2021 Admin.NET, Dilon Co.,Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/README.en.md b/README.en.md
deleted file mode 100644
index 798d0dda69c0de520d90d895fdae0369371012f3..0000000000000000000000000000000000000000
--- a/README.en.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# Admin.NET
-
-#### Description
-基于.NET 5实现的通用权限管理平台。高效快速开发,前后端分离模式,代码简洁,开箱即用。后台基于Furion框架,极易入门、极速开发、极易维护,数据源随意切换并自带租户功能。前端使用AntDesign-Vue-Pro + Vue2.0开发,紧跟前沿技术。
-
-#### Software Architecture
-Software architecture description
-
-#### Installation
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### Instructions
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### Contribution
-
-1. Fork the repository
-2. Create Feat_xxx branch
-3. Commit your code
-4. Create Pull Request
-
-
-#### Gitee Feature
-
-1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
-2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
-3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
-4. The most valuable open source project [GVP](https://gitee.com/gvp)
-5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
-6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
diff --git a/README.md b/README.md
index ee0a4130bb447747139a5b9de4c1c12d3e84444e..25ef5d91eab1b4b61fe00c06f2e55e5939115fc4 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,27 @@
-
+
Admin.NET
前后端分离架构,开箱即用,紧随前沿技术
+
+
+[](https://gitee.com/zuohuaijun/Admin.NET/stargazers)
+[](https://gitee.com/zuohuaijun/Admin.NET/members)
+[](https://gitee.com/dotnetchina/Furion/stargazers)
+[](https://gitee.com/xiaonuobase/snowy/stargazers)
+[](https://gitee.com/dotnetchina/Furion/blob/master/LICENSE)
+
+
+
### 🍟 概述
-* 基于.NET5实现的通用权限管理平台(RBAC模式)。整合最新技术高效快速开发,前后端分离模式,开箱即用。
-* 后台基于Furion框架,多租户、分库读写分离、缓存、数据校验、鉴权、动态API、gRPC等众多黑科技集一身。
-前端Antd-Vue-Pro + Vue2.X开发,紧跟前沿技术,前端自带字典翻译。
+* 基于.NET 5实现的通用权限管理平台(RBAC模式)。整合最新技术高效快速开发,前后端分离模式,开箱即用。
+* 前端基于小诺Vue(antd)框架,整体RBAC基础数据结构+API接口风格采用小诺vue版本模式。
+* 后台基于Furion框架,EFCore、多租户、分库读写分离、缓存、数据校验、鉴权、动态API、gRPC等众多黑科技集一身。
* 模块化架构设计,层次清晰,业务层推荐写到单独模块,框架升级不影响业务!
* 核心模块包括:用户、角色、职位、组织机构、菜单、字典、日志、多应用管理、文件管理、定时任务等功能。
* 代码量少、通俗易懂、功能强大、易扩展,轻松开发从现在开始!
@@ -20,13 +30,23 @@
如果对您有帮助,您可以点右上角 “Star” 收藏一下 ,获取第一时间更新,谢谢!
```
+### 😎 衍生版本
+
+【Admin.NET】隆重推出SqlSugar版本
+
+- 👉 SqlSugar版本:[https://gitee.com/zhengguojing/admin-net-sqlsugar](https://gitee.com/zhengguojing/admin-net-sqlsugar)
+
+`如果集成其他ORM,请参照各自操作使用说明。系统默认EFCore不会处理其他ORM实体等,请自行处理。`
+
### 🥞 更新日志
更新日志 [点击查看](https://gitee.com/zuohuaijun/Admin.NET/commits/master)
### ⚡ 近期计划
-- [ ] 集成代码生成器
+- [x] 集成多租户功能
+- [x] 集成代码生成器
+- [x] 集成导入导出
- [ ] 在线用户及黑名单
- [ ] 邮件发送
- [ ] 短信发送
@@ -36,9 +56,10 @@
### 🍿 在线体验
-~~体验地址:[http://dilon.zicp.net:55221/](http://dilon.zicp.net:55221/)(用户名:superAdmin,密码:123456)~~
-
-`【个人电脑临时部署,偶尔在线,可以试试看】`
+- 体验地址:[http://39.107.123.76:82/](http://39.107.123.76:82/)
+- 开发者租户:用户名:superAdmin,密码:123456
+- 公司1租户: 公司1租户管理员(用户名:admin1 密码:123456),公司1租户普通用户(用户名:zuohuaijun1 密码:123456)
+
### 🍄 快速启动
@@ -72,6 +93,16 @@
 |
 |
+
+  |
+  |
+  |
+
+
+  |
+  |
+  |
+
### 🍖 详细功能
@@ -87,13 +118,13 @@
9. 访问日志、用户的登录和退出日志的查看和管理。
10. 操作日志、用户的操作业务的日志的查看和管理。
11. 服务监控、服务器的运行状态,CPU、内存、网络等信息数据的查看。
-12. 在线用户、当前系统在线用户的查看。【正在实现中...】
+12. 在线用户、当前系统在线用户的查看。
13. 公告管理、系统的公告的管理。
-14. 文件管理、文件的上传下载查看等操作,文件可使用本地存储,阿里云oss,腾讯cos接入,支持拓展。【目前只支持本地存储...】
+14. 文件管理、文件的上传下载查看等操作,文件可使用本地存储,阿里云oss,腾讯cos接入,支持拓展。
15. 定时任务、定时任务的维护,通过cron表达式控制任务的执行频率。
-16. 系统配置、系统运行的参数的维护,参数的配置与系统运行机制息息相关。【完善中...】
-17. 邮件发送、发送邮件功能。【正在实现中...】
-18. 短信发送、短信发送功能,可使用阿里云sms,腾讯云sms,支持拓展。【正在实现中...】
+16. 系统配置、系统运行的参数的维护,参数的配置与系统运行机制息息相关。
+17. 邮件发送、发送邮件功能。
+18. 短信发送、短信发送功能,可使用阿里云sms,腾讯云sms,支持拓展。
### 👀 数据库切换
@@ -110,7 +141,7 @@
1. Dilon.EntityFramework.Core 项目安装 ``` Microsoft.EntityFrameworkCore.SqlServer ```
2. DefaultDbContext.cs 指定 DbProvider , ```[AppDbContext("DefaultConnection", DbProvider.SqlServer)]```
3. dbsettings.json 配置 "DefaultConnection": ```"Server=localhost;Database=Dilon;User=sa;Password=000000;MultipleActiveResultSets=True;"```
-4. 打开程序包管理器控制台,默认项目Dilon.Database.Migrations 执行命令:```Add-Migration Init和update-database```
+4. 打开程序包管理器控制台,默认项目Dilon.Database.Migrations 执行命令:```Add-Migration Init 和 update-database```
```
提示:其他类型数据库依次类推,首先添加EF的Core版包,然后指定数据库类型,修改数据库连接字符串,执行EF命令即可。
@@ -118,14 +149,18 @@
### 🥦 补充说明
-* 基于.NET5平台Furion开发框架与小诺VUE版本相结合,实时跟随基架升级而升级!
+* 基于.NET 5平台 Furion 开发框架与小诺 Vue 版本相结合,实时跟随基架升级而升级!
* 持续集百家所长,完善与丰富本框架基础设施,为.NET生态增加一种选择!
* 后期会推出基于此框架的相关应用场景案例,提供给大家使用!
* 有问题讨论的小伙伴可加群一起学习讨论。 QQ群【87333204】
### 💐 特别鸣谢
-- 👉Furion: [https://dotnetchina.gitee.io/furion](https://dotnetchina.gitee.io/furion)
-- 👉 xiaonuo:[https://gitee.com/xiaonuobase/xiaonuo-vue](https://gitee.com/xiaonuobase/xiaonuo-vue)
+- 👉 Furion: [https://dotnetchina.gitee.io/furion](https://dotnetchina.gitee.io/furion)
+- 👉 xiaonuo:[https://gitee.com/xiaonuobase/snowy](https://gitee.com/xiaonuobase/snowy)
+- 👉 k-form-design:[https://gitee.com/kcz66/k-form-design](https://gitee.com/kcz66/k-form-design)
+- 👉 MiniExcel:[https://gitee.com/dotnetchina/MiniExcel](https://gitee.com/dotnetchina/MiniExcel)
+- 👉 SqlSugar:[https://gitee.com/dotnetchina/SqlSugar](https://gitee.com/dotnetchina/SqlSugar)
+
-如果对您有帮助,您可以点 "Star" 支持一下,这样才有持续下去的动力,谢谢!
+如果对您有帮助,您可以点 "Star" 支持一下,这样才有持续下去的动力,谢谢!!!
diff --git a/backend/Dilon.Application/Dilon.Application.csproj b/backend/Dilon.Application/Dilon.Application.csproj
index 9f5b37470c8239ced9844cd144b72462c94f2f83..abd537ac851a7cfda84dc9a96b87321c80f81741 100644
--- a/backend/Dilon.Application/Dilon.Application.csproj
+++ b/backend/Dilon.Application/Dilon.Application.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/backend/Dilon.Application/Dilon.Application.csproj.user b/backend/Dilon.Application/Dilon.Application.csproj.user
new file mode 100644
index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822
--- /dev/null
+++ b/backend/Dilon.Application/Dilon.Application.csproj.user
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/backend/Dilon.Application/Dilon.Application.xml b/backend/Dilon.Application/Dilon.Application.xml
index 7b3a41d8de767822259c381255ed45790560ea5f..d1774e47c15ae875e84f882e0ca585e2b97b287c 100644
--- a/backend/Dilon.Application/Dilon.Application.xml
+++ b/backend/Dilon.Application/Dilon.Application.xml
@@ -4,10 +4,178 @@
Dilon.Application
+
+
+ 代码生成实体测试(EF)
+
+
+
+
+ 名称
+
+
+
+
+ 昵称
+
+
+
+
+ 生日
+
+
+
+
+ 年龄
+
+
+
+
+ SqlSugar实体
+
+
+
+
+ 雪花Id
+
+
+
+
+ 名称
+
+
+
+
+ 年龄
+
+
+
+
+ 创建时间
+
+
+
+
+ 代码生成业务服务
+
+
+
+
+ 分页查询代码生成业务
+
+
+
+
+
+
+ 增加代码生成业务
+
+
+
+
+
+
+ 删除代码生成业务
+
+
+
+
+
+
+ 更新代码生成业务
+
+
+
+
+
+
+ 获取代码生成业务
+
+
+
+
+
+
+ 获取代码生成业务列表
+
+
+
+
+
+
+ 代码生成业务输入参数
+
+
+
+
+ 名称
+
+
+
+
+ 昵称
+
+
+
+
+ 生日
+
+
+
+
+ 年龄
+
+
+
+
+ Id主键
+
+
+
+
+ Id主键
+
+
+
+
+ 代码生成业务输出参数
+
+
+
+
+ 名称
+
+
+
+
+ 昵称
+
+
+
+
+ 生日
+
+
+
+
+ 年龄
+
+
+
+
+ Id主键
+
+
- 事例
+ 业务服务及集成SqlSugar用法事例
+
+
+
+
+ 测试方法
+
diff --git a/backend/Dilon.Application/Entity/CodeGenTest.cs b/backend/Dilon.Application/Entity/CodeGenTest.cs
new file mode 100644
index 0000000000000000000000000000000000000000..601062c83e563ca285958c143908ab977c132bda
--- /dev/null
+++ b/backend/Dilon.Application/Entity/CodeGenTest.cs
@@ -0,0 +1,39 @@
+using Dilon.Core;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Dilon.Application
+{
+ ///
+ /// 代码生成实体测试(EF)
+ ///
+ [Table("code_gen_test")]
+ [Comment("代码生成业务")]
+ public class CodeGenTest : DEntityBase
+ {
+ ///
+ /// 名称
+ ///
+ [Comment("名称")]
+ public string Name { get; set; }
+
+ ///
+ /// 昵称
+ ///
+ [Comment("昵称")]
+ public string NickName { get; set; }
+
+ ///
+ /// 生日
+ ///
+ [Comment("生日")]
+ public DateTimeOffset Birthday { get; set; }
+
+ ///
+ /// 年龄
+ ///
+ [Comment("年龄")]
+ public int Age { get; set; }
+ }
+}
diff --git a/backend/Dilon.Application/Entity/Test.cs b/backend/Dilon.Application/Entity/Test.cs
new file mode 100644
index 0000000000000000000000000000000000000000..9f15c349c158608c0333745fc85892684f393870
--- /dev/null
+++ b/backend/Dilon.Application/Entity/Test.cs
@@ -0,0 +1,35 @@
+using SqlSugar;
+using System;
+
+namespace Dilon.Application
+{
+ ///
+ /// SqlSugar实体
+ ///
+ [SugarTable("Test", TableDescription = "我的业务表")]
+ public class Test
+ {
+ ///
+ /// 雪花Id
+ ///
+ [SugarColumn(IsPrimaryKey = true)]
+ public long Id { get; set; }
+
+ ///
+ /// 名称
+ ///
+ [SugarColumn(ColumnDataType = "Nvarchar(32)")]
+ public string Name { get; set; }
+
+ ///
+ /// 年龄
+ ///
+ public int Age { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(IsNullable = true)]
+ public DateTimeOffset CreateTime { get; set; }
+ }
+}
diff --git a/backend/Dilon.Application/README.md b/backend/Dilon.Application/README.md
index b559d9ca3e7e6fa07d654c3c803a8a3e11ef0a4b..11a79cda6841dcc0ff2556e43e92203244703df6 100644
--- a/backend/Dilon.Application/README.md
+++ b/backend/Dilon.Application/README.md
@@ -1,2 +1,3 @@
-原则上服务应该放在Application层次,考虑将咱自己的业务层直接写在Application里面好些,后续升级后,咱大家直接升级就行了,减少冲突!
-
+1、原则上服务应该放在Application层次,考虑将咱自己的业务层直接写在Application里面好些,后续升级后,咱大家直接升级就行了,减少冲突!
+2、系统默认ORM为EF Core,如果觉得不趁手,可以自行更换
+3、在此应用层默认集成了SqlSugar,其他ORM类同,可以多个ORM并行开发,熟悉哪个用哪个
diff --git a/backend/Dilon.Application/Service/TestService.cs b/backend/Dilon.Application/Service/TestService.cs
index 197e1cba05c80673e290798dddd5508b5cc75644..ef260bd11f906443dcbb8931c40ec681493cb574 100644
--- a/backend/Dilon.Application/Service/TestService.cs
+++ b/backend/Dilon.Application/Service/TestService.cs
@@ -1,21 +1,76 @@
-using Furion.DependencyInjection;
+using Dilon.Core;
+using Furion.DependencyInjection;
using Furion.DynamicApiController;
+using Furion.Snowflake;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
namespace Dilon.Application
{
///
- /// 事例
+ /// 业务服务及集成SqlSugar用法事例
///
public class TestService : ITestService, IDynamicApiController, ITransient
{
- public TestService()
- {
+ //private readonly ISqlSugarRepository _testRep;
+ //private readonly SqlSugarClient _db; // SqlSugar对象
+ public TestService(/*ISqlSugarRepository sqlSugarRep*/)
+ {
+ //_testRep = sqlSugarRep;
+ //_db = (SqlSugarClient)_testRep.Context;
}
+ ///
+ /// 测试方法
+ ///
+ ///
+ [HttpPost("/test")]
public string GetDescription()
{
return "Admin.NET";
}
+
+ /////
+ ///// 增加数据
+ /////
+ /////
+ //[HttpPost("/test/add")]
+ //public async Task AddTestAsync()
+ //{
+ // var test = new Test()
+ // {
+ // Id = IDGenerator.NextId(),
+ // Name = "Admin.NET",
+ // Age = 1,
+ // CreateTime = DateTimeOffset.Now
+ // };
+ // await _testRep.InsertAsync(test);
+ // // _db.Insertable(test).ExecuteCommand();
+ //}
+
+ /////
+ ///// 查询所有
+ /////
+ /////
+ //[HttpPost("/test/page")]
+ //public async Task> GetTestListAsync()
+ //{
+ // return await _testRep.Entities.ToListAsync();
+ //}
+
+ /////
+ ///// 查询系统用户
+ /////
+ /////
+ //[HttpPost("/test/userPage")]
+ //public async Task GetUserListAsync()
+ //{
+ // return await _db.Queryable().ToListAsync();
+ //}
}
}
diff --git a/backend/Dilon.Application/Startup.cs b/backend/Dilon.Application/Startup.cs
new file mode 100644
index 0000000000000000000000000000000000000000..d3b6b4bd91db5d7b1248dbcd613ff88bc6c2c097
--- /dev/null
+++ b/backend/Dilon.Application/Startup.cs
@@ -0,0 +1,31 @@
+using Furion;
+using Microsoft.Extensions.DependencyInjection;
+using SqlSugar;
+using System.Linq;
+
+namespace Dilon.Application
+{
+ public class Startup : AppStartup
+ {
+ public void ConfigureServices(IServiceCollection services)
+ {
+ //services.AddSqlSugar(new ConnectionConfig
+ //{
+ // ConnectionString = App.Configuration["ConnectionStrings:DefaultConnection"],
+ // DbType = DbType.Sqlite,
+ // IsAutoCloseConnection = true,
+ // InitKeyType = InitKeyType.Attribute
+ //},
+ //db =>
+ //{
+ // // db.DbMaintenance.CreateDatabase();
+ // // db.CodeFirst.SetStringDefaultLength(200).InitTables(typeof(Test));
+
+ // db.Aop.OnLogExecuting = (sql, pars) =>
+ // {
+ // App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" + string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));
+ // };
+ //});
+ }
+ }
+}
diff --git a/backend/Dilon.Core/Cache/ICache.cs b/backend/Dilon.Core/Cache/ICache.cs
index e96f065f19ac2c172f695aaa795c5ae62d6a202e..0b2f693db319ad59b08385cb141cb718f469d6d1 100644
--- a/backend/Dilon.Core/Cache/ICache.cs
+++ b/backend/Dilon.Core/Cache/ICache.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
namespace Dilon.Core
@@ -103,5 +104,11 @@ namespace Dilon.Core
/// 有效期
///
Task SetAsync(string key, object value, TimeSpan expire);
+
+ ///
+ /// 获取所有缓存
+ ///
+ ///
+ List GetAllKeys();
}
}
diff --git a/backend/Dilon.Core/Cache/MemoryCache.cs b/backend/Dilon.Core/Cache/MemoryCache.cs
index 0d96f07988b90f43cc2ead9bca18f2e8f0dc4f4b..bf9722a19def42d3237ce0426660b5b02687b7f0 100644
--- a/backend/Dilon.Core/Cache/MemoryCache.cs
+++ b/backend/Dilon.Core/Cache/MemoryCache.cs
@@ -45,14 +45,10 @@ namespace Dilon.Core
if (string.IsNullOrEmpty(pattern))
return default;
- pattern = Regex.Replace(pattern, @"\{.*\}", "(.*)");
-
- var keys = GetAllKeys().Where(k => Regex.IsMatch(k, pattern));
-
- if (keys != null && keys.Count() > 0)
- {
+ //pattern = Regex.Replace(pattern, @"\{*.\}", "(.*)");
+ var keys = GetAllKeys().Where(k => k.StartsWith(pattern));
+ if (keys != null && keys.Any())
return await DelAsync(keys.ToArray());
- }
return default;
}
@@ -111,7 +107,7 @@ namespace Dilon.Core
return Task.FromResult(true);
}
- private List GetAllKeys()
+ public List GetAllKeys()
{
const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
var entries = _memoryCache.GetType().GetField("_entries", flags).GetValue(_memoryCache);
diff --git a/backend/Dilon.Core/Cache/RedisCache.cs b/backend/Dilon.Core/Cache/RedisCache.cs
index 39df0754a69fa3b9044cca0b69130d7b74c88c6a..e98a2a5aa8ac05e9d736b9f81505a7bea70ced21 100644
--- a/backend/Dilon.Core/Cache/RedisCache.cs
+++ b/backend/Dilon.Core/Cache/RedisCache.cs
@@ -1,6 +1,8 @@
using Furion.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -32,8 +34,7 @@ namespace Dilon.Core
if (string.IsNullOrEmpty(pattern))
return default;
- pattern = Regex.Replace(pattern, @"\{.*\}", "*");
-
+ //pattern = Regex.Replace(pattern, @"\{.*\}", "*");
var keys = (await RedisHelper.KeysAsync(pattern));
if (keys != null && keys.Length > 0)
{
@@ -92,5 +93,10 @@ namespace Dilon.Core
{
return RedisHelper.SetAsync(key, value, expire);
}
+
+ public List GetAllKeys()
+ {
+ return RedisHelper.Keys("").ToList();
+ }
}
}
\ No newline at end of file
diff --git a/backend/Dilon.Core/Captcha/ClickWord/ClickWordCaptcha.cs b/backend/Dilon.Core/Captcha/ClickWord/ClickWordCaptcha.cs
index e2d951b79822e5cf76527a0fe0df1e2d9118041e..be81deb0b57beae8cab12402a89d2edb538d2226 100644
--- a/backend/Dilon.Core/Captcha/ClickWord/ClickWordCaptcha.cs
+++ b/backend/Dilon.Core/Captcha/ClickWord/ClickWordCaptcha.cs
@@ -1,6 +1,7 @@
-using Furion.DependencyInjection;
-using Furion.FriendlyException;
+using Furion;
+using Furion.DependencyInjection;
using Furion.JsonSerialization;
+using Furion.Snowflake;
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Collections.Generic;
@@ -44,19 +45,14 @@ namespace Dilon.Core
Color[] colorArray = { Color.Black, Color.DarkBlue, Color.Green, Color.Orange, Color.Brown, Color.DarkCyan, Color.Purple };
- string bgImagesDir = Path.Combine(AppContext.BaseDirectory, "Captcha/ClickWord/Data", "Image");
+ string bgImagesDir = Path.Combine(App.WebHostEnvironment.WebRootPath, "Captcha/Image");
string[] bgImagesFiles = Directory.GetFiles(bgImagesDir);
- if (bgImagesFiles == null || bgImagesFiles.Length == 0)
- throw Oops.Oh("背景图片文件丢失");
-
// 字体来自:https://www.zcool.com.cn/special/zcoolfonts/
- string fontsDir = Path.Combine(AppContext.BaseDirectory, "Captcha/ClickWord/Data", "Font");
+ string fontsDir = Path.Combine(App.WebHostEnvironment.WebRootPath, "Captcha/Font");
string[] fontFiles = new DirectoryInfo(fontsDir)?.GetFiles()
?.Where(m => m.Extension.ToLower() == ".ttf")
?.Select(m => m.FullName).ToArray();
- if (fontFiles == null || fontFiles.Length == 0)
- throw Oops.Oh("字体文件丢失");
int imgIndex = random.Next(bgImagesFiles.Length);
string randomImgFile = bgImagesFiles[imgIndex];
@@ -88,12 +84,15 @@ namespace Dilon.Core
{
// (int, int) percentPos = ToPercentPos((width, height), (_x, _y));
// 添加正确答案 位置数据
- rtnResult.repData.point.Add(new PointPosModel()
+ if (random.Next(0, 3).Equals(1) || (code_length - i).Equals(rightCodeLength - rtnResult.repData.point.Count))
{
- X = _x, //percentPos.Item1,
- Y = _y //percentPos.Item2,
- });
- words.Add(word);
+ rtnResult.repData.point.Add(new PointPosModel()
+ {
+ X = _x, //percentPos.Item1,
+ Y = _y //percentPos.Item2,
+ });
+ words.Add(word);
+ }
}
g.DrawString(word, f, b, _x, _y);
}
@@ -105,7 +104,7 @@ namespace Dilon.Core
bitmap.Dispose();
ms.Dispose();
rtnResult.repData.originalImageBase64 = Convert.ToBase64String(ms.GetBuffer()); //"data:image/jpg;base64," +
- rtnResult.repData.token = Guid.NewGuid().ToString("N");
+ rtnResult.repData.token = IDGenerator.NextId().ToString();
// 缓存验证码正确位置集合
var cacheOptions = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(30));
@@ -152,17 +151,44 @@ namespace Dilon.Core
///
public string RandomCode(int number)
{
- var str = "左怀军天地玄黄宇宙洪荒日月盈昃辰宿列张寒来暑往秋收冬藏闰余成岁律吕调阳云腾致雨露结为霜金生丽水玉出昆冈剑号巨阙珠称夜光果珍李柰菜重芥姜海咸河淡鳞潜羽翔龙师火帝鸟官人皇始制文字乃服衣裳推位让国有虞陶唐吊民伐罪周发殷汤坐朝问道垂拱平章爱育黎首臣伏戎羌遐迩体率宾归王";
- char[] str_char_arrary = str.ToArray();
+ char[] str_char_arrary = new char[] { '赵', '钱', '孙', '李', '周', '吴', '郑', '王', '冯', '陈', '褚', '卫', '蒋', '沈', '韩', '杨',
+ '朱', '秦', '尤', '许', '何', '吕', '施', '张', '孔', '曹', '严', '华', '金', '魏', '陶', '姜', '戚', '谢', '邹', '喻', '柏', '水',
+ '窦', '章', '云', '苏', '潘', '葛', '奚', '范', '彭', '郎', '鲁', '韦', '昌', '马', '苗', '凤', '花', '方', '任', '袁', '柳', '鲍',
+ '史', '唐', '费', '薛', '雷', '贺', '倪', '汤', '滕', '殷', '罗', '毕', '郝', '安', '常', '傅', '卞', '齐', '元', '顾', '孟', '平',
+ '黄', '穆', '萧', '尹', '姚', '邵', '湛', '汪', '祁', '毛', '狄', '米', '伏', '成', '戴', '谈', '宋', '茅', '庞', '熊', '纪', '舒',
+ '屈', '项', '祝', '董', '梁', '杜', '阮', '蓝', '闵', '季', '贾', '路', '娄', '江', '童', '颜', '郭', '梅', '盛', '林', '钟', '徐',
+ '邱', '骆', '高', '夏', '蔡', '田', '樊', '胡', '凌', '霍', '虞', '万', '支', '柯', '管', '卢', '莫', '柯', '房', '裘', '缪', '解',
+ '应', '宗', '丁', '宣', '邓', '单', '杭', '洪', '包', '诸', '左', '石', '崔', '吉', '龚', '程', '嵇', '邢', '裴', '陆', '荣', '翁',
+ '荀', '于', '惠', '甄', '曲', '封', '储', '仲', '伊', '宁', '仇', '甘', '武', '符', '刘', '景', '詹', '龙', '叶', '幸', '司', '黎',
+ '溥', '印', '怀', '蒲', '邰', '从', '索', '赖', '卓', '屠', '池', '乔', '胥', '闻', '莘', '党', '翟', '谭', '贡', '劳', '逄', '姬',
+ '申', '扶', '堵', '冉', '宰', '雍', '桑', '寿', '通', '燕', '浦', '尚', '农', '温', '别', '庄', '晏', '柴', '瞿', '阎', '连', '习',
+ '容', '向', '古', '易', '廖', '庾', '终', '步', '都', '耿', '满', '弘', '匡', '国', '文', '寇', '广', '禄', '阙', '东', '欧', '利',
+ '师', '巩', '聂', '关', '荆',
+ '伟', '刚', '勇', '毅', '俊', '峰', '强', '军', '平', '保', '东', '文', '辉', '力', '明', '永', '健', '世', '广', '志', '义', '兴',
+ '良', '海', '山', '仁', '波', '宁', '贵', '福', '生', '龙', '元', '全', '国', '胜', '学', '祥', '才', '发', '武', '新', '利', '清',
+ '飞', '彬', '富', '顺', '信', '子', '杰', '涛', '昌', '成', '康', '星', '光', '天', '达', '安', '岩', '中', '茂', '进', '林', '有',
+ '坚', '和', '彪', '博', '诚', '先', '敬', '震', '振', '壮', '会', '思', '群', '豪', '心', '邦', '承', '乐', '绍', '功', '松', '善',
+ '厚', '庆', '磊', '民', '友', '裕', '河', '哲', '江', '超', '浩', '亮', '政', '谦', '亨', '奇', '固', '之', '轮', '翰', '朗', '伯',
+ '宏', '言', '若', '鸣', '朋', '斌', '梁', '栋', '维', '启', '克', '伦', '翔', '旭', '鹏', '泽', '晨', '辰', '士', '以', '建', '家',
+ '致', '树', '炎', '德', '行', '时', '泰', '盛', '雄', '琛', '钧', '冠', '策', '腾', '楠', '榕', '风', '航', '弘', '秀', '娟', '英',
+ '华', '慧', '巧', '美', '娜', '静', '淑', '惠', '珠', '翠', '雅', '芝', '玉', '萍', '红', '娥', '玲', '芬', '芳', '燕', '彩', '春',
+ '菊', '兰', '凤', '洁', '梅', '琳', '素', '云', '莲', '真', '环', '雪', '荣', '爱', '妹', '霞', '香', '月', '莺', '媛', '艳', '瑞',
+ '凡', '佳', '嘉', '琼', '勤', '珍', '贞', '莉', '桂', '娣', '叶', '璧', '璐', '娅', '琦', '晶', '妍', '茜', '秋', '珊', '莎', '锦',
+ '黛', '青', '倩', '婷', '姣', '婉', '娴', '瑾', '颖', '露', '瑶', '怡', '婵', '雁', '蓓', '纨', '仪', '荷', '丹', '蓉', '眉', '君',
+ '琴', '蕊', '薇', '菁', '梦', '岚', '苑', '婕', '馨', '瑗', '琰', '韵', '融', '园', '艺', '咏', '卿', '聪', '澜', '纯', '毓', '悦',
+ '昭', '冰', '爽', '琬', '茗', '羽', '希', '欣', '飘', '育', '滢', '馥', '筠', '柔', '竹', '霭', '凝', '晓', '欢', '霄', '枫', '芸',
+ '菲', '寒', '伊', '亚', '宜', '可', '姬', '舒', '影', '荔', '枝', '丽', '阳', '妮', '宝', '贝', '初', '程', '梵', '罡', '恒', '鸿',
+ '桦', '骅', '剑', '娇', '纪', '宽', '苛', '灵', '玛', '媚', '琪', '晴', '容', '睿', '烁', '堂', '唯', '威', '韦', '雯', '苇', '萱',
+ '阅', '彦', '宇', '雨', '洋', '忠', '宗', '曼', '紫', '逸', '贤', '蝶', '菡', '绿', '蓝', '儿', '翠', '烟' };
Random rand = new Random();
- HashSet hs = new HashSet();
+ HashSet hs = new HashSet();
bool randomBool = true;
while (randomBool)
{
if (hs.Count == number)
break;
int rand_number = rand.Next(str_char_arrary.Length);
- hs.Add(str_char_arrary[rand_number].ToString());
+ hs.Add(str_char_arrary[rand_number]);
}
return string.Join("", hs);
}
@@ -184,7 +210,7 @@ namespace Dilon.Core
return res;
}
- var userVCodePos = JSON.GetJsonSerializer().Deserialize>(input.PointJson);
+ var userVCodePos = JSON.Deserialize>(input.PointJson);
if (userVCodePos == null || userVCodePos.Count < rightVCodePos.Count)
{
res.repCode = "6111";
@@ -192,7 +218,7 @@ namespace Dilon.Core
return res;
}
- int allowOffset = 20; // 允许的偏移量(点触容错)
+ int allowOffset = 25; // 允许的偏移量(点触容错)
for (int i = 0; i < userVCodePos.Count; i++)
{
var xOffset = userVCodePos[i].X - rightVCodePos[i].X;
diff --git a/backend/Dilon.Core/Captcha/ClickWord/Data/Image/10.jpg b/backend/Dilon.Core/Captcha/ClickWord/Data/Image/10.jpg
deleted file mode 100644
index 93fed9887bdb03fe3e9202fe6011f200258956b9..0000000000000000000000000000000000000000
Binary files a/backend/Dilon.Core/Captcha/ClickWord/Data/Image/10.jpg and /dev/null differ
diff --git a/backend/Dilon.Core/Captcha/ClickWord/Data/Image/11.jpg b/backend/Dilon.Core/Captcha/ClickWord/Data/Image/11.jpg
deleted file mode 100644
index 51c56e1d2e0eb3cbf249a5af5bac0d695e308e60..0000000000000000000000000000000000000000
Binary files a/backend/Dilon.Core/Captcha/ClickWord/Data/Image/11.jpg and /dev/null differ
diff --git a/backend/Dilon.Core/Captcha/ClickWord/Data/Image/12.jpg b/backend/Dilon.Core/Captcha/ClickWord/Data/Image/12.jpg
deleted file mode 100644
index e50ac9021b2da348a6dadb7cbd62625d0922b6d8..0000000000000000000000000000000000000000
Binary files a/backend/Dilon.Core/Captcha/ClickWord/Data/Image/12.jpg and /dev/null differ
diff --git a/backend/Dilon.Core/Captcha/ClickWord/Data/Image/9.jpg b/backend/Dilon.Core/Captcha/ClickWord/Data/Image/9.jpg
deleted file mode 100644
index 548f36bf0b0912a9f241df8af0627b7cad0f4d7f..0000000000000000000000000000000000000000
Binary files a/backend/Dilon.Core/Captcha/ClickWord/Data/Image/9.jpg and /dev/null differ
diff --git a/backend/Dilon.Core/Const/ClaimConst.cs b/backend/Dilon.Core/Const/ClaimConst.cs
index 0bda0cbbea67d33fa6581c6371bbeb81019f89fe..d9bc93dc06bbf038eb78543a7958a2440e6667cc 100644
--- a/backend/Dilon.Core/Const/ClaimConst.cs
+++ b/backend/Dilon.Core/Const/ClaimConst.cs
@@ -22,5 +22,10 @@
///
public const string CLAINM_SUPERADMIN = "SuperAdmin";
+ ///
+ /// 是否超级管理
+ ///
+ public const string TENANT_ID = "TenantId";
+
}
}
diff --git a/backend/Dilon.Core/Const/CommonConst.cs b/backend/Dilon.Core/Const/CommonConst.cs
index 93e433d1a712b745444af0d391189477edfda6b6..7b304b4bdb39e1fbe752fdd233d802354c9a0436 100644
--- a/backend/Dilon.Core/Const/CommonConst.cs
+++ b/backend/Dilon.Core/Const/CommonConst.cs
@@ -10,26 +10,26 @@
///
/// 用户缓存
///
- public const string CACHE_KEY_USER = "_user";
+ public const string CACHE_KEY_USER = "user_";
///
/// 菜单缓存
///
- public const string CACHE_KEY_MENU = "_menu";
+ public const string CACHE_KEY_MENU = "menu_";
///
/// 权限缓存
///
- public const string CACHE_KEY_PERMISSION = "_permission";
+ public const string CACHE_KEY_PERMISSION = "permission_";
///
/// 数据范围缓存
///
- public const string CACHE_KEY_DATASCOPE = "_datascope";
+ public const string CACHE_KEY_DATASCOPE = "datascope_";
///
/// 验证码缓存
///
- public const string CACHE_KEY_CODE = "_code";
+ public const string CACHE_KEY_CODE = "vercode_";
}
}
diff --git a/backend/Dilon.Core/Dilon.Core.csproj b/backend/Dilon.Core/Dilon.Core.csproj
index adb6eb1b19180f1333e330a5cbf51a5edae9a23f..3868329820002cc3c524b049ea8a58af2898b8a4 100644
--- a/backend/Dilon.Core/Dilon.Core.csproj
+++ b/backend/Dilon.Core/Dilon.Core.csproj
@@ -24,93 +24,25 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
+
PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
+
+
+
+
+
PreserveNewest
diff --git a/backend/Dilon.Core/Dilon.Core.xml b/backend/Dilon.Core/Dilon.Core.xml
index b14d58a58ee9256fc9e5802b40853d5069e2bc7b..3bb722adb1bf62412d5f3084f780f465fe19ede7 100644
--- a/backend/Dilon.Core/Dilon.Core.xml
+++ b/backend/Dilon.Core/Dilon.Core.xml
@@ -130,6 +130,12 @@
有效期
+
+
+ 获取所有缓存
+
+
+
内存缓存
@@ -273,6 +279,11 @@
是否超级管理
+
+
+ 是否超级管理
+
+
默认密码
@@ -303,6 +314,16 @@
验证码缓存
+
+
+ 自定义租户基类实体
+
+
+
+
+ 租户id
+
+
自定义实体基类
@@ -313,11 +334,6 @@
主键Id
-
-
- 租户Id
-
-
创建时间
@@ -333,11 +349,21 @@
创建者Id
+
+
+ 创建者名称
+
+
修改者Id
+
+
+ 修改者名称
+
+
软删除
@@ -374,94 +400,119 @@
排序
-
+
代码生成表
-
+
作者姓名
-
-
- 类名
-
-
-
+
是否移除表前缀
-
+
生成方式
-
+
数据库表名
-
+
- 包名
+ 命名空间
-
+
- 业务名(业务代码包名称)
+ 业务名
-
+
- 功能名(数据库表名称)
+ 代码生成字段配置表
-
+
- 文件信息表
+ 代码生成主表ID
-
+
- 文件存储位置(1:阿里云,2:腾讯云,3:minio,4:本地)
+ 数据库字段名
-
+
- 文件仓库
+ 字段描述
-
+
- 文件名称(上传时候的文件名)
+ .NET数据类型
-
+
- 文件后缀
+ 作用类型(字典)
-
+
- 文件大小kb
+ 字典code
-
+
- 文件大小信息,计算后的
+ 列表是否缩进(字典)
-
+
- 存储到bucket的名称(文件唯一标识id)
+ 是否必填(字典)
-
+
- 存储路径
+ 是否是查询条件
+
+
+
+
+ 查询方式
+
+
+
+
+ 列表显示
+
+
+
+
+ 增改
+
+
+
+
+ 主外键
+
+
+
+
+ 数据库中类型(物理类型)
+
+
+
+
+ 是否通用字段
@@ -639,7 +690,7 @@
- 员工id
+ 员工Id
@@ -674,7 +725,7 @@
- 员工id
+ 员工Id
@@ -692,6 +743,51 @@
一对一引用(职位)
+
+
+ 文件信息表
+
+
+
+
+ 文件存储位置(1:阿里云,2:腾讯云,3:minio,4:本地)
+
+
+
+
+ 文件仓库
+
+
+
+
+ 文件名称(上传时候的文件名)
+
+
+
+
+ 文件后缀
+
+
+
+
+ 文件大小kb
+
+
+
+
+ 文件大小信息,计算后的
+
+
+
+
+ 存储到bucket的名称(文件唯一标识id)
+
+
+
+
+ 存储路径
+
+
系统操作/审计日志表
@@ -737,19 +833,69 @@
操作方式:新增、更新、删除
-
+
- 操作日志表
+ 异常日志
-
+
+
+ 操作人
+
+
+
名称
-
+
+
+ 类名
+
+
+
+
+ 方法名
+
+
+
+
+ 异常名称
+
+
+
+
+ 异常信息
+
+
+
+
+ 异常源
+
+
+
+
+ 堆栈信息
+
+
+
+
+ 参数对象
+
+
+
+
+ 异常时间
+
+
+
+
+ 操作日志表
+
+
+
- 操作类型(0其他 1增加 2删除 3编辑)(见LogAnnotionOpTypeEnum)
+ 名称
@@ -764,7 +910,7 @@
- ip
+ IP
@@ -869,7 +1015,7 @@
- 访问类型(字典 1登入 2登出)
+ 访问类型
@@ -1049,7 +1195,7 @@
- 通知公告id
+ 通知公告Id
@@ -1074,7 +1220,7 @@
- 第三方平台的用户唯一id
+ 第三方平台的用户唯一Id
@@ -1365,55 +1511,82 @@
一对一引用(系统菜单)
-
+
- 定时任务
+ 租户表
-
+
- 任务名称
+ 公司名称
- dilon
-
+
- 任务分组
+ 管理员名称
- dilon
-
+
- 开始时间
+ 主机
-
+
- 结束时间
+ 电子邮箱
- null
-
+
- Cron表达式
+ 电话
-
-
+
+
+ 数据库连接
+
+
+
+
+ 架构
+
+
+
+
+ 备注
+
+
+
+
+ 定时任务
+
+
+
- 执行次数(默认无限循环)
+ 任务名称
- 10
+ dilon
- 执行间隔时间,单位秒(如果有Cron,则IntervalSecond失效)
+ 执行间隔时间(单位秒)
5
-
+
+
+ Cron表达式
+
+
+
+
+
+ 定时器类型
+
+
+
- 触发器类型
+ 执行次数
@@ -1440,7 +1613,7 @@
- 描述
+ 备注
@@ -1455,7 +1628,7 @@
- 密码(采用MD5加密)
+ 密码(默认MD5加密)
@@ -1578,7 +1751,7 @@
- 系统用户Id
+ 用户Id
@@ -1606,9 +1779,14 @@
超级管理员
+
+
+ 管理员
+
+
- 非管理员
+ 普通账号
@@ -1631,6 +1809,81 @@
删除
+
+
+ 数据操作类型
+
+
+
+
+ 其它
+
+
+
+
+ 增加
+
+
+
+
+ 删除
+
+
+
+
+ 编辑
+
+
+
+
+ 更新
+
+
+
+
+ 查询
+
+
+
+
+ 详情
+
+
+
+
+ 树
+
+
+
+
+ 导入
+
+
+
+
+ 导出
+
+
+
+
+ 授权
+
+
+
+
+ 强退
+
+
+
+
+ 清空
+
+
+
+
+ 修改状态
+
+
全部数据
@@ -1781,6 +2034,11 @@
附属机构下有员工禁止删除
+
+
+ 只能增加下级机构
+
+
字典类型不存在
@@ -1926,34 +2184,64 @@
演示环境禁止修改数据
-
+
- 已存在同名或同编码项目
+ 已存在同名或同主机租户
-
+
- 已存在相同证件号码人员
+ 该表代码模板已经生成过
-
+
- 检测数据不存在
+ 该类型不存在
-
+
- 文件存储位置
+ 该字段不存在
-
+
- 阿里云
+ 该类型不是枚举类型
-
+
- 腾讯云
+ 该实体不存在
+
+
+
+
+ 已存在同名或同编码项目
+
+
+
+
+ 已存在相同证件号码人员
+
+
+
+
+ 检测数据不存在
+
+
+
+
+ 文件存储位置
+
+
+
+
+ 阿里云
+
+
+
+
+ 腾讯云
@@ -1986,79 +2274,241 @@
未知
-
+
- 日志操作类型
+ HTTP状态码
-
+
- 其它
+ 客户端可能继续其请求
-
+
- 增加
+ 正在更改协议版本或协议
-
+
- 删除
+ 请求成功,且请求的信息包含在响应中
-
+
- 编辑
+ 请求导致在响应被发送前创建新资源
-
+
- 更新
+ 请求已被接受做进一步处理
-
+
- 查询
+ 返回的元信息来自缓存副本而不是原始服务器,因此可能不正确
-
+
- 详情
+ 已成功处理请求并且响应已被设定为无内容
-
+
- 树
+ 客户端应重置(或重新加载)当前资源
-
+
- 导入
+ 响应是包括字节范围的 GET请求所请求的部分响应
-
+
- 导出
+ 请求的信息有多种表示形式,默认操作是将此状态视为重定向
-
+
- 授权
+ 请求的信息已移到 Location头中指定的 URI 处
-
+
- 强退
+ 请求的信息位于 Location 头中指定的 URI 处
-
+
- 清空
+ 将客户端自动重定向到 Location 头中指定的 URI
-
+
- 修改状态
+ 客户端的缓存副本是最新的
+
+
+
+
+ 请求应使用位于 Location 头中指定的 URI 的代理服务器
+
+
+
+
+ 服务器未能识别请求
+
+
+
+
+ 请求的资源要求身份验证
+
+
+
+
+ 需要付费
+
+
+
+
+ 服务器拒绝满足请求
+
+
+
+
+ 请求的资源不在服务器上
+
+
+
+
+ 请求的资源上不允许请求方法(POST或 GET)
+
+
+
+
+ 客户端已用 Accept 头指示将不接受资源的任何可用表示形式
+
+
+
+
+ 请求的代理要求身份验证
+ Proxy-authenticate 头包含如何执行身份验证的详细信息
+
+
+
+
+ 客户端没有在服务器期望请求的时间内发送请求
+
+
+
+
+ 由于服务器上的冲突而未能执行请求
+
+
+
+
+ 请求的资源不再可用
+
+
+
+
+ 缺少必需的 Content-length
+
+
+
+
+ 为此请求设置的条件失败,且无法执行此请求
+ 条件是用条件请求标头(如 If-Match、If-None-Match 或 If-Unmodified-Since)设置的。
+
+
+
+
+ 请求太大,服务器无法处理
+
+
+
+
+ URI 太长
+
+
+
+
+ 请求是不支持的类型
+
+
+
+
+ 无法返回从资源请求的数据范围,因为范围的开头在资源的开头之前,或因为范围的结尾在资源的结尾之后
+
+
+
+
+ 服务器未能符合Expect头中给定的预期值
+
+
+
+
+ 服务器拒绝处理客户端使用当前协议发送的请求,但是可以接受其使用升级后的协议发送的请求
+
+
+
+
+ 服务器上发生了一般错误
+
+
+
+
+ 服务器不支持请求的函数
+
+
+
+
+ 中间代理服务器从另一代理或原始服务器接收到错误响应
+
+
+
+
+ 服务器暂时不可用,通常是由于过多加载或维护
+
+
+
+
+ 中间代理服务器在等待来自另一个代理或原始服务器的响应时已超时
+
+
+
+
+ 服务器不支持请求的HTTP版本
+
+
+
+
+ 登陆类型
+
+
+
+
+ 登陆
+
+
+
+
+ 登出
+
+
+
+
+ 注册
+
+
+
+
+ 改密
+
+
+
+
+ 三方授权登陆
@@ -2161,6 +2611,81 @@
已读
+
+
+ 查询类型的枚举
+
+
+
+
+ 等于
+
+
+
+
+ 模糊
+
+
+
+
+ 大于
+
+
+
+
+ 小于
+
+
+
+
+ 不等于
+
+
+
+
+ 大于等于
+
+
+
+
+ 小于等于
+
+
+
+
+ 不为空
+
+
+
+
+ http请求类型
+
+
+
+
+ 无
+
+
+
+
+ GET请求
+
+
+
+
+ POST请求
+
+
+
+
+ PUT请求
+
+
+
+
+ DELETE请求
+
+
菜单激活类型
@@ -2202,6 +2727,69 @@
+
+
+ 枚举扩展
+
+
+
+
+ 获取枚举对象Key与名称的字典(缓存)
+
+
+
+
+
+
+ 获取枚举对象Key与名称的字典
+
+
+
+
+
+
+ 获取枚举类型key与描述的字典(缓存)
+
+
+
+
+
+
+
+ 获取枚举类型key与描述的字典(没有描述则获取name)
+
+
+
+
+
+
+
+ 从程序集中查找指定枚举类型
+
+
+
+
+
+
+
+ 从程序集中加载所有枚举类型
+
+
+
+
+
+
+ 通用输入帮助类
+
+
+
+
+ 排序方式(默认降序)
+
+
+ 是否降序
+
+
通用输入扩展参数(带权限)
@@ -2252,6 +2840,21 @@
搜索结束时间
+
+
+ 排序字段
+
+
+
+
+ 排序方法,默认升序,否则降序(配合antd前端,约定参数为 Ascend,Dscend)
+
+
+
+
+ 降序排序(不要问我为什么是descend不是desc,前端约定参数就是这样)
+
+
小诺分页列表结果
@@ -2270,14 +2873,6 @@
-
-
- 处理输出状态码
-
-
-
-
-
成功返回值
@@ -2295,6 +2890,15 @@
+
+
+ 处理输出状态码
+
+
+
+
+
+
RESTful风格---XIAONUO返回格式
@@ -2532,14 +3136,6 @@
-
-
- 扩展机构种子数据
-
-
-
-
-
系统员工职位表种子数据
@@ -2605,12 +3201,7 @@
-
-
- 系统角色表种子数据
-
-
-
+
种子数据
@@ -2618,6 +3209,40 @@
+
+
+ 种子数据
+
+
+
+
+
+
+
+ 种子数据
+
+
+
+
+
+
+
+ 系统角色表种子数据
+
+
+
+
+ 种子数据
+
+
+
+
+
+
+
+ 租户种子数据
+
+
系统任务调度表种子数据
@@ -2700,6 +3325,11 @@
系统应用参数
+
+
+ 应用Id
+
+
名称
@@ -2964,6 +3594,29 @@
数据范围(机构)信息
+
+
+ 注册输入参数
+
+
+
+
+ 用户名
+
+ superAdmin
+
+
+
+ 公司名
+
+ superAdmin
+
+
+
+ 密码
+
+ 123456
+
系统缓存服务
@@ -3029,6 +3682,13 @@
+
+
+ 删除某特征关键字缓存
+
+
+
+
设置缓存
@@ -3052,54 +3712,439 @@
+
+
+ 代码生成详细配置服务
+
+
+
+
+ 代码生成详细配置列表
+
+
+
+
+
+
+ 增加
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+ 更新
+
+
+
+
+
+
+ 详情
+
+
+
+
+
+
+ 批量增加
+
+
+
+
+
+
+ 数据类型转显示类型
+
+
+
+
代码生成器服务
-
+
+
+ 分页查询
+
+
+
+
+
+
+ 增加
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+ 更新
+
+
+
+
+
+
+ 详情
+
+
+
+
+
+
+ 获取数据库表(实体)集合
+
+
+
+
+
+ 获取数据表列(实体属性)集合
+
+
+
+
+
+ 代码生成_本地项目
+
+
+
+
+
+ 获取模板文件路径集合
+
+
+
+
+
+ 设置生成文件路径
+
+
+
+
+
+
+ 代码生成详细配置参数
+
+
+
+
+ 主键
+
+
+
+
+ 代码生成主表ID
+
+
+
+
+ 数据库字段名
+
+
+
+
+ 字段描述
+
+
+
+
+ .NET类型
+
+
+
+
+ 作用类型(字典)
+
+
+
+
+ 字典code
+
+
+
+
+ 列表是否缩进(字典)
+
+
+
+
+ 是否必填(字典)
+
+
+
+
+ 是否是查询条件
+
+
+
+
+ 查询方式
+
+
+
+
+ 列表显示
+
+
+
+
+ 增改
+
+
+
+
+ 主外键
+
+
+
+
+ 数据库中类型(物理类型)
+
+
+
+
+ 是否是通用字段
+
+
+
+
+ 代码生成参数类
+
+
+
+
+ 作者姓名
+
+
+
+
+ 类名
+
+
+
+
+ 是否移除表前缀
+
+
+
+
+ 生成方式
+
+
+
+
+ 数据库表名
+
+
+
+
+ 命名空间
+
+
+
+
+ 业务名(业务代码包名称)
+
+
+
+
+ 功能名(数据库表名称)
+
+
+
+
+ 数据库表名
+
+
+
+
+ 业务名(业务代码包名称)
+
+
+
+
+ 命名空间
+
+
+
+
+ 作者姓名
+
+
+
+
+ 生成方式
+
+
+
+
+ 代码生成器Id
+
+
+
+
+ 代码生成器Id
+
+
+
代码生成参数类
-
+
+
+ 代码生成器Id
+
+
+
作者姓名
-
+
类名
-
+
是否移除表前缀
-
+
+
+ 生成方式
+
+
+
+
+ 数据库表名
+
+
+
+
+ 包名
+
+
+
+
+ 业务名(业务代码包名称)
+
+
+
+
+ 功能名(数据库表名称)
+
+
+
+
+ 数据库表列
+
+
+
+
+ 字段名
+
+
+
+
+ 数据库中类型
+
+
+
+
+ 字段描述
+
+
+
+
+ 主外键
+
+
+
+
+ 数据库表列表参数
+
+
+
+
+ 表名(字母形式的)
+
+
+
+
+ 创建时间
+
+
+
+
+ 更新时间
+
+
+
+
+ 表名称描述(注释)(功能名)
+
+
+
+
+ 作者姓名
+
+
+
+
+ 是否移除表前缀
+
+
+
+
+ 生成方式
+
+
+
+
+ 数据库表名
+
+
+
- 生成方式
+ 数据库表名(经过组装的)
-
+
- 数据库表名
+ 代码包名
-
+
- 包名
+ 生成时间(string类型的)
-
+
- 业务名(业务代码包名称)
+ 数据库表中字段集合
-
+
- 功能名(数据库表名称)
+ 业务名
@@ -3236,6 +4281,12 @@
+
+
+ 获取日志写入间隔和数量
+
+
+
字典值参数
@@ -3306,6 +4357,11 @@
字典值参数
+
+
+ 字典Id
+
+
字典类型与字典值构造的树
@@ -3761,6 +4817,67 @@
+
+
+ 获取子机构用户
+
+
+
+
+
+
+ 枚举输入参数
+
+
+
+
+ 枚举类型名称
+
+
+
+
+ 实体名称
+
+
+
+
+ 字段名称
+
+
+
+
+ 枚举输出参数
+
+
+
+
+ 字典Id
+
+
+
+
+ 字典值
+
+
+
+
+ 枚举值服务
+
+
+
+
+ 通过枚举类型获取枚举值集合
+
+
+
+
+
+
+ 通过实体字段类型获取相关集合(目前仅支持枚举类型)
+
+
+
+
上传文件参数
@@ -3816,6 +4933,11 @@
上传文件参数
+
+
+ 文件Id
+
+
文件服务
@@ -3899,19 +5021,59 @@
-
+
- 请求日志参数
+ 异常日志参数
-
+
+
+ 操作人
+
+
+
名称
-
+
+
+ 类名
+
+
+
+
+ 方法名
+
+
+
+
+ 异常名称
+
+
+
+
+ 异常信息
+
+
+
+
+ 异常时间
+
+
+
+
+ 异常日志参数
+
+
+
+
+ 请求日志参数
+
+
+
- 操作类型(0其他 1增加 2删除 3编辑)(见LogAnnotionOpTypeEnum)
+ 名称
@@ -4036,7 +5198,7 @@
- 访问类型(字典 1登入 2登出)
+ 访问类型
@@ -4054,6 +5216,24 @@
访问日志参数
+
+
+ 异常日志服务
+
+
+
+
+ 分页查询异常日志
+
+
+
+
+
+
+ 清空异常日志
+
+
+
操作日志服务
@@ -4698,7 +5878,7 @@
通知公告用户
-
+
增加
@@ -4707,7 +5887,7 @@
-
+
更新
@@ -4723,7 +5903,7 @@
-
+
设置通知公告读取状态
@@ -4956,6 +6136,12 @@
+
+
+ 获取所有的机构组织Id集合
+
+
+
获取用户数据范围(机构Id集合)
@@ -5312,319 +6498,352 @@
-
+
- 任务调度参数
+ 租户参数
-
+
- 任务名称
+ 公司名称
- dilon
-
+
- 任务分组
+ 管理员名称
- dilon
-
+
- 开始时间
+ 主机
-
+
- 结束时间
+ 电子邮箱
- null
-
+
- Cron表达式
+ 电话号码
-
-
+
- 执行次数(默认无限循环)
+ 模式
- 10
-
+
- 执行间隔时间,单位秒(如果有Cron,则IntervalSecond失效)
+ 数据库连接
- 5
-
+
- 触发器类型
+ 备注
-
+
- 请求url
+ 创建时间
-
+
- 请求参数(Post,Put请求用)
+ 公司名称
-
+
- Headers(可以包含如:Authorization授权认证)
- 格式:{"Authorization":"userpassword.."}
+ 管理员名称
-
+
- 请求类型
+ 主机名称
- 2
-
+
- 描述
+ 数据库连接
-
+
- 任务状态
+ 电子邮箱
-
+
- 任务Id
+ 租户Id
-
+
- 任务信息---任务详情
+ 租户Id
-
+
- 任务名称
+ 租户参数
-
+
- 任务组名
+ 租户Id
-
+
- 下次执行时间
+ 名称
-
+
- 上次执行时间
+ 名称
-
+
- 开始时间
+ 主机
-
+
- 结束时间
+ 电子邮箱
-
+
- 上次执行的异常信息
+ 电话号码
-
+
- 任务状态
+ 模式
-
+
- 描述
+ 数据库连接
-
+
- 显示状态
+ 备注
-
+
- 时间间隔
+ 创建时间
-
+
- 请求地址
+ 租户服务
-
+
- 请求类型
+ 分页查询租户
+
+
-
+
- 已经执行的次数
+ 增加租户
+
+
-
+
- 任务调度中心
+ 新增租户时,初始化数据
+
-
+
- 开启调度器
+ 删除租户
+
-
+
- 停止调度器
+ 更新租户
+
+
-
+
- 添加一个工作任务
+ 获取租户
-
+
- 暂停任务
+ 授权租户管理员角色菜单
-
+
- 删除任务
+ 获取租户管理员角色拥有菜单Id集合
-
+
- 恢复运行暂停的任务
+ 重置租户管理员密码
-
+
- 查询任务
+ 获取租户管理员用户
-
+
-
+
- 立即执行
+ 任务调度参数
-
-
-
+
- 获取任务日志
+ 任务名称
-
-
-
+
- 获取任务运行次数
+ 执行间隔时间(单位秒)
-
-
+ 5
-
+
- 获取所有任务详情
+ Cron表达式
-
-
+
- 从数据库里面获取所有任务并初始化
+ 定时器类型
-
+
- 创建类型Simple的触发器
+ 执行次数
-
-
-
+
- 创建类型Cron的触发器
+ 请求url
+
+
+
+
+ 请求参数(Post,Put请求用)
+
+
+
+
+ Headers(可以包含如:Authorization授权认证)
+ 格式:{"Authorization":"userpassword.."}
+
+
+
+
+ 请求类型
+
+
+
+
+ 备注
-
-
-
+
- 任务调度相关常量
+ 任务Id
-
+
- 请求url RequestUrl
+ 任务信息---任务详情
-
+
- 请求参数 RequestParameters
+ Id
-
+
- Headers(可以包含:Authorization授权认证)
+ 任务名称
-
+
- 请求类型 RequestType
+ 执行间隔时间(单位秒)
-
+
- 日志 LogList
+ Cron表达式
-
+
- 异常 Exception
+ 定时器类型
-
+
执行次数
-
+
- 任务结束时间
+ 请求url
-
+
- http请求类型
+ 请求参数(Post,Put请求用)
+
+
+
+
+ Headers(可以包含如:Authorization授权认证)
+ 格式:{"Authorization":"userpassword.."}
+
+
+
+
+ 请求类型
+
+ 2
+
+
+
+ 备注
+
+
+
+
+ 定时器状态
-
+
- 触发器类型
+ 异常信息
@@ -5632,28 +6851,28 @@
任务调度服务
-
+
分页获取任务列表
-
+
增加任务
-
+
删除任务
-
+
修改任务
@@ -5667,20 +6886,33 @@
-
+
停止任务
-
+
启动任务
+
+
+ 新增定时任务
+
+
+
+
+
+ 初始化定时任务
+
+
+
+
AuthToken参数
@@ -6047,11 +7279,18 @@
- 用户导出(未实现)
+ 用户导出
+
+
+ 用户导入
+
+
+
+
根据用户Id获取用户
@@ -6185,6 +7424,19 @@
+
+
+ 反射工具
+
+
+
+
+ 获取字段特性
+
+
+
+
+
树基类
diff --git a/backend/Dilon.Core/Entity/DBEntityTenant.cs b/backend/Dilon.Core/Entity/DBEntityTenant.cs
new file mode 100644
index 0000000000000000000000000000000000000000..d899b77325b89b36f69f5d5a0ed864957a0d633b
--- /dev/null
+++ b/backend/Dilon.Core/Entity/DBEntityTenant.cs
@@ -0,0 +1,16 @@
+using Microsoft.EntityFrameworkCore;
+
+namespace Dilon.Core.Entity
+{
+ ///
+ /// 自定义租户基类实体
+ ///
+ public abstract class DBEntityTenant : DEntityBase
+ {
+ ///
+ /// 租户id
+ ///
+ [Comment("租户id")]
+ public virtual long? TenantId { get; set; }
+ }
+}
diff --git a/backend/Dilon.Core/Entity/DEntityBase.cs b/backend/Dilon.Core/Entity/DEntityBase.cs
index 50e7135b2d709dbb1f68b42f636487d8a1585405..e9d6801aac770cdfc3e1601d3c34e87a33fa054f 100644
--- a/backend/Dilon.Core/Entity/DEntityBase.cs
+++ b/backend/Dilon.Core/Entity/DEntityBase.cs
@@ -1,4 +1,5 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -16,38 +17,52 @@ namespace Dilon.Core
///
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
+ [Comment("Id主键")]
public virtual long Id { get; set; }
- ///
- /// 租户Id
- ///
- [JsonIgnore]
- public virtual Guid? TenantId { get; set; }
-
///
/// 创建时间
///
+ [Comment("创建时间")]
public virtual DateTimeOffset? CreatedTime { get; set; }
///
/// 更新时间
///
+ [Comment("更新时间")]
public virtual DateTimeOffset? UpdatedTime { get; set; }
///
/// 创建者Id
///
+ [Comment("创建者Id")]
public virtual long? CreatedUserId { get; set; }
+ ///
+ /// 创建者名称
+ ///
+ [Comment("创建者名称")]
+ [MaxLength(20)]
+ public virtual string CreatedUserName { get; set; }
+
///
/// 修改者Id
///
+ [Comment("修改者Id")]
public virtual long? UpdatedUserId { get; set; }
+ ///
+ /// 修改者名称
+ ///
+ [Comment("修改者名称")]
+ [MaxLength(20)]
+ public virtual string UpdatedUserName { get; set; }
+
///
/// 软删除
///
[JsonIgnore, FakeDelete(true)]
- public virtual bool IsDeleted { get; set; }
+ [Comment("软删除标记")]
+ public virtual bool IsDeleted { get; set; } = false;
}
}
diff --git a/backend/Dilon.Core/Entity/SysApp.cs b/backend/Dilon.Core/Entity/SysApp.cs
index aab29d944e5b0b4c39f18450692e2dc8d2bf90c1..447e534a977904982203bd2364759835d6fa8cc1 100644
--- a/backend/Dilon.Core/Entity/SysApp.cs
+++ b/backend/Dilon.Core/Entity/SysApp.cs
@@ -1,5 +1,5 @@
-using Furion.Snowflake;
-using System;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -8,40 +8,41 @@ namespace Dilon.Core
/// 系统应用表
///
[Table("sys_app")]
+ [Comment("系统应用表")]
public class SysApp : DEntityBase
{
- public SysApp()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 名称
///
+ [Comment("名称")]
+ [Required, MaxLength(20)]
public string Name { get; set; }
///
/// 编码
///
+ [Comment("编码")]
+ [Required, MaxLength(50)]
public string Code { get; set; }
///
/// 是否默认激活(Y-是,N-否),只能有一个系统默认激活
/// 用户登录后默认展示此系统菜单
///
+ [Comment("是否默认激活")]
+ [MaxLength(5)]
public string Active { get; set; }
///
/// 状态(字典 0正常 1停用 2删除)
///
- public int Status { get; set; }
+ [Comment("状态")]
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 排序
///
+ [Comment("排序")]
public int Sort { get; set; }
}
}
diff --git a/backend/Dilon.Core/Entity/SysCodeGen.cs b/backend/Dilon.Core/Entity/SysCodeGen.cs
index 983eee1cefae01563e05dd2d06dc89145e3d0f8a..1ab18823df91f803537396a228c9c9627e5a84de 100644
--- a/backend/Dilon.Core/Entity/SysCodeGen.cs
+++ b/backend/Dilon.Core/Entity/SysCodeGen.cs
@@ -1,60 +1,56 @@
-using Furion.Snowflake;
-using System;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-namespace Dilon.Core.Entity
+namespace Dilon.Core
{
///
/// 代码生成表
///
[Table("sys_code_gen")]
+ [Comment("代码生成表")]
public class SysCodeGen : DEntityBase
{
- public SysCodeGen()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- }
-
///
/// 作者姓名
///
+ [Comment("作者姓名")]
+ [MaxLength(20)]
public string AuthorName { get; set; }
- ///
- /// 类名
- ///
- public string ClassName { get; set; }
-
///
/// 是否移除表前缀
///
+ [Comment("是否移除表前缀")]
+ [MaxLength(5)]
public string TablePrefix { get; set; }
///
/// 生成方式
///
+ [Comment("生成方式")]
+ [MaxLength(20)]
public string GenerateType { get; set; }
///
/// 数据库表名
///
+ [Comment("数据库表名")]
+ [MaxLength(100)]
public string TableName { get; set; }
///
- /// 包名
+ /// 命名空间
///
- public string PackageName { get; set; }
+ [Comment("命名空间")]
+ [MaxLength(100)]
+ public string NameSpace { get; set; }
///
- /// 业务名(业务代码包名称)
+ /// 业务名
///
+ [Comment("业务名")]
+ [MaxLength(100)]
public string BusName { get; set; }
-
- ///
- /// 功能名(数据库表名称)
- ///
- public string TableComment { get; set; }
}
}
diff --git a/backend/Dilon.Core/Entity/SysCodeGenConfig.cs b/backend/Dilon.Core/Entity/SysCodeGenConfig.cs
new file mode 100644
index 0000000000000000000000000000000000000000..1ee21be7e8c96718e4183b6d066e80e99a106900
--- /dev/null
+++ b/backend/Dilon.Core/Entity/SysCodeGenConfig.cs
@@ -0,0 +1,118 @@
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Dilon.Core
+{
+ ///
+ /// 代码生成字段配置表
+ ///
+ [Table("sys_code_gen_config")]
+ [Comment("代码生成字段配置表")]
+ public class SysCodeGenConfig : DEntityBase
+ {
+ ///
+ /// 代码生成主表ID
+ ///
+ [Comment("代码生成主表ID")]
+ public long CodeGenId { get; set; }
+
+ ///
+ /// 数据库字段名
+ ///
+ [Comment("数据库字段名")]
+ [Required, MaxLength(100)]
+ public string ColumnName { get; set; }
+
+ ///
+ /// 字段描述
+ ///
+ [Comment("字段描述")]
+ [MaxLength(100)]
+ public string ColumnComment { get; set; }
+
+ ///
+ /// .NET数据类型
+ ///
+ [Comment(".NET数据类型")]
+ [MaxLength(50)]
+ public string NetType { get; set; }
+
+ ///
+ /// 作用类型(字典)
+ ///
+ [Comment("作用类型")]
+ [MaxLength(50)]
+ public string EffectType { get; set; }
+
+ ///
+ /// 字典code
+ ///
+ [Comment("字典Code")]
+ [MaxLength(50)]
+ public string DictTypeCode { get; set; }
+
+ ///
+ /// 列表是否缩进(字典)
+ ///
+ [Comment("列表是否缩进")]
+ [MaxLength(5)]
+ public string WhetherRetract { get; set; }
+
+ ///
+ /// 是否必填(字典)
+ ///
+ [Comment("是否必填")]
+ [MaxLength(5)]
+ public string WhetherRequired { get; set; }
+
+ ///
+ /// 是否是查询条件
+ ///
+ [Comment("是否是查询条件")]
+ [MaxLength(5)]
+ public string QueryWhether { get; set; }
+
+ ///
+ /// 查询方式
+ ///
+ [Comment("查询方式")]
+ [MaxLength(10)]
+ public string QueryType { get; set; }
+
+ ///
+ /// 列表显示
+ ///
+ [Comment("列表显示")]
+ [MaxLength(5)]
+ public string WhetherTable { get; set; }
+
+ ///
+ /// 增改
+ ///
+ [Comment("增改")]
+ [MaxLength(5)]
+ public string WhetherAddUpdate { get; set; }
+
+ ///
+ /// 主外键
+ ///
+ [Comment("主外键")]
+ [MaxLength(5)]
+ public string ColumnKey { get; set; }
+
+ ///
+ /// 数据库中类型(物理类型)
+ ///
+ [Comment("数据库中类型")]
+ [MaxLength(50)]
+ public string DataType { get; set; }
+
+ ///
+ /// 是否通用字段
+ ///
+ [Comment("是否通用字段")]
+ [MaxLength(5)]
+ public string WhetherCommon { get; set; }
+ }
+}
diff --git a/backend/Dilon.Core/Entity/SysConfig.cs b/backend/Dilon.Core/Entity/SysConfig.cs
index 7c0f8ab238e4c2bbd9eb932127588b49eb2dafc5..bb58acc608db7778ebb0e1a20229c28dd92e8b4e 100644
--- a/backend/Dilon.Core/Entity/SysConfig.cs
+++ b/backend/Dilon.Core/Entity/SysConfig.cs
@@ -1,9 +1,9 @@
using Dilon.Core.Service;
using Furion;
using Furion.DatabaseAccessor;
-using Furion.Snowflake;
using Microsoft.EntityFrameworkCore;
using System;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -12,49 +12,55 @@ namespace Dilon.Core
/// 参数配置表
///
[Table("sys_config")]
+ [Comment("参数配置表")]
public class SysConfig : DEntityBase, IEntityChangedListener
{
- public SysConfig()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 名称
///
+ [Comment("名称")]
+ [Required, MaxLength(50)]
public string Name { get; set; }
///
/// 编码
///
+ [Comment("编码")]
+ [Required, MaxLength(50)]
public string Code { get; set; }
///
/// 属性值
///
+ [Comment("属性值")]
+ [MaxLength(50)]
public string Value { get; set; }
///
/// 是否是系统参数(Y-是,N-否)
///
+ [Comment("是否是系统参数")]
+ [MaxLength(5)]
public string SysFlag { get; set; }
///
/// 备注
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
///
/// 状态(字典 0正常 1停用 2删除)
///
- public int Status { get; set; }
+ [Comment("状态")]
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 常量所属分类的编码,来自于“常量的分类”字典
///
+ [Comment("常量所属分类的编码")]
+ [MaxLength(50)]
public string GroupCode { get; set; }
///
diff --git a/backend/Dilon.Core/Entity/SysDictData.cs b/backend/Dilon.Core/Entity/SysDictData.cs
index 6c8fc56fc11dd15ecdf80cfd4934d501d5190b7d..3827daa878365d4ba9b3b0c40017038ef33b6eba 100644
--- a/backend/Dilon.Core/Entity/SysDictData.cs
+++ b/backend/Dilon.Core/Entity/SysDictData.cs
@@ -1,5 +1,5 @@
-using Furion.Snowflake;
-using System;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -8,45 +8,47 @@ namespace Dilon.Core
/// 字典值表
///
[Table("sys_dict_data")]
+ [Comment("字典值表")]
public class SysDictData : DEntityBase
{
- public SysDictData()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 字典类型Id
///
+ [Comment("字典类型Id")]
public long TypeId { get; set; }
///
/// 值
///
+ [Comment("值")]
+ [MaxLength(100)]
public string Value { get; set; }
///
/// 编码
///
+ [Comment("编码")]
+ [MaxLength(50)]
public string Code { get; set; }
///
/// 排序
///
+ [Comment("排序")]
public int Sort { get; set; }
///
/// 备注
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
///
/// 状态(字典 0正常 1停用 2删除)
///
- public int Status { get; set; }
+ [Comment("状态")]
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 所属类型
diff --git a/backend/Dilon.Core/Entity/SysDictType.cs b/backend/Dilon.Core/Entity/SysDictType.cs
index bea631285d211a017dbf8ce522fe2f9b6dc7a174..831b4903d13cc056a93e17f94e563e9af6fd17b3 100644
--- a/backend/Dilon.Core/Entity/SysDictType.cs
+++ b/backend/Dilon.Core/Entity/SysDictType.cs
@@ -1,9 +1,9 @@
using Furion.DatabaseAccessor;
-using Furion.Snowflake;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -12,40 +12,41 @@ namespace Dilon.Core
/// 字典类型表
///
[Table("sys_dict_type")]
+ [Comment("字典类型表")]
public class SysDictType : DEntityBase, IEntityTypeBuilder
{
- public SysDictType()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 名称
///
+ [Comment("名称")]
+ [Required, MaxLength(50)]
public string Name { get; set; }
///
/// 编码
///
+ [Comment("编码")]
+ [Required, MaxLength(50)]
public string Code { get; set; }
///
/// 排序
///
+ [Comment("排序")]
public int Sort { get; set; }
///
/// 备注
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
///
/// 状态(字典 0正常 1停用 2删除)
///
- public int Status { get; set; }
+ [Comment("状态")]
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 字典数据
@@ -54,7 +55,9 @@ namespace Dilon.Core
public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)
{
- entityBuilder.HasMany(x => x.SysDictDatas).WithOne(x => x.SysDictType).HasForeignKey(x => x.TypeId);
+ entityBuilder.HasMany(x => x.SysDictDatas)
+ .WithOne(x => x.SysDictType)
+ .HasForeignKey(x => x.TypeId);
}
}
}
diff --git a/backend/Dilon.Core/Entity/SysEmp.cs b/backend/Dilon.Core/Entity/SysEmp.cs
index bdb24bde536916605fab946f4e747fd7df2f8d94..5a31051d3b08b7496a42264c4cbce9dd7aa5969b 100644
--- a/backend/Dilon.Core/Entity/SysEmp.cs
+++ b/backend/Dilon.Core/Entity/SysEmp.cs
@@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -11,26 +12,34 @@ namespace Dilon.Core
/// 员工表
///
[Table("sys_emp")]
+ [Comment("员工表")]
public class SysEmp : IEntity, IEntityTypeBuilder
{
///
/// 用户Id
///
+ [DatabaseGenerated(DatabaseGeneratedOption.None)]
+ [Comment("用户Id")]
public long Id { get; set; }
///
/// 工号
///
+ [Comment("工号")]
+ [MaxLength(30)]
public string JobNum { get; set; }
///
/// 机构Id
///
+ [Comment("机构Id")]
public long OrgId { get; set; }
///
/// 机构名称
///
+ [Comment("机构名称")]
+ [MaxLength(50)]
public string OrgName { get; set; }
///
diff --git a/backend/Dilon.Core/Entity/SysEmpExtOrgPos.cs b/backend/Dilon.Core/Entity/SysEmpExtOrgPos.cs
index 9877b3ba0a380b5dc9501014046f804817901d84..0730bba80261da3de3679074ae2e8e02a27dfa48 100644
--- a/backend/Dilon.Core/Entity/SysEmpExtOrgPos.cs
+++ b/backend/Dilon.Core/Entity/SysEmpExtOrgPos.cs
@@ -2,6 +2,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -10,11 +11,13 @@ namespace Dilon.Core
/// 员工附属机构职位表
///
[Table("sys_emp_ext_org_pos")]
- public class SysEmpExtOrgPos : IEntity, IEntityTypeBuilder
+ [Comment("员工附属机构职位表")]
+ public class SysEmpExtOrgPos : IEntity, IEntityTypeBuilder, IEntitySeedData
{
///
- /// 员工id
+ /// 员工Id
///
+ [Comment("员工Id")]
public long SysEmpId { get; set; }
///
@@ -25,6 +28,7 @@ namespace Dilon.Core
///
/// 机构Id
///
+ [Comment("机构Id")]
public long SysOrgId { get; set; }
///
@@ -35,6 +39,7 @@ namespace Dilon.Core
///
/// 职位Id
///
+ [Comment("职位Id")]
public long SysPosId { get; set; }
///
@@ -44,7 +49,19 @@ namespace Dilon.Core
public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)
{
- entityBuilder.HasNoKey();
+ entityBuilder.HasKey(c => new { c.SysEmpId, c.SysOrgId, c.SysPosId });
+ }
+
+ public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)
+ {
+ return new[]
+ {
+ new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910539, SysPosId = 142307070910547 },
+ new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910540, SysPosId = 142307070910548 },
+ new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910541, SysPosId = 142307070910549 },
+ new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910542, SysPosId = 142307070910550 },
+ new SysEmpExtOrgPos { SysEmpId = 142307070910553, SysOrgId = 142307070910542, SysPosId = 142307070910547 }
+ };
}
}
}
diff --git a/backend/Dilon.Core/Entity/SysEmpPos.cs b/backend/Dilon.Core/Entity/SysEmpPos.cs
index d9df3c7dcc07780e8972b3d2129ae3b2d8c3283d..9380a4bdf11413262a1375094f2c2b6563befae1 100644
--- a/backend/Dilon.Core/Entity/SysEmpPos.cs
+++ b/backend/Dilon.Core/Entity/SysEmpPos.cs
@@ -1,4 +1,5 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -7,11 +8,13 @@ namespace Dilon.Core
/// 员工职位表
///
[Table("sys_emp_pos")]
+ [Comment("员工职位表")]
public class SysEmpPos : IEntity
{
///
- /// 员工id
+ /// 员工Id
///
+ [Comment("员工Id")]
public long SysEmpId { get; set; }
///
@@ -22,6 +25,7 @@ namespace Dilon.Core
///
/// 职位Id
///
+ [Comment("职位Id")]
public long SysPosId { get; set; }
///
diff --git a/backend/Dilon.Core/Entity/SysFile.cs b/backend/Dilon.Core/Entity/SysFile.cs
index 948161d2f05d4d4fd501a63f05083f7785945b68..4f5e0575d251ec4cbe88e12b84fcfede94507675 100644
--- a/backend/Dilon.Core/Entity/SysFile.cs
+++ b/backend/Dilon.Core/Entity/SysFile.cs
@@ -1,60 +1,68 @@
-using Furion.Snowflake;
-using System;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-namespace Dilon.Core.Entity.System
+namespace Dilon.Core
{
///
/// 文件信息表
///
[Table("sys_file")]
+ [Comment("文件信息表")]
public class SysFile : DEntityBase
{
- public SysFile()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- }
-
///
/// 文件存储位置(1:阿里云,2:腾讯云,3:minio,4:本地)
///
+ [Comment("文件存储位置")]
public int FileLocation { get; set; }
///
/// 文件仓库
///
+ [Comment("文件仓库")]
+ [MaxLength(100)]
public string FileBucket { get; set; }
///
/// 文件名称(上传时候的文件名)
///
+ [Comment("文件名称")]
+ [MaxLength(100)]
public string FileOriginName { get; set; }
///
/// 文件后缀
///
+ [Comment("文件后缀")]
+ [MaxLength(100)]
public string FileSuffix { get; set; }
///
/// 文件大小kb
///
+ [Comment("文件大小kb")]
public long FileSizeKb { get; set; }
///
/// 文件大小信息,计算后的
///
+ [Comment("文件大小信息")]
+ [MaxLength(100)]
public string FileSizeInfo { get; set; }
///
/// 存储到bucket的名称(文件唯一标识id)
///
+ [Comment("存储到bucket的名称")]
+ [MaxLength(100)]
public string FileObjectName { get; set; }
///
/// 存储路径
///
+ [Comment("存储路径")]
+ [MaxLength(100)]
public string FilePath { get; set; }
}
}
diff --git a/backend/Dilon.Core/Entity/SysLogAudit.cs b/backend/Dilon.Core/Entity/SysLogAudit.cs
index c773bd60fd2acf1428d320fa4af99f0c0b85585f..002c4d1746f28832e76ec09f82ad5b83eaf8a6a2 100644
--- a/backend/Dilon.Core/Entity/SysLogAudit.cs
+++ b/backend/Dilon.Core/Entity/SysLogAudit.cs
@@ -1,5 +1,7 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -8,46 +10,58 @@ namespace Dilon.Core
/// 系统操作/审计日志表
///
[Table("sys_log_audit")]
+ [Comment("审计日志表")]
public class SysLogAudit : EntityBase
{
///
/// 表名
///
+ [Comment("表名")]
+ [MaxLength(50)]
public string TableName { get; set; }
///
/// 列名
///
+ [Comment("列名")]
+ [MaxLength(50)]
public string ColumnName { get; set; }
///
/// 新值
///
+ [Comment("新值")]
public string NewValue { get; set; }
///
/// 旧值
///
+ [Comment("旧值")]
public string OldValue { get; set; }
///
/// 操作时间
///
+ [Comment("操作时间")]
public DateTimeOffset CreatedTime { get; set; }
///
/// 操作人Id
///
+ [Comment("操作人Id")]
public long UserId { get; set; }
///
/// 操作人名称
///
+ [Comment("操作人名称")]
+ [MaxLength(20)]
public string UserName { get; set; }
///
/// 操作方式:新增、更新、删除
///
- public string Operate { get; set; }
+ [Comment("操作方式")]
+ public DataOpType Operate { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/backend/Dilon.Core/Entity/SysLogEx.cs b/backend/Dilon.Core/Entity/SysLogEx.cs
new file mode 100644
index 0000000000000000000000000000000000000000..d2354ad7d150333e02076a5333bd8665ec23dbbf
--- /dev/null
+++ b/backend/Dilon.Core/Entity/SysLogEx.cs
@@ -0,0 +1,84 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
+
+namespace Dilon.Core
+{
+ ///
+ /// 异常日志
+ ///
+ [Table("sys_log_ex")]
+ [Comment("异常日志表")]
+ public class SysLogEx : EntityBase
+ {
+ ///
+ /// 操作人
+ ///
+ [Comment("操作人")]
+ [MaxLength(20)]
+ public string Account { get; set; }
+
+ ///
+ /// 名称
+ ///
+ [Comment("名称")]
+ [MaxLength(100)]
+ public string Name { get; set; }
+
+ ///
+ /// 类名
+ ///
+ [Comment("类名")]
+ [MaxLength(100)]
+ public string ClassName { get; set; }
+
+ ///
+ /// 方法名
+ ///
+ [Comment("方法名")]
+ [MaxLength(100)]
+ public string MethodName { get; set; }
+
+ ///
+ /// 异常名称
+ ///
+ [Comment("异常名称")]
+ public string ExceptionName { get; set; }
+
+ ///
+ /// 异常信息
+ ///
+ [MaxLength(2000)]
+ [Comment("异常信息")]
+ public string ExceptionMsg { get; set; }
+
+ ///
+ /// 异常源
+ ///
+ [MaxLength(2000)]
+ [Comment("异常源")]
+ public string ExceptionSource { get; set; }
+
+ ///
+ /// 堆栈信息
+ ///
+ [MaxLength(5000)]
+ [Comment("堆栈信息")]
+ public string StackTrace { get; set; }
+
+ ///
+ /// 参数对象
+ ///
+ [MaxLength(5000)]
+ [Comment("参数对象")]
+ public string ParamsObj { get; set; }
+
+ ///
+ /// 异常时间
+ ///
+ [Comment("异常时间")]
+ public DateTimeOffset ExceptionTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Dilon.Core/Entity/SysLogOp.cs b/backend/Dilon.Core/Entity/SysLogOp.cs
index d0888d03cdb2aa0a639336a300208be921eb7d97..ca7f9e7409edae14d6b46f66462050d52cedf358 100644
--- a/backend/Dilon.Core/Entity/SysLogOp.cs
+++ b/backend/Dilon.Core/Entity/SysLogOp.cs
@@ -1,5 +1,7 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -8,91 +10,113 @@ namespace Dilon.Core
/// 操作日志表
///
[Table("sys_log_op")]
+ [Comment("操作日志表")]
public class SysLogOp : EntityBase
{
///
/// 名称
///
+ [Comment("名称")]
+ [MaxLength(100)]
public string Name { get; set; }
- ///
- /// 操作类型(0其他 1增加 2删除 3编辑)(见LogAnnotionOpTypeEnum)
- ///
- public int? OpType { get; set; }
-
///
/// 是否执行成功(Y-是,N-否)
///
- public string Success { get; set; }
+ [Comment("是否执行成功")]
+ public YesOrNot Success { get; set; }
///
/// 具体消息
///
+ [Comment("具体消息")]
public string Message { get; set; }
///
- /// ip
+ /// IP
///
+ [Comment("IP")]
+ [MaxLength(20)]
public string Ip { get; set; }
///
/// 地址
///
+ [Comment("地址")]
+ [MaxLength(100)]
public string Location { get; set; }
///
/// 浏览器
///
+ [Comment("浏览器")]
+ [MaxLength(100)]
public string Browser { get; set; }
///
/// 操作系统
///
+ [Comment("操作系统")]
+ [MaxLength(100)]
public string Os { get; set; }
///
/// 请求地址
///
+ [Comment("请求地址")]
+ [MaxLength(100)]
public string Url { get; set; }
///
/// 类名称
///
+ [Comment("类名称")]
+ [MaxLength(100)]
public string ClassName { get; set; }
///
/// 方法名称
///
+ [Comment("方法名称")]
+ [MaxLength(100)]
public string MethodName { get; set; }
///
/// 请求方式(GET POST PUT DELETE)
///
+ [Comment("请求方式")]
+ [MaxLength(10)]
public string ReqMethod { get; set; }
///
/// 请求参数
///
+ [Comment("请求参数")]
public string Param { get; set; }
///
/// 返回结果
///
+ [Comment("返回结果")]
public string Result { get; set; }
///
/// 耗时(毫秒)
///
+ [Comment("耗时")]
public long ElapsedTime { get; set; }
///
/// 操作时间
///
+ [Comment("操作时间")]
public DateTimeOffset OpTime { get; set; }
///
/// 操作人
///
+ [Comment("操作人")]
+ [MaxLength(20)]
public string Account { get; set; }
}
}
diff --git a/backend/Dilon.Core/Entity/SysLogVis.cs b/backend/Dilon.Core/Entity/SysLogVis.cs
index 74fa83e4a9ffcbf5a08b9a35118ede21b0fdb9c3..deaaeaec36445ab7757bd7a4ca8421e2b0d61a3e 100644
--- a/backend/Dilon.Core/Entity/SysLogVis.cs
+++ b/backend/Dilon.Core/Entity/SysLogVis.cs
@@ -1,5 +1,7 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -8,56 +10,73 @@ namespace Dilon.Core
/// 访问日志表
///
[Table("sys_log_vis")]
+ [Comment("访问日志表")]
public class SysLogVis : EntityBase
{
///
/// 名称
///
+ [Comment("名称")]
+ [MaxLength(100)]
public string Name { get; set; }
///
/// 是否执行成功(Y-是,N-否)
///
- public string Success { get; set; }
+ [Comment("是否执行成功")]
+ public YesOrNot Success { get; set; }
///
/// 具体消息
///
+ [Comment("具体消息")]
public string Message { get; set; }
///
/// IP
///
+ [Comment("IP")]
+ [MaxLength(20)]
public string Ip { get; set; }
///
/// 地址
///
+ [Comment("地址")]
+ [MaxLength(100)]
public string Location { get; set; }
///
/// 浏览器
///
+ [Comment("浏览器")]
+ [MaxLength(100)]
public string Browser { get; set; }
///
/// 操作系统
///
+ [Comment("操作系统")]
+ [MaxLength(100)]
public string Os { get; set; }
///
- /// 访问类型(字典 1登入 2登出)
+ /// 访问类型
///
- public int? VisType { get; set; }
+ [Comment("访问类型")]
+ public LoginType VisType { get; set; }
///
/// 访问时间
///
+ [Comment("访问时间")]
public DateTimeOffset VisTime { get; set; }
///
/// 访问人
///
+ [Comment("访问人")]
+ [MaxLength(20)]
public string Account { get; set; }
}
}
\ No newline at end of file
diff --git a/backend/Dilon.Core/Entity/SysMenu.cs b/backend/Dilon.Core/Entity/SysMenu.cs
index d12745e967215247f06eb8ed67eb1b9b5208ca3e..cda0c26f053ec8e4a449c9b0ae68afbe54f493f4 100644
--- a/backend/Dilon.Core/Entity/SysMenu.cs
+++ b/backend/Dilon.Core/Entity/SysMenu.cs
@@ -1,5 +1,4 @@
-using Furion.Snowflake;
-using System;
+using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -10,105 +9,126 @@ namespace Dilon.Core
/// 菜单表
///
[Table("sys_menu")]
+ [Comment("菜单表")]
public class SysMenu : DEntityBase
{
- public SysMenu()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 父Id
///
+ [Comment("父Id")]
public long Pid { get; set; }
///
/// 父Ids
///
+ [Comment("父Ids")]
public string Pids { get; set; }
///
/// 名称
///
+ [Comment("名称")]
+ [Required, MaxLength(20)]
public string Name { get; set; }
///
/// 编码
///
+ [Comment("编码")]
+ [Required, MaxLength(50)]
public string Code { get; set; }
///
/// 菜单类型(字典 0目录 1菜单 2按钮)
///
+ [Comment("菜单类型")]
public int Type { get; set; }
///
/// 图标
///
+ [Comment("图标")]
+ [MaxLength(20)]
public string Icon { get; set; }
///
/// 路由地址
///
+ [Comment("路由地址")]
+ [MaxLength(100)]
public string Router { get; set; }
///
/// 组件地址
///
+ [Comment("组件地址")]
+ [MaxLength(100)]
public string Component { get; set; }
///
/// 权限标识
///
+ [Comment("权限标识")]
+ [MaxLength(100)]
public string Permission { get; set; }
///
/// 应用分类(应用编码)
///
+ [Comment("应用分类")]
+ [MaxLength(50)]
public string Application { get; set; }
///
/// 打开方式(字典 0无 1组件 2内链 3外链)
///
- public int OpenType { get; set; }
+ [Comment("打开方式")]
+ public int OpenType { get; set; } = 0;
///
/// 是否可见(Y-是,N-否)
///
- public string Visible { get; set; }
+ [Comment("是否可见")]
+ [MaxLength(5)]
+ public string Visible { get; set; } = "Y";
///
/// 内链地址
///
+ [Comment("内链地址")]
+ [MaxLength(100)]
public string Link { get; set; }
///
/// 重定向地址
///
+ [Comment("重定向地址")]
+ [MaxLength(100)]
public string Redirect { get; set; }
///
/// 权重(字典 1系统权重 2业务权重)
///
- public int Weight { get; set; }
+ [Comment("权重")]
+ public int Weight { get; set; } = 2;
///
/// 排序
///
- public int Sort { get; set; }
+ [Comment("排序")]
+ public int Sort { get; set; } = 100;
///
/// 备注
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
///
/// 状态(字典 0正常 1停用 2删除)
///
- public int Status { get; set; }
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 多对多(角色)
diff --git a/backend/Dilon.Core/Entity/SysNotice.cs b/backend/Dilon.Core/Entity/SysNotice.cs
index 97ce3d77aaac80f192922a44ad185e00ab472165..65eccfaf897a91c9d9a8f27f90f94a61341c9707 100644
--- a/backend/Dilon.Core/Entity/SysNotice.cs
+++ b/backend/Dilon.Core/Entity/SysNotice.cs
@@ -1,5 +1,6 @@
-using Furion.Snowflake;
+using Microsoft.EntityFrameworkCore;
using System;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -8,63 +9,71 @@ namespace Dilon.Core
/// 通知公告表
///
[Table("sys_notice")]
+ [Comment("通知公告表")]
public class SysNotice : DEntityBase
{
- public SysNotice()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- }
-
///
/// 标题
///
+ [Comment("标题")]
+ [Required, MaxLength(20)]
public string Title { get; set; }
///
/// 内容
///
+ [Comment("内容")]
+ [Required]
public string Content { get; set; }
///
/// 类型(字典 1通知 2公告)
///
+ [Comment("类型")]
public int Type { get; set; }
///
/// 发布人Id
///
+ [Comment("发布人Id")]
public long PublicUserId { get; set; }
///
/// 发布人姓名
///
+ [Comment("发布人姓名")]
+ [MaxLength(20)]
public string PublicUserName { get; set; }
///
/// 发布机构Id
///
+ [Comment("发布机构Id")]
public long PublicOrgId { get; set; }
///
/// 发布机构名称
///
+ [Comment("发布机构名称")]
+ [MaxLength(50)]
public string PublicOrgName { get; set; }
///
/// 发布时间
///
+ [Comment("发布时间")]
public DateTimeOffset PublicTime { get; set; }
///
/// 撤回时间
///
+ [Comment("撤回时间")]
public DateTimeOffset CancelTime { get; set; }
///
/// 状态(字典 0草稿 1发布 2撤回 3删除)
///
- public int Status { get; set; }
+ [Comment("状态")]
+ public NoticeStatus Status { get; set; }
}
}
diff --git a/backend/Dilon.Core/Entity/SysNoticeUser.cs b/backend/Dilon.Core/Entity/SysNoticeUser.cs
index 4901bdea72ace714516cbdf360d20031f5ad7629..9504d5cfcf1f451fd2dd66d219b8f9a4dc4a7df1 100644
--- a/backend/Dilon.Core/Entity/SysNoticeUser.cs
+++ b/backend/Dilon.Core/Entity/SysNoticeUser.cs
@@ -10,27 +10,32 @@ namespace Dilon.Core
/// 通知公告用户表
///
[Table("sys_notice_user")]
+ [Comment("通知公告用户表")]
public class SysNoticeUser : IEntity, IEntityTypeBuilder
{
///
- /// 通知公告id
+ /// 通知公告Id
///
+ [Comment("通知公告Id")]
public long NoticeId { get; set; }
///
/// 用户Id
///
+ [Comment("用户Id")]
public long UserId { get; set; }
///
/// 阅读时间
///
+ [Comment("阅读时间")]
public DateTimeOffset ReadTime { get; set; }
///
/// 状态(字典 0未读 1已读)
///
- public int ReadStatus { get; set; }
+ [Comment("状态")]
+ public NoticeUserStatus ReadStatus { get; set; }
public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)
{
diff --git a/backend/Dilon.Core/Entity/SysOauthUser.cs b/backend/Dilon.Core/Entity/SysOauthUser.cs
index 99beecc65ed156983a15ddb5707834ec807dd905..118c12fc14d8090713ed6ff5b0a789aa2935ecb0 100644
--- a/backend/Dilon.Core/Entity/SysOauthUser.cs
+++ b/backend/Dilon.Core/Entity/SysOauthUser.cs
@@ -1,5 +1,5 @@
-using Furion.Snowflake;
-using System;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -8,73 +8,88 @@ namespace Dilon.Core
/// Oauth登录用户表
///
[Table("sys_oauth_user")]
+ [Comment("Oauth登录用户表")]
public class SysOauthUser : DEntityBase
{
- public SysOauthUser()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- }
-
///
- /// 第三方平台的用户唯一id
+ /// 第三方平台的用户唯一Id
///
+ [Comment("UUID")]
+ [MaxLength(50)]
public string Uuid { get; set; }
///
/// 用户授权的token
///
+ [Comment("Token")]
public string AccessToken { get; set; }
///
/// 昵称
///
+ [Comment("昵称")]
+ [MaxLength(20)]
public string NickName { get; set; }
///
/// 头像
///
+ [Comment("头像")]
public string Avatar { get; set; }
///
/// 性别
///
+ [Comment("性别")]
+ [MaxLength(5)]
public string Gender { get; set; }
///
/// 电话
///
+ [Comment("电话")]
+ [MaxLength(20)]
public string Phone { get; set; }
///
/// 邮箱
///
+ [Comment("邮箱")]
+ [MaxLength(20)]
public string Email { get; set; }
///
/// 位置
///
+ [Comment("位置")]
+ [MaxLength(50)]
public string Location { get; set; }
///
/// 用户网址
///
+ [Comment("用户网址")]
public string Blog { get; set; }
///
/// 所在公司
///
+ [Comment("所在公司")]
+ [MaxLength(50)]
public string Company { get; set; }
///
/// 用户来源
///
+ [Comment("用户来源")]
+ [MaxLength(20)]
public string Source { get; set; }
///
/// 用户备注(各平台中的用户个人介绍)
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
}
}
\ No newline at end of file
diff --git a/backend/Dilon.Core/Entity/SysOrg.cs b/backend/Dilon.Core/Entity/SysOrg.cs
index 24e8f525935b6a6c983db848da55a997b73741b7..f5ccc6c4a079658954c9469308307585623391a0 100644
--- a/backend/Dilon.Core/Entity/SysOrg.cs
+++ b/backend/Dilon.Core/Entity/SysOrg.cs
@@ -1,6 +1,7 @@
-using Furion.Snowflake;
-using System;
+using Dilon.Core.Entity;
+using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -9,60 +10,67 @@ namespace Dilon.Core
/// 组织机构表
///
[Table("sys_org")]
- public class SysOrg : DEntityBase
+ [Comment("组织机构表")]
+ public class SysOrg : DBEntityTenant
{
- public SysOrg()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 父Id
///
+ [Comment("父Id")]
public long Pid { get; set; }
///
/// 父Ids
///
+ [Comment("父Ids")]
public string Pids { get; set; }
///
/// 名称
///
+ [Comment("名称")]
+ [Required, MaxLength(30)]
public string Name { get; set; }
///
/// 编码
///
+ [Comment("编码")]
+ [Required, MaxLength(50)]
public string Code { get; set; }
///
/// 联系人
///
+ [Comment("联系人")]
+ [MaxLength(20)]
public string Contacts { get; set; }
///
/// 电话
///
+ [Comment("电话")]
+ [MaxLength(20)]
public string Tel { get; set; }
///
/// 排序
///
+ [Comment("排序")]
public int Sort { get; set; }
///
/// 备注
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
///
/// 状态(字典 0正常 1停用 2删除)
///
- public int Status { get; set; }
+ [Comment("状态")]
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 多对多(用户)
diff --git a/backend/Dilon.Core/Entity/SysPos.cs b/backend/Dilon.Core/Entity/SysPos.cs
index e6d4dd3d66b8b73da60da21efbf8e1fa18db5709..6cfbe708e01c053f05e81e2d03547716359718fe 100644
--- a/backend/Dilon.Core/Entity/SysPos.cs
+++ b/backend/Dilon.Core/Entity/SysPos.cs
@@ -1,6 +1,7 @@
-using Furion.Snowflake;
-using System;
+using Dilon.Core.Entity;
+using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -9,40 +10,41 @@ namespace Dilon.Core
/// 职位表
///
[Table("sys_pos")]
- public class SysPos : DEntityBase
+ [Comment("职位表")]
+ public class SysPos : DBEntityTenant
{
- public SysPos()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 名称
///
+ [Comment("名称")]
+ [Required, MaxLength(20)]
public string Name { get; set; }
///
/// 编码
///
+ [Comment("编码")]
+ [Required, MaxLength(50)]
public string Code { get; set; }
///
/// 排序
///
+ [Comment("排序")]
public int Sort { get; set; }
///
/// 备注
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
///
/// 状态(字典 0正常 1停用 2删除)
///
- public int Status { get; set; }
+ [Comment("状态")]
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 多对多(员工)
diff --git a/backend/Dilon.Core/Entity/SysRole.cs b/backend/Dilon.Core/Entity/SysRole.cs
index 2c355499952b245689ae81d669ff193d30bcad7e..8be5da41540289365eb37a9e05ca403f1a66cb6d 100644
--- a/backend/Dilon.Core/Entity/SysRole.cs
+++ b/backend/Dilon.Core/Entity/SysRole.cs
@@ -1,5 +1,5 @@
-using Furion.DatabaseAccessor;
-using Furion.Snowflake;
+using Dilon.Core.Entity;
+using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
@@ -13,45 +13,47 @@ namespace Dilon.Core
/// 角色表
///
[Table("sys_role")]
- public class SysRole : DEntityBase, IEntityTypeBuilder
+ [Comment("角色表")]
+ public class SysRole : DBEntityTenant, IEntityTypeBuilder
{
- public SysRole()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 名称
///
+ [Comment("名称")]
+ [Required, MaxLength(20)]
public string Name { get; set; }
///
/// 编码
///
+ [Comment("编码")]
+ [Required, MaxLength(50)]
public string Code { get; set; }
///
/// 排序
///
+ [Comment("排序")]
public int Sort { get; set; }
///
/// 数据范围类型(字典 1全部数据 2本部门及以下数据 3本部门数据 4仅本人数据 5自定义数据)
///
+ [Comment("数据范围类型")]
public int DataScopeType { get; set; }
///
/// 备注
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
///
/// 状态(字典 0正常 1停用 2删除)
///
- public int Status { get; set; }
+ [Comment("状态")]
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 多对多(用户)
@@ -91,7 +93,9 @@ namespace Dilon.Core
///
public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)
{
- entityBuilder.HasMany(p => p.SysOrgs).WithMany(p => p.SysRoles).UsingEntity(
+ entityBuilder.HasMany(p => p.SysOrgs)
+ .WithMany(p => p.SysRoles)
+ .UsingEntity(
u => u.HasOne(c => c.SysOrg).WithMany(c => c.SysRoleDataScopes).HasForeignKey(c => c.SysOrgId),
u => u.HasOne(c => c.SysRole).WithMany(c => c.SysRoleDataScopes).HasForeignKey(c => c.SysRoleId),
u =>
@@ -99,7 +103,9 @@ namespace Dilon.Core
u.HasKey(c => new { c.SysRoleId, c.SysOrgId });
});
- entityBuilder.HasMany(p => p.SysMenus).WithMany(p => p.SysRoles).UsingEntity(
+ entityBuilder.HasMany(p => p.SysMenus)
+ .WithMany(p => p.SysRoles)
+ .UsingEntity(
u => u.HasOne(c => c.SysMenu).WithMany(c => c.SysRoleMenus).HasForeignKey(c => c.SysMenuId),
u => u.HasOne(c => c.SysRole).WithMany(c => c.SysRoleMenus).HasForeignKey(c => c.SysRoleId),
u =>
diff --git a/backend/Dilon.Core/Entity/SysRoleDataScope.cs b/backend/Dilon.Core/Entity/SysRoleDataScope.cs
index 4505ab7e4c7d7f1e8a61f23506a9f81a848612b5..eeb186f65c1749c2dfe61ac63a0400e3efc4508b 100644
--- a/backend/Dilon.Core/Entity/SysRoleDataScope.cs
+++ b/backend/Dilon.Core/Entity/SysRoleDataScope.cs
@@ -1,4 +1,5 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -7,11 +8,13 @@ namespace Dilon.Core
/// 角色数据范围表
///
[Table("sys_role_data_scope")]
+ [Comment("角色数据范围表")]
public class SysRoleDataScope : IEntity
{
///
/// 角色Id
///
+ [Comment("角色Id")]
public long SysRoleId { get; set; }
///
@@ -22,6 +25,7 @@ namespace Dilon.Core
///
/// 机构Id
///
+ [Comment("机构Id")]
public long SysOrgId { get; set; }
///
diff --git a/backend/Dilon.Core/Entity/SysRoleMenu.cs b/backend/Dilon.Core/Entity/SysRoleMenu.cs
index 02afd3a97407717c38ba8af004d9523ec5eb7779..57fde8ccee5745fc2aa6ad48752338f0e05028f9 100644
--- a/backend/Dilon.Core/Entity/SysRoleMenu.cs
+++ b/backend/Dilon.Core/Entity/SysRoleMenu.cs
@@ -1,4 +1,5 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -7,11 +8,13 @@ namespace Dilon.Core
/// 角色菜单表
///
[Table("sys_role_menu")]
+ [Comment("角色菜单表")]
public class SysRoleMenu : IEntity
{
///
/// 角色Id
///
+ [Comment("角色Id")]
public long SysRoleId { get; set; }
///
@@ -22,6 +25,7 @@ namespace Dilon.Core
///
/// 菜单Id
///
+ [Comment("菜单Id")]
public long SysMenuId { get; set; }
///
diff --git a/backend/Dilon.Core/Entity/SysTenant.cs b/backend/Dilon.Core/Entity/SysTenant.cs
new file mode 100644
index 0000000000000000000000000000000000000000..20de04f8c945615c491bc34d13e7204e60baaf21
--- /dev/null
+++ b/backend/Dilon.Core/Entity/SysTenant.cs
@@ -0,0 +1,71 @@
+using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Dilon.Core
+{
+ ///
+ /// 租户表
+ ///
+ [Table("sys_tenant")]
+ [Comment("租户表")]
+ public class SysTenant : DEntityBase, IEntity
+ {
+ ///
+ /// 公司名称
+ ///
+ [Comment("公司名称")]
+ [Required, MaxLength(30)]
+ public string Name { get; set; }
+
+ ///
+ /// 管理员名称
+ ///
+ [Comment("管理员名称")]
+ [Required, MaxLength(20)]
+ public string AdminName { get; set; }
+
+ ///
+ /// 主机
+ ///
+ [Comment("主机")]
+ [MaxLength(100)]
+ public string Host { get; set; }
+
+ ///
+ /// 电子邮箱
+ ///
+ [Comment("电子邮箱")]
+ [MaxLength(20)]
+ public string Email { get; set; }
+
+ ///
+ /// 电话
+ ///
+ [Comment("电话")]
+ [MaxLength(20)]
+ public string Phone { get; set; }
+
+ ///
+ /// 数据库连接
+ ///
+ [Comment("数据库连接")]
+ [MaxLength(200)]
+ public string Connection { get; set; }
+
+ ///
+ /// 架构
+ ///
+ [Comment("架构")]
+ [MaxLength(50)]
+ public string Schema { get; set; }
+
+ ///
+ /// 备注
+ ///
+ [Comment("备注")]
+ [MaxLength(100)]
+ public string Remark { get; set; }
+ }
+}
diff --git a/backend/Dilon.Core/Entity/SysTimer.cs b/backend/Dilon.Core/Entity/SysTimer.cs
index 9f1d895d0701b23b1bbc28e75602d1f87eb816d4..08585db081194ed4b519fce9ed715ae2d17a6227 100644
--- a/backend/Dilon.Core/Entity/SysTimer.cs
+++ b/backend/Dilon.Core/Entity/SysTimer.cs
@@ -1,6 +1,6 @@
-using Dilon.Core.Service;
-using Furion.Snowflake;
-using System;
+using Furion.TaskScheduler;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -9,86 +9,76 @@ namespace Dilon.Core
/// 定时任务
///
[Table("sys_timer")]
+ [Comment("定时任务表")]
public class SysTimer : DEntityBase
{
- public SysTimer()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- }
-
///
/// 任务名称
///
/// dilon
+ [Comment("任务名称")]
+ [Required, MaxLength(20)]
public string JobName { get; set; }
///
- /// 任务分组
- ///
- /// dilon
- public string JobGroup { get; set; }
-
- ///
- /// 开始时间
+ /// 执行间隔时间(单位秒)
///
- public DateTimeOffset BeginTime { get; set; } = DateTimeOffset.Now;
-
- ///
- /// 结束时间
- ///
- /// null
- public DateTimeOffset? EndTime { get; set; }
+ /// 5
+ [Comment("间隔时间")]
+ public int? Interval { get; set; } = 5;
///
/// Cron表达式
///
///
+ [Comment("Cron表达式")]
+ [MaxLength(20)]
public string Cron { get; set; }
///
- /// 执行次数(默认无限循环)
- ///
- /// 10
- public int? RunNumber { get; set; }
-
- ///
- /// 执行间隔时间,单位秒(如果有Cron,则IntervalSecond失效)
+ /// 定时器类型
///
- /// 5
- public int? Interval { get; set; } = 5;
+ [Comment("定时器类型")]
+ public SpareTimeTypes TimerType { get; set; } = SpareTimeTypes.Interval;
///
- /// 触发器类型
+ /// 执行次数
///
- public TriggerTypeEnum TriggerType { get; set; } = TriggerTypeEnum.Simple;
+ [Comment("执行次数")]
+ public int? RunNumber { get; set; }
///
/// 请求url
///
+ [Comment("请求url")]
+ [MaxLength(200)]
public string RequestUrl { get; set; }
///
/// 请求参数(Post,Put请求用)
///
+ [Comment("请求参数")]
public string RequestParameters { get; set; }
///
/// Headers(可以包含如:Authorization授权认证)
/// 格式:{"Authorization":"userpassword.."}
///
+ [Comment("Headers")]
public string Headers { get; set; }
///
/// 请求类型
///
/// 2
+ [Comment("请求类型")]
public RequestTypeEnum RequestType { get; set; } = RequestTypeEnum.Post;
///
- /// 描述
+ /// 备注
///
+ [Comment("备注")]
+ [MaxLength(100)]
public string Remark { get; set; }
}
}
diff --git a/backend/Dilon.Core/Entity/SysUser.cs b/backend/Dilon.Core/Entity/SysUser.cs
index 3d533bfd8e16981386ce0664cda457d62018a823..691f5cdf9b07ed07e9825a8a3e12dc1d6114fc73 100644
--- a/backend/Dilon.Core/Entity/SysUser.cs
+++ b/backend/Dilon.Core/Entity/SysUser.cs
@@ -1,5 +1,5 @@
-using Furion.DatabaseAccessor;
-using Furion.Snowflake;
+using Dilon.Core.Entity;
+using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
@@ -13,16 +13,9 @@ namespace Dilon.Core
/// 用户表
///
[Table("sys_user")]
- public class SysUser : DEntityBase, IEntityTypeBuilder
+ [Comment("用户表")]
+ public class SysUser : DBEntityTenant, IEntityTypeBuilder
{
- public SysUser()
- {
- Id = IDGenerator.NextId();
- CreatedTime = DateTimeOffset.Now;
- IsDeleted = false;
- Status = (int)CommonStatus.ENABLE;
- }
-
///
/// 账号
///
@@ -31,10 +24,10 @@ namespace Dilon.Core
public string Account { get; set; }
///
- /// 密码(采用MD5加密)
+ /// 密码(默认MD5加密)
///
[Comment("密码")]
- [Required]
+ [Required, MaxLength(50)]
public string Password { get; set; }
///
@@ -67,34 +60,34 @@ namespace Dilon.Core
/// 性别-男_1、女_2
///
[Comment("性别-男_1、女_2")]
- public int Sex { get; set; }
+ public Gender Sex { get; set; }
///
/// 邮箱
///
[Comment("邮箱")]
- [MaxLength(30)]
+ [MaxLength(20)]
public string Email { get; set; }
///
/// 手机
///
[Comment("手机")]
- [MaxLength(30)]
+ [MaxLength(20)]
public string Phone { get; set; }
///
/// 电话
///
[Comment("电话")]
- [MaxLength(30)]
+ [MaxLength(20)]
public string Tel { get; set; }
///
/// 最后登录IP
///
[Comment("最后登录IP")]
- [MaxLength(30)]
+ [MaxLength(20)]
public string LastLoginIp { get; set; }
///
@@ -107,13 +100,13 @@ namespace Dilon.Core
/// 管理员类型-超级管理员_1、非管理员_2
///
[Comment("管理员类型-超级管理员_1、非管理员_2")]
- public int AdminType { get; set; }
+ public AdminType AdminType { get; set; }
///
/// 状态-正常_0、停用_1、删除_2
///
[Comment("状态-正常_0、停用_1、删除_2")]
- public int Status { get; set; }
+ public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
///
/// 多对多(角色)
diff --git a/backend/Dilon.Core/Entity/SysUserDataScope.cs b/backend/Dilon.Core/Entity/SysUserDataScope.cs
index 89ba881c29568cb14d7ae631f2d554b59c70fcf1..c471a78a8de5f4f42bdd6ad8d26d26108e523b38 100644
--- a/backend/Dilon.Core/Entity/SysUserDataScope.cs
+++ b/backend/Dilon.Core/Entity/SysUserDataScope.cs
@@ -1,4 +1,5 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -7,11 +8,13 @@ namespace Dilon.Core
/// 用户数据范围表
///
[Table("sys_user_data_scope")]
+ [Comment("用户数据范围表")]
public class SysUserDataScope : IEntity
{
///
/// 用户Id
///
+ [Comment("用户Id")]
public long SysUserId { get; set; }
///
@@ -22,6 +25,7 @@ namespace Dilon.Core
///
/// 机构Id
///
+ [Comment("机构Id")]
public long SysOrgId { get; set; }
///
diff --git a/backend/Dilon.Core/Entity/SysUserRole.cs b/backend/Dilon.Core/Entity/SysUserRole.cs
index 1bd2ad3b14c46a93210086307f1aa3a7f6806ba3..844ed7c39eaad50527a6c1ae15eb717cfe397811 100644
--- a/backend/Dilon.Core/Entity/SysUserRole.cs
+++ b/backend/Dilon.Core/Entity/SysUserRole.cs
@@ -1,4 +1,5 @@
using Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Dilon.Core
@@ -7,11 +8,13 @@ namespace Dilon.Core
/// 用户角色表
///
[Table("sys_user_role")]
+ [Comment("用户角色表")]
public class SysUserRole : IEntity
{
///
- /// 系统用户Id
+ /// 用户Id
///
+ [Comment("用户Id")]
public long SysUserId { get; set; }
///
@@ -22,6 +25,7 @@ namespace Dilon.Core
///
/// 系统角色Id
///
+ [Comment("角色Id")]
public long SysRoleId { get; set; }
///
diff --git a/backend/Dilon.Core/Enum/AdminType.cs b/backend/Dilon.Core/Enum/AdminType.cs
index 6b0ebd95d7c1d9b6cb548f8ec8894d8ce7448663..aef6f7668649600cb31f8f96a51cddf4ecd86a7b 100644
--- a/backend/Dilon.Core/Enum/AdminType.cs
+++ b/backend/Dilon.Core/Enum/AdminType.cs
@@ -14,9 +14,15 @@ namespace Dilon.Core
SuperAdmin = 1,
///
- /// 非管理员
+ /// 管理员
///
- [Description("非管理员")]
- None = 2
+ [Description("管理员")]
+ Admin = 2,
+
+ ///
+ /// 普通账号
+ ///
+ [Description("普通账号")]
+ None = 3
}
}
diff --git a/backend/Dilon.Core/Enum/LogOpType.cs b/backend/Dilon.Core/Enum/DataOpType.cs
similarity index 95%
rename from backend/Dilon.Core/Enum/LogOpType.cs
rename to backend/Dilon.Core/Enum/DataOpType.cs
index d3cf3e8810e145a5cc0bacf8f0854a75a93d149b..bd31e0c4c6147e017be4b29e934598eaebc1474f 100644
--- a/backend/Dilon.Core/Enum/LogOpType.cs
+++ b/backend/Dilon.Core/Enum/DataOpType.cs
@@ -1,9 +1,9 @@
namespace Dilon.Core
{
///
- /// 日志操作类型
+ /// 数据操作类型
///
- public enum LogOpType
+ public enum DataOpType
{
///
/// 其它
diff --git a/backend/Dilon.Core/Enum/ErrorCode.cs b/backend/Dilon.Core/Enum/ErrorCode.cs
index 40ff9a0b50d5d8e67dcbe251b1144a1f19ccd013..740e73b81a6f7fd041e09b0d7d30f0852c65f0cb 100644
--- a/backend/Dilon.Core/Enum/ErrorCode.cs
+++ b/backend/Dilon.Core/Enum/ErrorCode.cs
@@ -152,6 +152,12 @@ namespace Dilon.Core
[ErrorCodeItemMetadata("附属机构下有员工禁止删除")]
D2005,
+ ///
+ /// 只能增加下级机构
+ ///
+ [ErrorCodeItemMetadata("只能增加下级机构")]
+ D2006,
+
///
/// 字典类型不存在
///
@@ -320,13 +326,48 @@ namespace Dilon.Core
[ErrorCodeItemMetadata("任务调度不存在")]
D1101,
-
///
/// 演示环境禁止修改数据
///
[ErrorCodeItemMetadata("演示环境禁止修改数据")]
D1200,
+ ///
+ /// 已存在同名或同主机租户
+ ///
+ [ErrorCodeItemMetadata("已存在同名或同主机租户")]
+ D1300,
+
+ ///
+ /// 该表代码模板已经生成过
+ ///
+ [ErrorCodeItemMetadata("该表代码模板已经生成过")]
+ D1400,
+
+ ///
+ /// 该类型不存在
+ ///
+ [ErrorCodeItemMetadata("该类型不存在")]
+ D1501,
+
+ ///
+ /// 该字段不存在
+ ///
+ [ErrorCodeItemMetadata("该字段不存在")]
+ D1502,
+
+ ///
+ /// 该类型不是枚举类型
+ ///
+ [ErrorCodeItemMetadata("该类型不是枚举类型")]
+ D1503,
+
+ ///
+ /// 该实体不存在
+ ///
+ [ErrorCodeItemMetadata("该实体不存在")]
+ D1504,
+
///
/// 已存在同名或同编码项目
///
diff --git a/backend/Dilon.Core/Enum/HttpStatusCode.cs b/backend/Dilon.Core/Enum/HttpStatusCode.cs
new file mode 100644
index 0000000000000000000000000000000000000000..d7077fca4e03cbdc34dd2dba06c38c11e2580766
--- /dev/null
+++ b/backend/Dilon.Core/Enum/HttpStatusCode.cs
@@ -0,0 +1,252 @@
+using System.ComponentModel;
+
+namespace Dilon.Core
+{
+ ///
+ /// HTTP状态码
+ ///
+ public enum HttpStatusCode
+ {
+ ///
+ /// 客户端可能继续其请求
+ ///
+ [Description("继续")]
+ Continue = 100,
+
+ ///
+ /// 正在更改协议版本或协议
+ ///
+ [Description("交换协议")]
+ SwitchingProtocols = 101,
+
+ ///
+ /// 请求成功,且请求的信息包含在响应中
+ ///
+ [Description("OK")]
+ OK = 200,
+
+ ///
+ /// 请求导致在响应被发送前创建新资源
+ ///
+ [Description("已创建")]
+ Created = 201,
+
+ ///
+ /// 请求已被接受做进一步处理
+ ///
+ [Description("接收")]
+ Accepted = 202,
+
+ ///
+ /// 返回的元信息来自缓存副本而不是原始服务器,因此可能不正确
+ ///
+ [Description("非认证信息")]
+ NonAuthoritativeInformation = 203,
+
+ ///
+ /// 已成功处理请求并且响应已被设定为无内容
+ ///
+ [Description("无内容")]
+ NoContent = 204,
+
+ ///
+ /// 客户端应重置(或重新加载)当前资源
+ ///
+ [Description("重置内容")]
+ ResetContent = 205,
+
+ ///
+ /// 响应是包括字节范围的 GET请求所请求的部分响应
+ ///
+ [Description("部分内容")]
+ PartialContent = 206,
+
+ ///
+ /// 请求的信息有多种表示形式,默认操作是将此状态视为重定向
+ ///
+ [Description("多路选择")]
+ MultipleChoices = 300,
+
+ ///
+ /// 请求的信息已移到 Location头中指定的 URI 处
+ ///
+ [Description("永久转移")]
+ MovedPermanently = 301,
+
+ ///
+ /// 请求的信息位于 Location 头中指定的 URI 处
+ ///
+ [Description("暂时转移")]
+ Found = 302,
+
+ ///
+ /// 将客户端自动重定向到 Location 头中指定的 URI
+ ///
+ [Description("参见其它")]
+ SeeOther = 303,
+
+ ///
+ /// 客户端的缓存副本是最新的
+ ///
+ [Description("未修改")]
+ NotModified = 304,
+
+ ///
+ /// 请求应使用位于 Location 头中指定的 URI 的代理服务器
+ ///
+ [Description("使用代理")]
+ UseProxy = 305,
+
+ ///
+ /// 服务器未能识别请求
+ ///
+ [Description("错误请求")]
+ BadRequest = 400,
+
+ ///
+ /// 请求的资源要求身份验证
+ ///
+ [Description("未认证")]
+ Unauthorized = 401,
+
+ ///
+ /// 需要付费
+ ///
+ [Description("需要付费")]
+ PaymentRequired = 402,
+
+ ///
+ /// 服务器拒绝满足请求
+ ///
+ [Description("禁止")]
+ Forbidden = 403,
+
+ ///
+ /// 请求的资源不在服务器上
+ ///
+ [Description("未找到")]
+ NotFound = 404,
+
+ ///
+ /// 请求的资源上不允许请求方法(POST或 GET)
+ ///
+ [Description("请求方法不允许")]
+ MethodNotAllowed = 405,
+
+ ///
+ /// 客户端已用 Accept 头指示将不接受资源的任何可用表示形式
+ ///
+ [Description("不接受")]
+ NotAcceptable = 406,
+
+ ///
+ /// 请求的代理要求身份验证
+ /// Proxy-authenticate 头包含如何执行身份验证的详细信息
+ ///
+ [Description("需要代理认证")]
+ ProxyAuthenticationRequired = 407,
+
+ ///
+ /// 客户端没有在服务器期望请求的时间内发送请求
+ ///
+ [Description("请求超时")]
+ RequestTimeout = 408,
+
+ ///
+ /// 由于服务器上的冲突而未能执行请求
+ ///
+ [Description("冲突")]
+ Conflict = 409,
+
+ ///
+ /// 请求的资源不再可用
+ ///
+ [Description("失败")]
+ Gone = 410,
+
+ ///
+ /// 缺少必需的 Content-length
+ ///
+ [Description("缺少Content-length头")]
+ LengthRequired = 411,
+
+ ///
+ /// 为此请求设置的条件失败,且无法执行此请求
+ /// 条件是用条件请求标头(如 If-Match、If-None-Match 或 If-Unmodified-Since)设置的。
+ ///
+ [Description("条件失败")]
+ PreconditionFailed = 412,
+
+ ///
+ /// 请求太大,服务器无法处理
+ ///
+ [Description("请求实体太大")]
+ RequestEntityTooLarge = 413,
+
+ ///
+ /// URI 太长
+ ///
+ [Description("请求URI太长")]
+ RequestUriTooLong = 414,
+
+ ///
+ /// 请求是不支持的类型
+ ///
+ [Description("不支持的媒体类型")]
+ UnsupportedMediaType = 415,
+
+ ///
+ /// 无法返回从资源请求的数据范围,因为范围的开头在资源的开头之前,或因为范围的结尾在资源的结尾之后
+ ///
+ [Description("数据范围不匹配")]
+ RequestedRangeNotSatisfiable = 416,
+
+ ///
+ /// 服务器未能符合Expect头中给定的预期值
+ ///
+ [Description("服务器与Expect头不匹配")]
+ ExpectationFailed = 417,
+
+ ///
+ /// 服务器拒绝处理客户端使用当前协议发送的请求,但是可以接受其使用升级后的协议发送的请求
+ ///
+ [Description("当前协议不受支持")]
+ UpgradeRequired = 426,
+
+ ///
+ /// 服务器上发生了一般错误
+ ///
+ [Description("服务器内部错误")]
+ InternalServerError = 500,
+
+ ///
+ /// 服务器不支持请求的函数
+ ///
+ [Description("未实现")]
+ NotImplemented = 501,
+
+ ///
+ /// 中间代理服务器从另一代理或原始服务器接收到错误响应
+ ///
+ [Description("网关失败")]
+ BadGateway = 502,
+
+ ///
+ /// 服务器暂时不可用,通常是由于过多加载或维护
+ ///
+ [Description("服务器维护")]
+ ServiceUnavailable = 503,
+
+ ///
+ /// 中间代理服务器在等待来自另一个代理或原始服务器的响应时已超时
+ ///
+ [Description("网关超时")]
+ GatewayTimeout = 504,
+
+ ///
+ /// 服务器不支持请求的HTTP版本
+ ///
+ [Description("HTTP版本不支持")]
+ HttpVersionNotSupported = 505
+ }
+}
\ No newline at end of file
diff --git a/backend/Dilon.Core/Enum/LoginType.cs b/backend/Dilon.Core/Enum/LoginType.cs
new file mode 100644
index 0000000000000000000000000000000000000000..2a7dade929fd4f90d8b4c7f0ae4aa477e8cac901
--- /dev/null
+++ b/backend/Dilon.Core/Enum/LoginType.cs
@@ -0,0 +1,40 @@
+using System.ComponentModel;
+
+namespace Dilon.Core
+{
+ ///
+ /// 登陆类型
+ ///
+ public enum LoginType
+ {
+ ///
+ /// 登陆
+ ///
+ [Description("登陆")]
+ LOGIN = 0,
+
+ ///
+ /// 登出
+ ///
+ [Description("登出")]
+ LOGOUT = 1,
+
+ ///
+ /// 注册
+ ///
+ [Description("注册")]
+ REGISTER = 2,
+
+ ///
+ /// 改密
+ ///
+ [Description("改密")]
+ CHANGEPASSWORD = 3,
+
+ ///
+ /// 三方授权登陆
+ ///
+ [Description("授权登陆")]
+ AUTHORIZEDLOGIN = 4
+ }
+}
\ No newline at end of file
diff --git a/backend/Dilon.Core/Enum/QueryTypeEnum.cs b/backend/Dilon.Core/Enum/QueryTypeEnum.cs
new file mode 100644
index 0000000000000000000000000000000000000000..cc68646042fec27bbbf4ee6e38bc4e7102a47fc7
--- /dev/null
+++ b/backend/Dilon.Core/Enum/QueryTypeEnum.cs
@@ -0,0 +1,58 @@
+using System.ComponentModel;
+
+namespace Dilon.Core
+{
+ ///
+ /// 查询类型的枚举
+ ///
+ public enum QueryTypeEnum
+ {
+ ///
+ /// 等于
+ ///
+ [Description("等于")]
+ eq = 0,
+
+ ///
+ /// 模糊
+ ///
+ [Description("模糊")]
+ like = 1,
+
+ ///
+ /// 大于
+ ///
+ [Description("大于")]
+ gt = 2,
+
+ ///
+ /// 小于
+ ///
+ [Description("小于")]
+ lt = 3,
+
+ ///
+ /// 不等于
+ ///
+ [Description("不等于")]
+ ne = 4,
+
+ ///
+ /// 大于等于
+ ///
+ [Description("大于等于")]
+ ge = 5,
+
+ ///
+ /// 小于等于
+ ///
+ [Description("小于等于")]
+ le = 6,
+
+ ///
+ /// 不为空
+ ///
+ [Description("不为空")]
+ isNotNull = 7
+ }
+}
diff --git a/backend/Dilon.Core/Enum/RequestTypeEnum.cs b/backend/Dilon.Core/Enum/RequestTypeEnum.cs
new file mode 100644
index 0000000000000000000000000000000000000000..e5a4cda436340a9bfe044380c38810d631100676
--- /dev/null
+++ b/backend/Dilon.Core/Enum/RequestTypeEnum.cs
@@ -0,0 +1,33 @@
+namespace Dilon.Core
+{
+ ///
+ /// http请求类型
+ ///
+ public enum RequestTypeEnum
+ {
+ ///
+ /// 无
+ ///
+ None = 0,
+
+ ///
+ /// GET请求
+ ///
+ Get = 1,
+
+ ///
+ /// POST请求
+ ///
+ Post = 2,
+
+ ///
+ /// PUT请求
+ ///
+ Put = 3,
+
+ ///
+ /// DELETE请求
+ ///
+ Delete = 4
+ }
+}
diff --git a/backend/Dilon.Core/Extension/EnumExtensions.cs b/backend/Dilon.Core/Extension/EnumExtensions.cs
new file mode 100644
index 0000000000000000000000000000000000000000..365d69363ad2aac697ecec9b7eb8a22f8f27393f
--- /dev/null
+++ b/backend/Dilon.Core/Extension/EnumExtensions.cs
@@ -0,0 +1,150 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Reflection;
+using Furion.FriendlyException;
+
+namespace Dilon.Core
+{
+ ///
+ /// 枚举扩展
+ ///
+ public static class EnumExtensions
+ {
+ // 枚举显示字典缓存
+ private static readonly ConcurrentDictionary> EnumDisplayValueDict = new();
+
+ // 枚举值字典缓存
+ private static readonly ConcurrentDictionary> EnumNameValueDict = new();
+
+ // 枚举类型缓存
+ private static ConcurrentDictionary _enumTypeDict = null;
+
+
+ ///
+ /// 获取枚举对象Key与名称的字典(缓存)
+ ///
+ ///
+ ///
+ public static Dictionary GetEnumDictionary(Type enumType)
+ {
+ if (!enumType.IsEnum)
+ throw Oops.Oh(ErrorCode.D1503);
+
+ // 查询缓存
+ Dictionary enumDic = EnumNameValueDict.ContainsKey(enumType) ? EnumNameValueDict[enumType] : new Dictionary();
+ if (enumDic.Count == 0)
+ {
+ // 取枚举类型的Key/Value字典集合
+ enumDic = GetEnumDictionaryItems(enumType);
+
+ // 缓存
+ EnumNameValueDict[enumType] = enumDic;
+ }
+ return enumDic;
+ }
+
+ ///
+ /// 获取枚举对象Key与名称的字典
+ ///
+ ///
+ ///
+ private static Dictionary GetEnumDictionaryItems(Type enumType)
+ {
+ // 获取类型的字段,初始化一个有限长度的字典
+ FieldInfo[] enumFields = enumType.GetFields(BindingFlags.Public | BindingFlags.Static);
+ Dictionary enumDic = new(enumFields.Length);
+
+ // 遍历字段数组获取key和name
+ foreach (FieldInfo enumField in enumFields)
+ {
+ int intValue = (int)enumField.GetValue(enumType);
+ enumDic[intValue] = enumField.Name;
+ }
+ return enumDic;
+ }
+
+ ///
+ /// 获取枚举类型key与描述的字典(缓存)
+ ///
+ ///
+ ///
+ ///
+ public static Dictionary GetEnumDescDictionary(Type enumType)
+ {
+ if (!enumType.IsEnum)
+ throw Oops.Oh(ErrorCode.D1503);
+
+ // 查询缓存
+ Dictionary enumDic = EnumDisplayValueDict.ContainsKey(enumType) ? EnumDisplayValueDict[enumType] : new Dictionary();
+ if (enumDic.Count == 0)
+ {
+ // 取枚举类型的Key/Value字典集合
+ enumDic = GetEnumDescDictionaryItems(enumType);
+
+ // 缓存
+ EnumDisplayValueDict[enumType] = enumDic;
+ }
+ return enumDic;
+ }
+
+ ///
+ /// 获取枚举类型key与描述的字典(没有描述则获取name)
+ ///
+ ///
+ ///
+ ///
+ private static Dictionary GetEnumDescDictionaryItems(Type enumType)
+ {
+ // 获取类型的字段,初始化一个有限长度的字典
+ FieldInfo[] enumFields = enumType.GetFields(BindingFlags.Public | BindingFlags.Static);
+ Dictionary enumDic = new(enumFields.Length);
+
+ // 遍历字段数组获取key和name
+ foreach (FieldInfo enumField in enumFields)
+ {
+ int intValue = (int)enumField.GetValue(enumType);
+ var desc = enumField.GetDescriptionValue();
+ enumDic[intValue] = desc != null && !string.IsNullOrEmpty(desc.Description) ? desc.Description : enumField.Name;
+ }
+ return enumDic;
+ }
+
+ ///
+ /// 从程序集中查找指定枚举类型
+ ///
+ ///
+ ///
+ ///
+ public static Type TryToGetEnumType(Assembly assembly, string typeName)
+ {
+ // 枚举缓存为空则重新加载枚举类型字典
+ _enumTypeDict ??= LoadEnumTypeDict(assembly);
+
+ // 按名称查找
+ if (_enumTypeDict.ContainsKey(typeName))
+ {
+ return _enumTypeDict[typeName];
+ }
+ return null;
+ }
+
+ ///
+ /// 从程序集中加载所有枚举类型
+ ///
+ ///
+ ///
+ private static ConcurrentDictionary LoadEnumTypeDict(Assembly assembly)
+ {
+ // 取程序集中所有类型
+ Type[] typeArray = assembly.GetTypes();
+
+ // 过滤非枚举类型,转成字典格式并返回
+ Dictionary dict = typeArray.Where(o => o.IsEnum).ToDictionary(o => o.Name, o => o);
+ ConcurrentDictionary enumTypeDict = new(dict);
+ return enumTypeDict;
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/Dilon.Core/Extension/PageInputOrder.cs b/backend/Dilon.Core/Extension/PageInputOrder.cs
new file mode 100644
index 0000000000000000000000000000000000000000..28f5ad1bd4e8dc3a69552f97c71bcf474dae3eb0
--- /dev/null
+++ b/backend/Dilon.Core/Extension/PageInputOrder.cs
@@ -0,0 +1,27 @@
+namespace Dilon.Core
+{
+ ///
+ /// 通用输入帮助类
+ ///
+ public class PageInputOrder
+ {
+ ///
+ /// 排序方式(默认降序)
+ ///
+ ///
+ /// 是否降序
+ ///
+ public static string OrderBuilder(PageInputBase pageInput, bool descSort = true)
+ {
+ // 约定默认每张表都有Id排序
+ var orderStr = descSort ? "Id Desc" : "Id Asc";
+
+ // 排序是否可用-排序字段和排序顺序都为非空才启用排序
+ if (!string.IsNullOrEmpty(pageInput.SortField) && !string.IsNullOrEmpty(pageInput.SortOrder))
+ {
+ orderStr = $"{pageInput.SortField} {(pageInput.SortOrder == pageInput.DescStr ? "Desc" : "Asc")}";
+ }
+ return orderStr;
+ }
+ }
+}
diff --git a/backend/Dilon.Core/Extension/XnInputBase.cs b/backend/Dilon.Core/Extension/XnInputBase.cs
index e77d2919ee66a254459c41ac71373fc0033f31f7..c8247f077c80f0aa4faca626fcf68aa1737b72ca 100644
--- a/backend/Dilon.Core/Extension/XnInputBase.cs
+++ b/backend/Dilon.Core/Extension/XnInputBase.cs
@@ -52,5 +52,20 @@ namespace Dilon.Core
/// 搜索结束时间
///
public virtual string SearchEndTime { get; set; }
+
+ ///
+ /// 排序字段
+ ///
+ public virtual string SortField { get; set; }
+
+ ///
+ /// 排序方法,默认升序,否则降序(配合antd前端,约定参数为 Ascend,Dscend)
+ ///
+ public virtual string SortOrder { get; set; }
+
+ ///
+ /// 降序排序(不要问我为什么是descend不是desc,前端约定参数就是这样)
+ ///
+ public virtual string DescStr { get; set; } = "descend";
}
}
diff --git a/backend/Dilon.Core/Extension/XnRestfulResultProvider.cs b/backend/Dilon.Core/Extension/XnRestfulResultProvider.cs
index da1dbc6ffd01a736fc2129fc159651a525298d5e..13c477bec1356a2e0a92812dfa148fd12b93d0e4 100644
--- a/backend/Dilon.Core/Extension/XnRestfulResultProvider.cs
+++ b/backend/Dilon.Core/Extension/XnRestfulResultProvider.cs
@@ -38,46 +38,6 @@ namespace Dilon.Core
});
}
- ///
- /// 处理输出状态码
- ///
- ///
- ///
- ///
- public async Task OnResponseStatusCodes(HttpContext context, int statusCode)
- {
- switch (statusCode)
- {
- // 处理 401 状态码
- case StatusCodes.Status401Unauthorized:
- await context.Response.WriteAsJsonAsync(new XnRestfulResult