mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-03 02:18:00 +08:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
d6a479b693 | |||
e1b0030193 | |||
beba4124b0 | |||
8a29640aeb | |||
8bc8aa960c | |||
d00f0d2d9c | |||
1442e0a37c | |||
6100e9e9c8 | |||
ae2d1c4932 | |||
366a26a5cd | |||
8b53f66331 | |||
705d027da4 | |||
a3ab97019d | |||
608a1ded5c | |||
366ca0d237 | |||
56b111b1cf | |||
f5bd69ef60 |
25
CHANGELOG.md
25
CHANGELOG.md
@ -2,6 +2,31 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [1.4.0](https://github.com/nsnail/NetAdmin/compare/v1.3.0...v1.4.0) (2024-07-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ 框架代码同步 ([#150](https://github.com/nsnail/NetAdmin/issues/150)) ([e1b0030](https://github.com/nsnail/NetAdmin/commit/e1b0030193556fa0564ea059657b4b43c98085c2))
|
||||
|
||||
## [1.3.0](https://github.com/nsnail/NetAdmin/compare/v1.2.0...v1.3.0) (2024-06-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ 补充多语种文件 ([#146](https://github.com/nsnail/NetAdmin/issues/146)) ([1442e0a](https://github.com/nsnail/NetAdmin/commit/1442e0a37cb2f27d8ba7b77bed91feaa5d7b1fdd))
|
||||
* ✨ 更新实体增加sql过滤参数 ([#140](https://github.com/nsnail/NetAdmin/issues/140)) ([a3ab970](https://github.com/nsnail/NetAdmin/commit/a3ab97019dd1fc2267db987ade80fa6749e24e4d))
|
||||
* ✨ 框架代码同步 ([#139](https://github.com/nsnail/NetAdmin/issues/139)) ([608a1de](https://github.com/nsnail/NetAdmin/commit/608a1ded5c0e9987161444efd48597a687c693e1))
|
||||
* ✨ 框架代码同步 ([#144](https://github.com/nsnail/NetAdmin/issues/144)) ([ae2d1c4](https://github.com/nsnail/NetAdmin/commit/ae2d1c4932bf1229ea36d28d486beaee8de16d53))
|
||||
* ✨ 框架代码同步 ([#148](https://github.com/nsnail/NetAdmin/issues/148)) ([8bc8aa9](https://github.com/nsnail/NetAdmin/commit/8bc8aa960cdd1ed5036927bd508fce4c218618c7))
|
||||
* ✨ 前端版本更新器 ([#145](https://github.com/nsnail/NetAdmin/issues/145)) ([6100e9e](https://github.com/nsnail/NetAdmin/commit/6100e9e9c88005d6a2f3c2706ca750a6ad62d2c7))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 补充多语种文件 ([#147](https://github.com/nsnail/NetAdmin/issues/147)) ([d00f0d2](https://github.com/nsnail/NetAdmin/commit/d00f0d2d9cc2243908a8b6979b9c4a5811b2a57e))
|
||||
* 🐛 操作日志不显示userName ([#141](https://github.com/nsnail/NetAdmin/issues/141)) ([705d027](https://github.com/nsnail/NetAdmin/commit/705d027da44af159d29db9c93e47b549317c793e))
|
||||
|
||||
## [1.2.0](https://github.com/nsnail/NetAdmin/compare/v1.1.1...v1.2.0) (2024-06-06)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0-preview.4 AS base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0-preview.5 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
RUN apt update
|
||||
|
25
README.md
25
README.md
@ -20,33 +20,32 @@ docker run -p 8080:8080 nsnail/netadmin
|
||||
## 构建步骤
|
||||
|
||||
```shell
|
||||
# 1. 克隆代码仓库
|
||||
# 下载 git https://git-scm.com/downloads
|
||||
# 1. 检查 dotnet sdk 版本 >=9.0.0
|
||||
dotnet --list-sdks
|
||||
# 下载 dotnet:https://dotnet.microsoft.com/zh-cn/download/dotnet
|
||||
|
||||
# 2. 克隆代码仓库
|
||||
git clone https://github.com/nsnail/NetAdmin.git && cd ./NetAdmin
|
||||
|
||||
# 2. 检查dotnet-sdk版本>=9.0.0
|
||||
# 下载 dotnet https://dotnet.microsoft.com/zh-cn/download/dotnet
|
||||
dotnet --list-sdks
|
||||
|
||||
# 3. 确保本机redis处于运行状态
|
||||
# 下载 redis for windows https://github.com/redis-windows/redis-windows/releases
|
||||
# 下载 redis for linux/mac https://redis.io/download
|
||||
redis-cli
|
||||
# 3. 检查本机 redis 运行状态
|
||||
redis-cli dbsize
|
||||
# 下载 redis for windows:https://github.com/redis-windows/redis-windows/releases
|
||||
# 下载 redis for linux/mac:https://redis.io/download
|
||||
|
||||
# 4. 运行后端 WebApi
|
||||
# 浏览器打开 http://localhost:5010 ,将看到Swagger(Knife4jUI)界面
|
||||
dotnet run --project ./src/backend/NetAdmin.AdmServer.Host/NetAdmin.AdmServer.Host.csproj --urls http://[::]:5010 -is
|
||||
# 浏览器打开 http://localhost:5010 ,将看到Swagger(Knife4jUI)界面
|
||||
|
||||
# 5. 检查 nodejs 版本 >=20
|
||||
# 下载 nodejs https://nodejs.org/en/download
|
||||
node -v
|
||||
# 下载 nodejs:https://nodejs.org/en/download
|
||||
|
||||
# 6. 安装 npm 依赖包
|
||||
cd ./src/frontend/admin && npm install
|
||||
|
||||
# 7. 运行前端项目
|
||||
# 浏览器打开 http://localhost:5020 ,将看到管理界面(默认用户名:root,密码:1234qwer)
|
||||
npm run dev
|
||||
# 浏览器打开 http://localhost:5020 ,将看到管理界面(默认用户名:root,密码:1234qwer)
|
||||
```
|
||||
|
||||
## 文件目录树
|
||||
|
@ -1,16 +1,22 @@
|
||||
上次执行时间
|
||||
上次执行状态
|
||||
上次执行耗时
|
||||
下次执行时间
|
||||
不为其中之一
|
||||
不以什么开始
|
||||
不以什么结束
|
||||
不包含
|
||||
不排序
|
||||
不等于
|
||||
管理模块
|
||||
丧偶
|
||||
中专
|
||||
中共党员
|
||||
为其中之一
|
||||
人工审核
|
||||
以什么开始
|
||||
以什么结束
|
||||
作业名称
|
||||
作业状态
|
||||
保密
|
||||
信息
|
||||
倒序排序
|
||||
@ -18,6 +24,7 @@
|
||||
公告
|
||||
共青团员
|
||||
出生证
|
||||
创建时间
|
||||
初中
|
||||
删除
|
||||
包含
|
||||
@ -25,12 +32,19 @@
|
||||
博士后
|
||||
发送失败
|
||||
同步数据库结构
|
||||
响应体
|
||||
响应状态码
|
||||
唯一编码
|
||||
备注
|
||||
外国人居留证
|
||||
外部错误
|
||||
大专
|
||||
大于
|
||||
大于等于
|
||||
女
|
||||
字典内容导出
|
||||
宕机
|
||||
客户端IP
|
||||
小于
|
||||
小于等于
|
||||
小学
|
||||
@ -39,17 +53,32 @@
|
||||
已校验
|
||||
已读
|
||||
并且
|
||||
意外错误
|
||||
成功
|
||||
或者
|
||||
所属角色
|
||||
所属部门
|
||||
手机
|
||||
手机号
|
||||
执行耗时
|
||||
执行计划
|
||||
护照
|
||||
指定部门数据
|
||||
按钮
|
||||
排序
|
||||
接口名称
|
||||
接口导出
|
||||
接口描述
|
||||
接口路径
|
||||
插入种子数据
|
||||
操作系统
|
||||
数据范围
|
||||
无效操作
|
||||
无效输入
|
||||
无限权限
|
||||
日期范围
|
||||
是否启用
|
||||
显示仪表板
|
||||
未处理异常
|
||||
未婚
|
||||
未读
|
||||
本人数据
|
||||
@ -59,16 +88,24 @@
|
||||
框架
|
||||
比较数据库结构
|
||||
注册
|
||||
消息主题
|
||||
消息摘要
|
||||
消息类型
|
||||
港澳台通行证
|
||||
用户代理
|
||||
用户名
|
||||
用户导出
|
||||
电子邮箱
|
||||
男
|
||||
登录
|
||||
硕士
|
||||
示例导出
|
||||
离异
|
||||
私信
|
||||
空闲
|
||||
站内信导出
|
||||
等于
|
||||
等待发送
|
||||
管理模块
|
||||
系统模块
|
||||
绑定手机号码
|
||||
结果非预期
|
||||
@ -76,16 +113,30 @@
|
||||
自定义
|
||||
范围
|
||||
菜单
|
||||
角色名称
|
||||
角色导出
|
||||
解绑手机号码
|
||||
警告
|
||||
计划作业导出
|
||||
计划作业执行记录导出
|
||||
请求方式
|
||||
请求日志导出
|
||||
调试
|
||||
跟踪
|
||||
身份证
|
||||
运行
|
||||
通知
|
||||
邮箱号
|
||||
部门名称
|
||||
部门导出
|
||||
配置导出
|
||||
重设密码
|
||||
链接
|
||||
错误
|
||||
随机排序
|
||||
项值
|
||||
项名
|
||||
顺序排序
|
||||
高中
|
||||
默认角色
|
||||
默认部门
|
@ -23,7 +23,7 @@ XML注释文件不存在
|
||||
学历不正确
|
||||
密码不能为空
|
||||
已处理完毕
|
||||
并发冲突请稍后重试
|
||||
并发冲突_请稍后重试
|
||||
开始事务
|
||||
性别不正确
|
||||
手机号码不正确
|
||||
@ -34,18 +34,15 @@ XML注释文件不存在
|
||||
数据库同步开始
|
||||
数据库服务器时钟偏移
|
||||
数据库结构同步完成
|
||||
数据版本不能为空
|
||||
文件不能为空
|
||||
新密码不能为空
|
||||
新手机号码验证码不正确
|
||||
无效端口号
|
||||
无效证件号码
|
||||
日志长度超过限制
|
||||
旧密码不正确
|
||||
旧密码不能为空
|
||||
旧手机号码不正确
|
||||
旧手机号码验证码不正确
|
||||
时间戳缺失或误差过大
|
||||
时间表达式
|
||||
时间计划不能为空
|
||||
未指定部门
|
||||
@ -62,15 +59,12 @@ XML注释文件不存在
|
||||
用户名或密码错误
|
||||
用户名长度4位以上
|
||||
用户头像不能为空
|
||||
用户档案不能为空
|
||||
用户编号不存在
|
||||
用户编号不能为空
|
||||
目标设备不能为空
|
||||
短信验证请求不能为空
|
||||
站内信不存在
|
||||
站内信状态不正确
|
||||
站内信类型不正确
|
||||
签名缺失
|
||||
网络地址不正确
|
||||
菜单名称不能为空
|
||||
菜单标题不能为空
|
||||
@ -99,6 +93,7 @@ XML注释文件不存在
|
||||
配置文件初始化完毕
|
||||
键值不能为空
|
||||
键名称不能为空
|
||||
非JSON字符串
|
||||
验证数据不能为空
|
||||
验证码不正确
|
||||
验证码不能为空
|
||||
|
@ -24,7 +24,7 @@
|
||||
"Component": "sys/user",
|
||||
"Icon": "el-icon-user",
|
||||
"Id": 373837957840901,
|
||||
"Name": "sys-user",
|
||||
"Name": "sys/user",
|
||||
"ParentId": 373837917724677,
|
||||
"Path": "/sys/user",
|
||||
"Sort": 100,
|
||||
@ -35,7 +35,7 @@
|
||||
"Component": "sys/role",
|
||||
"Icon": "sc-icon-role",
|
||||
"Id": 373838018527237,
|
||||
"Name": "sys-role",
|
||||
"Name": "sys/role",
|
||||
"ParentId": 373837917724677,
|
||||
"Path": "/sys/role",
|
||||
"Sort": 99,
|
||||
@ -46,7 +46,7 @@
|
||||
"Component": "sys/dept",
|
||||
"Icon": "sc-icon-dept",
|
||||
"Id": 373838045605893,
|
||||
"Name": "sys-dept",
|
||||
"Name": "sys/dept",
|
||||
"ParentId": 373837917724677,
|
||||
"Path": "/sys/dept",
|
||||
"Sort": 98,
|
||||
@ -57,7 +57,7 @@
|
||||
"Component": "sys/menu",
|
||||
"Icon": "el-icon-fold",
|
||||
"Id": 373838070898693,
|
||||
"Name": "sys-menu",
|
||||
"Name": "sys/menu",
|
||||
"ParentId": 373837917724677,
|
||||
"Path": "/sys/menu",
|
||||
"Sort": 97,
|
||||
@ -78,7 +78,7 @@
|
||||
"Component": "sys/config",
|
||||
"Icon": "el-icon-set-up",
|
||||
"Id": 380415005847557,
|
||||
"Name": "sys-config",
|
||||
"Name": "sys/config",
|
||||
"ParentId": 485278637670422,
|
||||
"Path": "/sys/config",
|
||||
"Sort": 100,
|
||||
@ -89,7 +89,7 @@
|
||||
"Component": "sys/job",
|
||||
"Icon": "sc-icon-ScheduledJob",
|
||||
"Id": 510067557638158,
|
||||
"Name": "sys-job",
|
||||
"Name": "sys/job",
|
||||
"ParentId": 485278637670422,
|
||||
"Path": "/sys/job",
|
||||
"Sort": 99,
|
||||
@ -100,7 +100,7 @@
|
||||
"Component": "sys/dic",
|
||||
"Icon": "sc-icon-dic",
|
||||
"Id": 375315654221829,
|
||||
"Name": "sys-dic",
|
||||
"Name": "sys/dic",
|
||||
"ParentId": 485278637670422,
|
||||
"Path": "/sys/dic",
|
||||
"Sort": 98,
|
||||
@ -111,7 +111,7 @@
|
||||
"Component": "sys/msg",
|
||||
"Icon": "el-icon-message",
|
||||
"Id": 482779610341392,
|
||||
"Name": "sys-msg",
|
||||
"Name": "sys/msg",
|
||||
"ParentId": 485278637670422,
|
||||
"Path": "/sys/msg",
|
||||
"Sort": 97,
|
||||
@ -122,7 +122,7 @@
|
||||
"Component": "sys/api",
|
||||
"Icon": "sc-icon-api",
|
||||
"Id": 397880678895621,
|
||||
"Name": "sys-api",
|
||||
"Name": "sys/api",
|
||||
"ParentId": 485278637670422,
|
||||
"Path": "/sys/api",
|
||||
"Sort": 96,
|
||||
@ -133,7 +133,7 @@
|
||||
"Component": "sys/cache",
|
||||
"Icon": "sc-icon-memory",
|
||||
"Id": 374911555702789,
|
||||
"Name": "sys-cache",
|
||||
"Name": "sys/cache",
|
||||
"ParentId": 485278637670422,
|
||||
"Path": "/sys/cache",
|
||||
"Sort": 95,
|
||||
@ -154,7 +154,7 @@
|
||||
"Component": "sys/log/operation",
|
||||
"Icon": "el-icon-pointer",
|
||||
"Id": 485285246504976,
|
||||
"Name": "sys-log-operation",
|
||||
"Name": "sys/log/operation",
|
||||
"ParentId": 374792687640581,
|
||||
"Path": "/sys/log/operation",
|
||||
"Sort": 100,
|
||||
@ -165,7 +165,7 @@
|
||||
"Component": "sys/log/login",
|
||||
"Icon": "sc-icon-OpenDoor",
|
||||
"Id": 485285246504970,
|
||||
"Name": "sys-log-login",
|
||||
"Name": "sys/log/login",
|
||||
"ParentId": 374792687640581,
|
||||
"Path": "/sys/log/login",
|
||||
"Sort": 99,
|
||||
@ -186,7 +186,7 @@
|
||||
"Component": "dev/code",
|
||||
"Icon": "sc-icon-code2",
|
||||
"Id": 373838147022853,
|
||||
"Name": "dev-code",
|
||||
"Name": "dev/code",
|
||||
"ParentId": 373838105399301,
|
||||
"Path": "/dev/code",
|
||||
"Sort": 100,
|
||||
@ -197,10 +197,20 @@
|
||||
"Id": 482777529417739,
|
||||
"ParentId": 373838105399301,
|
||||
"Icon": "el-icon-eleme-filled",
|
||||
"Name": "dev-element",
|
||||
"Path": "https://element-plus.gitee.io/zh-CN/component/button.html",
|
||||
"Name": "dev/element",
|
||||
"Path": "http://element-plus.org/zh-CN/component/overview.html",
|
||||
"Sort": 99,
|
||||
"Title": "Element",
|
||||
"Type": 3,
|
||||
},
|
||||
{
|
||||
"Id": 560217289232398,
|
||||
"ParentId": 373838105399301,
|
||||
"Icon": "sc-icon-FreeSql",
|
||||
"Name": "dev/freesql",
|
||||
"Path": "https://freesql.net/guide",
|
||||
"Sort": 99,
|
||||
"Title": "FreeSql",
|
||||
"Type": 3,
|
||||
}
|
||||
]
|
@ -9,7 +9,7 @@
|
||||
"Sort": 100
|
||||
},
|
||||
{
|
||||
"DataScope": 1,
|
||||
"DataScope": 4,
|
||||
"Enabled": true,
|
||||
"Id": 371729946431493,
|
||||
"Name": "普通用户",
|
||||
|
@ -34,5 +34,13 @@
|
||||
{
|
||||
"ApiId": "api/sys/site.msg/set.site.msg.status",
|
||||
"RoleId": 371729946431493,
|
||||
},
|
||||
{
|
||||
"ApiId": "api/sys/user/get.session.user.app.config",
|
||||
"RoleId": 371729946431493,
|
||||
},
|
||||
{
|
||||
"ApiId": "api/sys/user/set.session.user.app.config",
|
||||
"RoleId": 371729946431493,
|
||||
}
|
||||
]
|
@ -1,11 +1,9 @@
|
||||
[
|
||||
{
|
||||
"Id": 396423792566281,
|
||||
"MenuId": 373837717815301,
|
||||
"RoleId": 371729946431493
|
||||
},
|
||||
{
|
||||
"Id": 396423792566282,
|
||||
"MenuId": 374967228141573,
|
||||
"RoleId": 371729946431493
|
||||
}
|
||||
|
@ -6,5 +6,13 @@
|
||||
"Password": "A8E87D23-49BC-25A1-1C7C-59186BEF5D15",
|
||||
"Token": "A9AFD92E-A33D-4152-9A6C-A9C141D24887",
|
||||
"UserName": "root"
|
||||
},
|
||||
{
|
||||
"DeptId": 372119301627909,
|
||||
"Enabled": true,
|
||||
"Id": 560217289236492,
|
||||
"Password": "A8E87D23-49BC-25A1-1C7C-59186BEF5D15",
|
||||
"Token": "4208EA97-B32F-4E39-A290-4C0D27B61EBF",
|
||||
"UserName": "user"
|
||||
}
|
||||
]
|
@ -1,5 +1,10 @@
|
||||
[
|
||||
{
|
||||
"Id": 370942943322181
|
||||
"Id": 370942943322181,
|
||||
"AppConfig": "[]"
|
||||
},
|
||||
{
|
||||
"Id": 560217289236492,
|
||||
"AppConfig": "[]"
|
||||
}
|
||||
]
|
@ -2,5 +2,9 @@
|
||||
{
|
||||
"RoleId": 370943613149253,
|
||||
"UserId": 370942943322181
|
||||
},
|
||||
{
|
||||
"RoleId": 371729946431493,
|
||||
"UserId": 560217289236492
|
||||
}
|
||||
]
|
@ -23,7 +23,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.26.0.92422">
|
||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.28.0.94264">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@ -16,8 +16,8 @@
|
||||
<None Include="$(SolutionDir)/assets/res/Nations.ln">
|
||||
<Link>Languages/Nations.ln</Link>
|
||||
</None>
|
||||
<None Include="$(SolutionDir)/assets/res/Enums.ln">
|
||||
<Link>Languages/Enums.ln</Link>
|
||||
<None Include="$(SolutionDir)/assets/res/Fields.ln">
|
||||
<Link>Languages/Fields.ln</Link>
|
||||
</None>
|
||||
<EmbeddedResource Include="$(SolutionDir)/assets/res/Ln.resx">
|
||||
<Link>Languages/Ln.resx</Link>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.2.0",
|
||||
"version": "1.4.0",
|
||||
"devDependencies": {
|
||||
"cz-git": "^1.9.2",
|
||||
"commitizen": "^4.3.0",
|
||||
|
@ -1,4 +1,4 @@
|
||||
#r "nuget: NSExt, 2.1.0"
|
||||
#r "nuget: NSExt, 2.2.0"
|
||||
using NSExt.Extensions;
|
||||
|
||||
Console.WriteLine("请输入原始名称(NetAdmin):");
|
||||
|
@ -9,7 +9,7 @@
|
||||
"packages": [
|
||||
{
|
||||
"packageName": "Furion.Pure.NS",
|
||||
"version": "4.9.3-ns1"
|
||||
"version": "4.9.4-ns1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
"packages": [
|
||||
{
|
||||
"packageName": "NSExt",
|
||||
"version": "2.1.0"
|
||||
"version": "2.2.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -65,6 +65,13 @@ global using NetAdmin.Infrastructure.Utils;
|
||||
global using NSExt.Attributes;
|
||||
global using NSExt.Extensions;
|
||||
#if !INFRAS
|
||||
global using CsvHelper.Configuration.Attributes;
|
||||
global using NetAdmin.Domain.Attributes;
|
||||
global using NetAdmin.Domain.Attributes.DataValidation;
|
||||
global using NetAdmin.Domain.DbMaps.Dependency;
|
||||
global using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
global using NetAdmin.Domain.DbMaps.Sys;
|
||||
global using CsvIndex = CsvHelper.Configuration.Attributes.IndexAttribute;
|
||||
global using DynamicFilterInfo = NetAdmin.Domain.Dto.Dependency.DynamicFilterInfo;
|
||||
global using DynamicFilterOperators = NetAdmin.Domain.Enums.DynamicFilterOperators;
|
||||
#endif
|
@ -1,4 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<DefineConstants>DBTYPE_SQLITE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)/build/code.quality.props"/>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../NetAdmin.SysComponent.Application/NetAdmin.SysComponent.Application.csproj"/>
|
||||
|
@ -0,0 +1,2 @@
|
||||
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cadm_005Cpartial/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
@ -1,6 +1,5 @@
|
||||
using NetAdmin.AdmServer.Host.Filters;
|
||||
using NetAdmin.Domain.Contexts;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
using NetAdmin.Host.Extensions;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,6 @@
|
||||
<ProjectReference Include="../NetAdmin.AdmServer.Host/NetAdmin.AdmServer.Host.csproj"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0-release-24352-06"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -10,16 +10,12 @@ namespace NetAdmin.Application.Modules;
|
||||
/// <typeparam name="TCreateRsp">创建响应类型</typeparam>
|
||||
/// <typeparam name="TQueryReq">查询请求类型</typeparam>
|
||||
/// <typeparam name="TQueryRsp">查询响应类型</typeparam>
|
||||
/// <typeparam name="TUpdateReq">修改请求类型</typeparam>
|
||||
/// <typeparam name="TUpdateRsp">修改响应类型</typeparam>
|
||||
/// <typeparam name="TDelReq">删除请求类型</typeparam>
|
||||
public interface ICrudModule<in TCreateReq, TCreateRsp, TQueryReq, TQueryRsp, in TUpdateReq, TUpdateRsp, TDelReq>
|
||||
public interface ICrudModule<in TCreateReq, TCreateRsp, TQueryReq, TQueryRsp, TDelReq>
|
||||
where TCreateReq : DataAbstraction, new()
|
||||
where TCreateRsp : DataAbstraction
|
||||
where TQueryReq : DataAbstraction, new()
|
||||
where TQueryRsp : DataAbstraction
|
||||
where TUpdateReq : DataAbstraction, new()
|
||||
where TUpdateRsp : DataAbstraction
|
||||
where TDelReq : DataAbstraction, new()
|
||||
{
|
||||
/// <summary>
|
||||
@ -47,6 +43,11 @@ public interface ICrudModule<in TCreateReq, TCreateRsp, TQueryReq, TQueryRsp, in
|
||||
/// </summary>
|
||||
Task<bool> ExistAsync(QueryReq<TQueryReq> req);
|
||||
|
||||
/// <summary>
|
||||
/// 导出实体
|
||||
/// </summary>
|
||||
Task<IActionResult> ExportAsync(QueryReq<TQueryReq> req);
|
||||
|
||||
/// <summary>
|
||||
/// 获取单个实体
|
||||
/// </summary>
|
||||
@ -61,9 +62,4 @@ public interface ICrudModule<in TCreateReq, TCreateRsp, TQueryReq, TQueryRsp, in
|
||||
/// 查询实体
|
||||
/// </summary>
|
||||
Task<IEnumerable<TQueryRsp>> QueryAsync(QueryReq<TQueryReq> req);
|
||||
|
||||
/// <summary>
|
||||
/// 更新实体
|
||||
/// </summary>
|
||||
Task<TUpdateRsp> UpdateAsync(TUpdateReq req);
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<DefineConstants>DBTYPE_SQLITE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)/build/code.quality.props"/>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../NetAdmin.Domain/NetAdmin.Domain.csproj"/>
|
||||
|
@ -0,0 +1,19 @@
|
||||
using NetAdmin.Domain.Contexts;
|
||||
|
||||
namespace NetAdmin.Application.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// 基础仓储
|
||||
/// </summary>
|
||||
public sealed class BasicRepository<TEntity, TPrimary>(
|
||||
IFreeSql fSql
|
||||
, UnitOfWorkManager uowManger
|
||||
, ContextUserToken userToken) : DefaultRepository<TEntity, TPrimary>(fSql, uowManger)
|
||||
where TEntity : EntityBase<TPrimary> //
|
||||
where TPrimary : IEquatable<TPrimary>
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前上下文关联的用户令牌
|
||||
/// </summary>
|
||||
public ContextUserToken UserToken => userToken;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using NetAdmin.Domain.Contexts;
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Application.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// 默认仓储
|
||||
/// </summary>
|
||||
public sealed class DefaultRepository<TEntity>(IFreeSql fSql, UnitOfWorkManager uowManger, ContextUserToken userToken)
|
||||
: DefaultRepository<TEntity, long>(fSql, uowManger)
|
||||
where TEntity : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前上下文关联的用户令牌
|
||||
/// </summary>
|
||||
public ContextUserToken UserToken => userToken;
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
using NetAdmin.Application.Repositories;
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using RedLockNet;
|
||||
|
||||
namespace NetAdmin.Application.Services;
|
||||
@ -7,9 +6,11 @@ namespace NetAdmin.Application.Services;
|
||||
/// <summary>
|
||||
/// RedLocker Service Base
|
||||
/// </summary>
|
||||
public abstract class RedLockerService<T1, T2>(DefaultRepository<T1> rpo, RedLocker redLocker)
|
||||
: RepositoryService<T1, T2>(rpo)
|
||||
where T1 : EntityBase
|
||||
public abstract class RedLockerService<TEntity, TPrimary, TLogger>(
|
||||
BasicRepository<TEntity, TPrimary> rpo
|
||||
, RedLocker redLocker) : RepositoryService<TEntity, TPrimary, TLogger>(rpo)
|
||||
where TEntity : EntityBase<TPrimary> //
|
||||
where TPrimary : IEquatable<TPrimary>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取锁
|
||||
|
@ -1,5 +1,4 @@
|
||||
using NetAdmin.Application.Repositories;
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Application.Services;
|
||||
|
||||
@ -7,14 +6,17 @@ namespace NetAdmin.Application.Services;
|
||||
/// 仓储服务基类
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
/// <typeparam name="TPrimary">主键类型</typeparam>
|
||||
/// <typeparam name="TLogger">日志类型</typeparam>
|
||||
public abstract class RepositoryService<TEntity, TLogger>(DefaultRepository<TEntity> rpo) : ServiceBase<TLogger>
|
||||
where TEntity : EntityBase
|
||||
public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicRepository<TEntity, TPrimary> rpo)
|
||||
: ServiceBase<TLogger>
|
||||
where TEntity : EntityBase<TPrimary> //
|
||||
where TPrimary : IEquatable<TPrimary>
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认仓储
|
||||
/// </summary>
|
||||
protected DefaultRepository<TEntity> Rpo => rpo;
|
||||
protected BasicRepository<TEntity, TPrimary> Rpo => rpo;
|
||||
|
||||
/// <summary>
|
||||
/// 启用级联保存
|
||||
@ -25,10 +27,72 @@ public abstract class RepositoryService<TEntity, TLogger>(DefaultRepository<TEnt
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 针对 Sqlite 数据的更新操作
|
||||
/// 更新实体
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// 非 Sqlite 数据库请删除
|
||||
/// </returns>
|
||||
protected abstract Task<TEntity> UpdateForSqliteAsync(TEntity req);
|
||||
/// <param name="newValue">新的值</param>
|
||||
/// <param name="includeFields">包含的属性</param>
|
||||
/// <param name="excludeFields">排除的属性</param>
|
||||
/// <param name="whereExp">查询表达式</param>
|
||||
/// <param name="whereSql">查询sql</param>
|
||||
/// <param name="ignoreVersion">是否忽略版本锁</param>
|
||||
/// <returns>更新行数</returns>
|
||||
protected Task<int> UpdateAsync( //
|
||||
TEntity newValue //
|
||||
, IEnumerable<string> includeFields //
|
||||
, string[] excludeFields = null //
|
||||
, Expression<Func<TEntity, bool>> whereExp = null //
|
||||
, string whereSql = null //
|
||||
, bool ignoreVersion = false)
|
||||
{
|
||||
// 默认匹配主键
|
||||
whereExp ??= a => a.Id.Equals(newValue.Id);
|
||||
var update = BuildUpdate(newValue, includeFields, excludeFields, ignoreVersion).Where(whereExp).Where(whereSql);
|
||||
return update.ExecuteAffrowsAsync();
|
||||
}
|
||||
|
||||
#if DBTYPE_SQLSERVER
|
||||
/// <summary>
|
||||
/// 更新实体
|
||||
/// </summary>
|
||||
/// <param name="newValue">新的值</param>
|
||||
/// <param name="includeFields">包含的属性</param>
|
||||
/// <param name="excludeFields">排除的属性</param>
|
||||
/// <param name="whereExp">查询表达式</param>
|
||||
/// <param name="ignoreVersion">是否忽略版本锁</param>
|
||||
/// <returns>更新后的实体列表</returns>
|
||||
protected Task<List<TEntity>> UpdateReturnListAsync( //
|
||||
TEntity newValue //
|
||||
, IEnumerable<string> includeFields //
|
||||
, string[] excludeFields = null //
|
||||
, Expression<Func<TEntity, bool>> whereExp = null //
|
||||
, bool ignoreVersion = false)
|
||||
{
|
||||
// 默认匹配主键
|
||||
whereExp ??= a => a.Id.Equals(newValue.Id);
|
||||
return BuildUpdate(newValue, includeFields, excludeFields, ignoreVersion).Where(whereExp).ExecuteUpdatedAsync();
|
||||
}
|
||||
#endif
|
||||
|
||||
private IUpdate<TEntity> BuildUpdate( //
|
||||
TEntity entity //
|
||||
, IEnumerable<string> includeFields //
|
||||
, string[] excludeFields = null //
|
||||
, bool ignoreVersion = false)
|
||||
{
|
||||
var updateExp = includeFields == null
|
||||
? Rpo.UpdateDiy.SetSource(entity)
|
||||
: Rpo.UpdateDiy.SetDto(includeFields!.ToDictionary(
|
||||
x => x
|
||||
, x => typeof(TEntity).GetProperty(x, BindingFlags.Public | BindingFlags.Instance)!
|
||||
.GetValue(entity)));
|
||||
if (excludeFields != null) {
|
||||
updateExp = updateExp.IgnoreColumns(excludeFields);
|
||||
}
|
||||
|
||||
if (!ignoreVersion && entity is IFieldVersion ver) {
|
||||
updateExp = updateExp.Where($"{nameof(IFieldVersion.Version)} = @version", new { version = ver.Version });
|
||||
}
|
||||
|
||||
return updateExp;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
namespace NetAdmin.Domain.Attributes.DataValidation;
|
||||
|
||||
/// <summary>
|
||||
/// JSON文本验证器
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter)]
|
||||
public sealed class JsonStringAttribute : ValidationAttribute
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
|
||||
{
|
||||
return (value as string).IsJsonString()
|
||||
? ValidationResult.Success
|
||||
: new ValidationResult(Ln.非JSON字符串, new[] { validationContext.MemberName });
|
||||
}
|
||||
}
|
14
src/backend/NetAdmin.Domain/Attributes/IndicatorAttribute.cs
Normal file
14
src/backend/NetAdmin.Domain/Attributes/IndicatorAttribute.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace NetAdmin.Domain.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// 标记一个枚举的状态指示
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Enum)]
|
||||
public sealed class IndicatorAttribute(string indicate) : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 状态指示
|
||||
/// </summary>
|
||||
public string Indicate { get; init; } = indicate;
|
||||
}
|
@ -3,4 +3,11 @@ namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
/// <summary>
|
||||
/// 数据库实体基类
|
||||
/// </summary>
|
||||
public abstract record EntityBase : DataAbstraction;
|
||||
public abstract record EntityBase<T> : DataAbstraction
|
||||
where T : IEquatable<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
public virtual T Id { get; init; }
|
||||
}
|
@ -10,11 +10,6 @@ public interface IFieldCreatedClient
|
||||
/// </summary>
|
||||
int? CreatedClientIp { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者来源地址
|
||||
/// </summary>
|
||||
string CreatedReferer { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者客户端用户代理
|
||||
/// </summary>
|
||||
|
@ -1,12 +0,0 @@
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
/// <summary>
|
||||
/// 主键字段接口
|
||||
/// </summary>
|
||||
public interface IFieldPrimary<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
T Id { get; init; }
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
using NetAdmin.Domain.Attributes;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract record ImmutableEntity : ImmutableEntity<long>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Snowflake]
|
||||
public override long Id { get; init; }
|
||||
@ -17,18 +14,21 @@ public abstract record ImmutableEntity : ImmutableEntity<long>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">主键类型</typeparam>
|
||||
public abstract record ImmutableEntity<T> : LiteImmutableEntity<T>, IFieldCreatedUser
|
||||
where T : IEquatable<T>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldCreatedUser.CreatedUserId" />
|
||||
[Column(CanUpdate = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long? CreatedUserId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedUser.CreatedUserName" />
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanUpdate = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string CreatedUserName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
using NetAdmin.Domain.Attributes;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract record LiteImmutableEntity : LiteImmutableEntity<long>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Snowflake]
|
||||
public override long Id { get; init; }
|
||||
@ -16,15 +13,18 @@ public abstract record LiteImmutableEntity : LiteImmutableEntity<long>
|
||||
/// 轻型不可变实体
|
||||
/// </summary>
|
||||
/// <typeparam name="T">主键类型</typeparam>
|
||||
public abstract record LiteImmutableEntity<T> : EntityBase, IFieldPrimary<T>, IFieldCreatedTime
|
||||
public abstract record LiteImmutableEntity<T> : EntityBase<T>, IFieldCreatedTime
|
||||
where T : IEquatable<T>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[Column(ServerTime = DateTimeKind.Local, CanUpdate = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual T Id { get; init; }
|
||||
public override T Id { get; init; }
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
using NetAdmin.Domain.Attributes;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract record LiteMutableEntity : LiteMutableEntity<long>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Snowflake]
|
||||
public override long Id { get; init; }
|
||||
@ -16,13 +13,15 @@ public abstract record LiteMutableEntity : LiteMutableEntity<long>
|
||||
/// 轻型可变实体
|
||||
/// </summary>
|
||||
public abstract record LiteMutableEntity<T> : LiteImmutableEntity<T>, IFieldModifiedTime
|
||||
where T : IEquatable<T>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldModifiedTime.ModifiedTime" />
|
||||
[Column(ServerTime = DateTimeKind.Local, CanInsert = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual DateTime? ModifiedTime { get; init; }
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
using NetAdmin.Domain.Attributes;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract record LiteVersionEntity : LiteVersionEntity<long>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Snowflake]
|
||||
public override long Id { get; init; }
|
||||
@ -16,13 +13,15 @@ public abstract record LiteVersionEntity : LiteVersionEntity<long>
|
||||
/// 乐观锁轻型可变实体
|
||||
/// </summary>
|
||||
public abstract record LiteVersionEntity<T> : LiteMutableEntity<T>, IFieldVersion
|
||||
where T : IEquatable<T>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[Column(IsVersion = true, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long Version { get; init; }
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
using NetAdmin.Domain.Attributes;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract record MutableEntity : MutableEntity<long>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Snowflake]
|
||||
public override long Id { get; init; }
|
||||
@ -16,18 +13,21 @@ public abstract record MutableEntity : MutableEntity<long>
|
||||
/// 可变实体
|
||||
/// </summary>
|
||||
public abstract record MutableEntity<T> : LiteMutableEntity<T>, IFieldModifiedUser
|
||||
where T : IEquatable<T>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserId" />
|
||||
[Column(CanInsert = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long? ModifiedUserId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserName" />
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanInsert = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public string ModifiedUserName { get; init; }
|
||||
}
|
@ -1,6 +1,16 @@
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract record SimpleEntity : SimpleEntity<long>
|
||||
{
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Snowflake]
|
||||
public override long Id { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 简单实体
|
||||
/// </summary>
|
||||
public abstract record SimpleEntity : EntityBase;
|
||||
public abstract record SimpleEntity<T> : EntityBase<T>
|
||||
where T : IEquatable<T>;
|
@ -1,12 +1,9 @@
|
||||
using NetAdmin.Domain.Attributes;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract record VersionEntity : VersionEntity<long>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Snowflake]
|
||||
public override long Id { get; init; }
|
||||
@ -16,28 +13,33 @@ public abstract record VersionEntity : VersionEntity<long>
|
||||
/// 乐观锁可变实体
|
||||
/// </summary>
|
||||
public abstract record VersionEntity<T> : LiteVersionEntity<T>, IFieldModifiedUser, IFieldCreatedUser
|
||||
where T : IEquatable<T>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Column(CanUpdate = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long? CreatedUserId { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanUpdate = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string CreatedUserName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserId" />
|
||||
[Column(CanInsert = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long? ModifiedUserId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserName" />
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanInsert = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ModifiedUserName { get; init; }
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
@ -12,12 +9,14 @@ public record Sys_Api : ImmutableEntity<string>, IFieldSummary
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(ParentId))]
|
||||
public IEnumerable<Sys_Api> Children { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127, IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public override string Id { get; init; }
|
||||
|
||||
@ -25,6 +24,7 @@ public record Sys_Api : ImmutableEntity<string>, IFieldSummary
|
||||
/// 请求方式
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_15)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Method { get; init; }
|
||||
|
||||
@ -32,6 +32,7 @@ public record Sys_Api : ImmutableEntity<string>, IFieldSummary
|
||||
/// 服务名称
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Name { get; init; }
|
||||
|
||||
@ -39,6 +40,7 @@ public record Sys_Api : ImmutableEntity<string>, IFieldSummary
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
#pragma warning disable CA1716
|
||||
public virtual string Namespace { get; init; }
|
||||
@ -48,12 +50,14 @@ public record Sys_Api : ImmutableEntity<string>, IFieldSummary
|
||||
/// 父编号
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ParentId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色集合
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_RoleApi))]
|
||||
public ICollection<Sys_Role> Roles { get; init; }
|
||||
@ -62,6 +66,7 @@ public record Sys_Api : ImmutableEntity<string>, IFieldSummary
|
||||
/// 服务描述
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Summary { get; init; }
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
@ -13,6 +10,7 @@ public record Sys_Config : VersionEntity, IFieldEnabled
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool Enabled { get; init; }
|
||||
|
||||
@ -20,12 +18,14 @@ public record Sys_Config : VersionEntity, IFieldEnabled
|
||||
/// 用户注册是否需要人工确认
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool UserRegisterConfirm { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户注册默认部门
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(UserRegisterDeptId))]
|
||||
public Sys_Dept UserRegisterDept { get; init; }
|
||||
@ -34,12 +34,14 @@ public record Sys_Config : VersionEntity, IFieldEnabled
|
||||
/// 用户注册默认部门编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long UserRegisterDeptId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户注册默认角色
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(UserRegisterRoleId))]
|
||||
public Sys_Role UserRegisterRole { get; init; }
|
||||
@ -48,6 +50,7 @@ public record Sys_Config : VersionEntity, IFieldEnabled
|
||||
/// 用户注册默认角色编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long UserRegisterRoleId { get; init; }
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
@ -12,6 +9,7 @@ public record Sys_Dept : VersionEntity, IFieldEnabled, IFieldSummary, IFieldSort
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(ParentId))]
|
||||
public IEnumerable<Sys_Dept> Children { get; init; }
|
||||
@ -20,6 +18,7 @@ public record Sys_Dept : VersionEntity, IFieldEnabled, IFieldSummary, IFieldSort
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool Enabled { get; init; }
|
||||
|
||||
@ -27,6 +26,7 @@ public record Sys_Dept : VersionEntity, IFieldEnabled, IFieldSummary, IFieldSort
|
||||
/// 部门名称
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Name { get; init; }
|
||||
|
||||
@ -34,12 +34,14 @@ public record Sys_Dept : VersionEntity, IFieldEnabled, IFieldSummary, IFieldSort
|
||||
/// 父编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long ParentId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色集合
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_RoleDept))]
|
||||
public ICollection<Sys_Role> Roles { get; init; }
|
||||
@ -47,6 +49,7 @@ public record Sys_Dept : VersionEntity, IFieldEnabled, IFieldSummary, IFieldSort
|
||||
/// <summary>
|
||||
/// 发送给此部门的站内信集合
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_SiteMsgDept))]
|
||||
public ICollection<Sys_SiteMsg> SiteMsgs { get; init; }
|
||||
@ -55,17 +58,15 @@ public record Sys_Dept : VersionEntity, IFieldEnabled, IFieldSummary, IFieldSort
|
||||
/// 排序值,越大越前
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long Sort { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门描述
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Summary { get; init; }
|
||||
}
|
@ -1,17 +1,16 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 字典目录表
|
||||
/// </summary>
|
||||
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Code), nameof(Code), true)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Code), nameof(Code), true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_DicCatalog))]
|
||||
public record Sys_DicCatalog : VersionEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(ParentId))]
|
||||
public IEnumerable<Sys_DicCatalog> Children { get; init; }
|
||||
@ -20,12 +19,14 @@ public record Sys_DicCatalog : VersionEntity
|
||||
/// 字典编码
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Code { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典内容集合
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(Sys_DicContent.CatalogId))]
|
||||
public ICollection<Sys_DicContent> Contents { get; init; }
|
||||
@ -34,6 +35,7 @@ public record Sys_DicCatalog : VersionEntity
|
||||
/// 字典名称
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Name { get; init; }
|
||||
|
||||
@ -41,6 +43,7 @@ public record Sys_DicCatalog : VersionEntity
|
||||
/// 父编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long ParentId { get; init; }
|
||||
}
|
@ -1,18 +1,19 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 字典内容表
|
||||
/// </summary>
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(CatalogId)}_{nameof(Key)}", $"{nameof(CatalogId)},{nameof(Key)}", true)]
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(CatalogId)}_{nameof(Value)}", $"{nameof(CatalogId)},{nameof(Value)}", true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(CatalogId)}_{nameof(Key)}", $"{nameof(CatalogId)},{nameof(Key)}", true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(CatalogId)}_{nameof(Value)}", $"{nameof(CatalogId)},{nameof(Value)}", true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_DicContent))]
|
||||
public record Sys_DicContent : VersionEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典目录
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(CatalogId))]
|
||||
public Sys_DicCatalog Catalog { get; init; }
|
||||
@ -21,6 +22,7 @@ public record Sys_DicContent : VersionEntity
|
||||
/// 字典目录编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long CatalogId { get; init; }
|
||||
|
||||
@ -28,6 +30,7 @@ public record Sys_DicContent : VersionEntity
|
||||
/// 键名称
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Key { get; init; }
|
||||
|
||||
@ -35,6 +38,7 @@ public record Sys_DicContent : VersionEntity
|
||||
/// 键值
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Value { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
using HttpMethods = NetAdmin.Domain.Enums.HttpMethods;
|
||||
|
||||
@ -13,6 +11,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
{
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool Enabled { get; init; }
|
||||
|
||||
@ -20,6 +19,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 执行时间计划
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ExecutionCron { get; init; }
|
||||
|
||||
@ -27,6 +27,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 请求方法
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual HttpMethods HttpMethod { get; init; }
|
||||
|
||||
@ -34,6 +35,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 作业名称
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string JobName { get; init; }
|
||||
|
||||
@ -41,6 +43,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 上次执行耗时
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long? LastDuration { get; init; }
|
||||
|
||||
@ -48,6 +51,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 上次执行时间
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual DateTime? LastExecTime { get; init; }
|
||||
|
||||
@ -55,6 +59,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 上次执行状态
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual HttpStatusCode? LastStatusCode { get; init; }
|
||||
|
||||
@ -62,6 +67,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 下次执行时间
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual DateTime? NextExecTime { get; init; }
|
||||
|
||||
@ -69,39 +75,43 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 下次执行时间编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long? NextTimeId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求体
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestBody { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求头
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestHeader { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求的网络地址
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestUrl { get; init; }
|
||||
|
||||
@ -109,21 +119,24 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 作业状态
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual JobStatues Status { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldSummary.Summary" />
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Summary { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行用户
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(UserId))]
|
||||
public Sys_User User { get; init; }
|
||||
@ -132,6 +145,7 @@ public record Sys_Job : VersionEntity, IFieldEnabled, IFieldSummary
|
||||
/// 执行用户编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long UserId { get; init; }
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using HttpMethods = NetAdmin.Domain.Enums.HttpMethods;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
@ -6,7 +5,11 @@ namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
/// <summary>
|
||||
/// 计划作业执行记录表
|
||||
/// </summary>
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(JobId)}_{nameof(TimeId)}", $"{nameof(JobId)},{nameof(TimeId)}", true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(JobId)}_{nameof(TimeId)}", $"{nameof(JobId)},{nameof(TimeId)}", true)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(CreatedTime), nameof(CreatedTime), false)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(JobId), nameof(JobId), false)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(HttpStatusCode), nameof(HttpStatusCode), false)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_JobRecord))]
|
||||
public record Sys_JobRecord : LiteImmutableEntity
|
||||
{
|
||||
@ -14,6 +17,7 @@ public record Sys_JobRecord : LiteImmutableEntity
|
||||
/// 执行耗时(毫秒)
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long Duration { get; init; }
|
||||
|
||||
@ -21,6 +25,7 @@ public record Sys_JobRecord : LiteImmutableEntity
|
||||
/// 请求方法
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual HttpMethods HttpMethod { get; init; }
|
||||
|
||||
@ -28,12 +33,14 @@ public record Sys_JobRecord : LiteImmutableEntity
|
||||
/// HTTP 状态码
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual int HttpStatusCode { get; init; }
|
||||
public int HttpStatusCode { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 拥有者信息
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(JobId))]
|
||||
public Sys_Job Job { get; init; }
|
||||
@ -42,28 +49,31 @@ public record Sys_JobRecord : LiteImmutableEntity
|
||||
/// 作业编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long JobId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求体
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestBody { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求头
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestHeader { get; init; }
|
||||
|
||||
@ -71,28 +81,31 @@ public record Sys_JobRecord : LiteImmutableEntity
|
||||
/// 请求的网络地址
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestUrl { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 响应体
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ResponseBody { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 响应头
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ResponseHeader { get; init; }
|
||||
|
||||
@ -100,6 +113,7 @@ public record Sys_JobRecord : LiteImmutableEntity
|
||||
/// 执行时间编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long TimeId { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
@ -7,7 +5,7 @@ namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
/// <summary>
|
||||
/// 菜单表
|
||||
/// </summary>
|
||||
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Name), nameof(Name), true)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Name), nameof(Name), true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_Menu))]
|
||||
public record Sys_Menu : VersionEntity, IFieldSort
|
||||
{
|
||||
@ -15,12 +13,14 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 子节点或详情页需要高亮的上级菜单路由地址
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Active { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(ParentId))]
|
||||
public IEnumerable<Sys_Menu> Children { get; init; }
|
||||
@ -29,6 +29,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_7)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Color { get; init; }
|
||||
|
||||
@ -36,6 +37,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 组件
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Component { get; init; }
|
||||
|
||||
@ -43,6 +45,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 是否整页路由
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool FullPageRouting { get; init; }
|
||||
|
||||
@ -50,6 +53,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 是否隐藏菜单
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool Hidden { get; init; }
|
||||
|
||||
@ -57,6 +61,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 是否隐藏面包屑
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool HiddenBreadCrumb { get; init; }
|
||||
|
||||
@ -64,6 +69,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 图标
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Icon { get; init; }
|
||||
|
||||
@ -71,6 +77,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 菜单名称
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Name { get; init; }
|
||||
|
||||
@ -78,6 +85,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 父编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long ParentId { get; init; }
|
||||
|
||||
@ -85,6 +93,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 菜单路径
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Path { get; init; }
|
||||
|
||||
@ -92,12 +101,14 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 重定向地址
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Redirect { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 拥有此菜单的角色集合
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_RoleMenu))]
|
||||
public ICollection<Sys_Role> Roles { get; init; }
|
||||
@ -106,6 +117,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 排序值,越大越前
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long Sort { get; init; }
|
||||
|
||||
@ -113,6 +125,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 标签
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Tag { get; init; }
|
||||
|
||||
@ -120,6 +133,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 菜单标题
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Title { get; init; }
|
||||
|
||||
@ -127,6 +141,7 @@ public record Sys_Menu : VersionEntity, IFieldSort
|
||||
/// 菜单类型
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual MenuTypes Type { get; init; }
|
||||
}
|
@ -1,19 +1,19 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 请求日志表
|
||||
/// </summary>
|
||||
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(ApiId), nameof(ApiId), false)]
|
||||
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(CreatedTime), nameof(CreatedTime), false)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(ApiId), nameof(ApiId), false)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(CreatedTime), nameof(CreatedTime), false)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(UserId), nameof(UserId), false)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(HttpStatusCode), nameof(HttpStatusCode), false)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_RequestLog))]
|
||||
public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
public record Sys_RequestLog : SimpleEntity, IFieldCreatedTime, IFieldCreatedClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 接口
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(ApiId))]
|
||||
public Sys_Api Api { get; init; }
|
||||
@ -22,35 +22,29 @@ public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
/// 接口编号
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ApiId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者客户端IP
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
[Column(Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public int? CreatedClientIp { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者来源地址
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
/// <inheritdoc />
|
||||
[Column(ServerTime = DateTimeKind.Local, CanUpdate = false, Position = -1)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public string CreatedReferer { get; init; }
|
||||
public virtual DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者客户端用户代理
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
/// <inheritdoc />
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_1022)]
|
||||
#else
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string CreatedUserAgent { get; init; }
|
||||
|
||||
@ -58,6 +52,7 @@ public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
/// 执行耗时(微秒)
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long Duration { get; init; }
|
||||
|
||||
@ -65,35 +60,27 @@ public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
/// 程序响应码
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual ErrorCodes ErrorCode { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 异常信息
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Exception { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 附加数据
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#endif
|
||||
[JsonIgnore]
|
||||
public virtual string ExtraData { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// HTTP状态码
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual int HttpStatusCode { get; init; }
|
||||
|
||||
@ -101,28 +88,19 @@ public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
/// 请求方法
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_15)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Method { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源地址
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[JsonIgnore]
|
||||
public virtual string ReferUrl { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求内容
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestBody { get; init; }
|
||||
|
||||
@ -130,17 +108,19 @@ public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
/// 请求content-type
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestContentType { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求头信息
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestHeaders { get; init; }
|
||||
|
||||
@ -148,17 +128,19 @@ public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
/// 请求地址
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RequestUrl { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 响应内容
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ResponseBody { get; init; }
|
||||
|
||||
@ -166,17 +148,19 @@ public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
/// 响应content-type
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ResponseContentType { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 响应头
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string ResponseHeaders { get; init; }
|
||||
|
||||
@ -184,6 +168,23 @@ public record Sys_RequestLog : ImmutableEntity, IFieldCreatedClient
|
||||
/// 服务器IP
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual int? ServerIp { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(UserId))]
|
||||
public Sys_User User { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long? UserId { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.Dto.Sys.Role;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
@ -8,27 +6,42 @@ namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
/// <summary>
|
||||
/// 角色表
|
||||
/// </summary>
|
||||
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Name), nameof(Name), true)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Name), nameof(Name), true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_Role))]
|
||||
public record Sys_Role : VersionEntity, IFieldSort, IFieldEnabled, IFieldSummary, IRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色-接口映射
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_RoleApi))]
|
||||
public ICollection<Sys_Api> Apis { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 仪表板布局
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string DashboardLayout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据范围
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual DataScopes DataScope { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色-部门映射
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_RoleDept))]
|
||||
public ICollection<Sys_Dept> Depts { get; init; }
|
||||
@ -37,6 +50,7 @@ public record Sys_Role : VersionEntity, IFieldSort, IFieldEnabled, IFieldSummary
|
||||
/// 是否显示仪表板
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool DisplayDashboard { get; init; }
|
||||
|
||||
@ -44,6 +58,7 @@ public record Sys_Role : VersionEntity, IFieldSort, IFieldEnabled, IFieldSummary
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool Enabled { get; init; }
|
||||
|
||||
@ -51,12 +66,14 @@ public record Sys_Role : VersionEntity, IFieldSort, IFieldEnabled, IFieldSummary
|
||||
/// 是否忽略权限控制
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool IgnorePermissionControl { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色-菜单映射
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_RoleMenu))]
|
||||
public ICollection<Sys_Menu> Menus { get; init; }
|
||||
@ -65,12 +82,14 @@ public record Sys_Role : VersionEntity, IFieldSort, IFieldEnabled, IFieldSummary
|
||||
/// 角色名称
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Name { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 发送给此角色的站内信集合
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_SiteMsgRole))]
|
||||
public ICollection<Sys_SiteMsg> SiteMsgs { get; init; }
|
||||
@ -79,29 +98,28 @@ public record Sys_Role : VersionEntity, IFieldSort, IFieldEnabled, IFieldSummary
|
||||
/// 排序值,越大越前
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long Sort { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Summary { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 此角色下的用户集合
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_UserRole))]
|
||||
public ICollection<Sys_User> Users { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
public virtual void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<CreateRoleReq, Sys_Role>()
|
||||
.Map( //
|
||||
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
@ -11,6 +9,7 @@ public record Sys_RoleApi : ImmutableEntity
|
||||
/// <summary>
|
||||
/// 关联的接口
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Api Api { get; init; }
|
||||
|
||||
@ -18,12 +17,14 @@ public record Sys_RoleApi : ImmutableEntity
|
||||
/// 接口编号
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public string ApiId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的角色
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Role Role { get; init; }
|
||||
|
||||
@ -31,6 +32,7 @@ public record Sys_RoleApi : ImmutableEntity
|
||||
/// 角色编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long RoleId { get; init; }
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 角色-部门映射表
|
||||
/// </summary>
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(RoleId)}_{nameof(DeptId)}", $"{nameof(RoleId)},{nameof(DeptId)}", true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(RoleId)}_{nameof(DeptId)}", $"{nameof(RoleId)},{nameof(DeptId)}", true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_RoleDept))]
|
||||
public record Sys_RoleDept : ImmutableEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 关联的部门
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Dept Dept { get; init; }
|
||||
|
||||
@ -19,12 +19,14 @@ public record Sys_RoleDept : ImmutableEntity
|
||||
/// 可访问的部门编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long DeptId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的角色
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Role Role { get; init; }
|
||||
|
||||
@ -32,6 +34,7 @@ public record Sys_RoleDept : ImmutableEntity
|
||||
/// 角色编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long RoleId { get; init; }
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 角色-菜单映射表
|
||||
/// </summary>
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(RoleId)}_{nameof(MenuId)}", $"{nameof(RoleId)},{nameof(MenuId)}", true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(RoleId)}_{nameof(MenuId)}", $"{nameof(RoleId)},{nameof(MenuId)}", true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_RoleMenu))]
|
||||
public record Sys_RoleMenu : ImmutableEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 关联的菜单
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Menu Menu { get; init; }
|
||||
|
||||
@ -19,12 +19,14 @@ public record Sys_RoleMenu : ImmutableEntity
|
||||
/// 菜单编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long MenuId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的角色
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Role Role { get; init; }
|
||||
|
||||
@ -32,6 +34,7 @@ public record Sys_RoleMenu : ImmutableEntity
|
||||
/// 角色编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long RoleId { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.Dto.Sys.SiteMsg;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
@ -14,17 +12,19 @@ public record Sys_SiteMsg : VersionEntity, IRegister, IFieldSummary
|
||||
/// <summary>
|
||||
/// 消息内容
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Content { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息-创建者映射
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(CreatedUserId))]
|
||||
public Sys_User Creator { get; init; }
|
||||
@ -32,6 +32,7 @@ public record Sys_SiteMsg : VersionEntity, IRegister, IFieldSummary
|
||||
/// <summary>
|
||||
/// 消息-部门映射
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_SiteMsgDept))]
|
||||
public ICollection<Sys_Dept> Depts { get; init; }
|
||||
@ -39,6 +40,7 @@ public record Sys_SiteMsg : VersionEntity, IRegister, IFieldSummary
|
||||
/// <summary>
|
||||
/// 消息-标记映射
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(Sys_SiteMsgFlag.SiteMsgId))]
|
||||
public ICollection<Sys_SiteMsgFlag> Flags { get; init; }
|
||||
@ -46,12 +48,14 @@ public record Sys_SiteMsg : VersionEntity, IRegister, IFieldSummary
|
||||
/// <summary>
|
||||
/// 消息类型
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual SiteMsgTypes MsgType { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息-角色映射
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_SiteMsgRole))]
|
||||
public ICollection<Sys_Role> Roles { get; init; }
|
||||
@ -59,28 +63,23 @@ public record Sys_SiteMsg : VersionEntity, IRegister, IFieldSummary
|
||||
/// <summary>
|
||||
/// 消息摘要
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Summary { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息主题
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息-用户映射
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_SiteMsgUser))]
|
||||
public ICollection<Sys_User> Users { get; init; }
|
||||
|
@ -1,18 +1,17 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 站内信-部门映射表
|
||||
/// </summary>
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(DeptId)}_{nameof(SiteMsgId)}", $"{nameof(DeptId)},{nameof(SiteMsgId)}"
|
||||
, true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(DeptId)}_{nameof(SiteMsgId)}", $"{nameof(DeptId)},{nameof(SiteMsgId)}", true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_SiteMsgDept))]
|
||||
public record Sys_SiteMsgDept : ImmutableEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 关联的部门
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Dept Dept { get; init; }
|
||||
|
||||
@ -20,12 +19,14 @@ public record Sys_SiteMsgDept : ImmutableEntity
|
||||
/// 部门编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long DeptId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的站内信
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_SiteMsg SiteMsg { get; init; }
|
||||
|
||||
@ -33,6 +34,7 @@ public record Sys_SiteMsgDept : ImmutableEntity
|
||||
/// 站内信编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long SiteMsgId { get; init; }
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
@ -6,8 +5,8 @@ namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
/// <summary>
|
||||
/// 站内信标记表
|
||||
/// </summary>
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(SiteMsgId)}_{nameof(UserId)}", $"{nameof(SiteMsgId)},{nameof(UserId)}"
|
||||
, true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(SiteMsgId)}_{nameof(UserId)}", $"{nameof(SiteMsgId)},{nameof(UserId)}", true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_SiteMsgFlag))]
|
||||
public record Sys_SiteMsgFlag : MutableEntity
|
||||
{
|
||||
@ -15,6 +14,7 @@ public record Sys_SiteMsgFlag : MutableEntity
|
||||
/// 站内信编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long SiteMsgId { get; init; }
|
||||
|
||||
@ -22,6 +22,7 @@ public record Sys_SiteMsgFlag : MutableEntity
|
||||
/// 用户编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long UserId { get; init; }
|
||||
|
||||
@ -29,6 +30,7 @@ public record Sys_SiteMsgFlag : MutableEntity
|
||||
/// 用户站内信状态
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual UserSiteMsgStatues UserSiteMsgStatus { get; init; }
|
||||
}
|
@ -1,18 +1,17 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 站内信-角色映射表
|
||||
/// </summary>
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(RoleId)}_{nameof(SiteMsgId)}", $"{nameof(RoleId)},{nameof(SiteMsgId)}"
|
||||
, true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(RoleId)}_{nameof(SiteMsgId)}", $"{nameof(RoleId)},{nameof(SiteMsgId)}", true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_SiteMsgRole))]
|
||||
public record Sys_SiteMsgRole : ImmutableEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 关联的角色
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Role Role { get; init; }
|
||||
|
||||
@ -20,12 +19,14 @@ public record Sys_SiteMsgRole : ImmutableEntity
|
||||
/// 角色编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long RoleId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的站内信
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_SiteMsg SiteMsg { get; init; }
|
||||
|
||||
@ -33,6 +34,7 @@ public record Sys_SiteMsgRole : ImmutableEntity
|
||||
/// 站内信编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long SiteMsgId { get; init; }
|
||||
}
|
@ -1,18 +1,17 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 站内信-用户映射表
|
||||
/// </summary>
|
||||
[Index($"{Chars.FLG_DB_INDEX_PREFIX}{nameof(UserId)}_{nameof(SiteMsgId)}", $"{nameof(UserId)},{nameof(SiteMsgId)}"
|
||||
, true)]
|
||||
[FreeSql.DataAnnotations.Index( //
|
||||
$"{Chars.FLG_DB_INDEX_PREFIX}{nameof(UserId)}_{nameof(SiteMsgId)}", $"{nameof(UserId)},{nameof(SiteMsgId)}", true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_SiteMsgUser))]
|
||||
public record Sys_SiteMsgUser : ImmutableEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 关联的站内信
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_SiteMsg SiteMsg { get; init; }
|
||||
|
||||
@ -20,12 +19,14 @@ public record Sys_SiteMsgUser : ImmutableEntity
|
||||
/// 站内信编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long SiteMsgId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的用户
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_User User { get; init; }
|
||||
|
||||
@ -33,6 +34,7 @@ public record Sys_SiteMsgUser : ImmutableEntity
|
||||
/// 用户编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long UserId { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
@ -7,9 +5,9 @@ namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
/// <summary>
|
||||
/// 用户基本信息表
|
||||
/// </summary>
|
||||
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Email), nameof(Email), true)]
|
||||
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Mobile), nameof(Mobile), true)]
|
||||
[Index(Chars.FLG_DB_INDEX_PREFIX + nameof(UserName), nameof(UserName), true)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Email), nameof(Email), true)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(Mobile), nameof(Mobile), true)]
|
||||
[FreeSql.DataAnnotations.Index(Chars.FLG_DB_INDEX_PREFIX + nameof(UserName), nameof(UserName), true)]
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_User))]
|
||||
public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
{
|
||||
@ -17,12 +15,14 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// 头像链接
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Avatar { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属部门
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(nameof(DeptId))]
|
||||
public Sys_Dept Dept { get; init; }
|
||||
@ -31,6 +31,7 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// 部门编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual long DeptId { get; init; }
|
||||
|
||||
@ -38,6 +39,7 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Email { get; init; }
|
||||
|
||||
@ -45,6 +47,7 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual bool Enabled { get; init; }
|
||||
|
||||
@ -52,6 +55,7 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// 手机号码
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_15)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Mobile { get; init; }
|
||||
|
||||
@ -59,18 +63,21 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Guid Password { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户档案
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_UserProfile Profile { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属角色
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_UserRole))]
|
||||
public ICollection<Sys_Role> Roles { get; init; }
|
||||
@ -78,6 +85,7 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// <summary>
|
||||
/// 发送给此用户的站内信集合
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
[Navigate(ManyToMany = typeof(Sys_SiteMsgUser))]
|
||||
public ICollection<Sys_SiteMsg> SiteMsgs { get; init; }
|
||||
@ -85,11 +93,8 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Summary { get; init; }
|
||||
|
||||
@ -97,6 +102,7 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// 授权验证Token,全局唯一,可以随时重置(强制下线)
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Guid Token { get; init; }
|
||||
|
||||
@ -104,11 +110,12 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string UserName { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
public virtual void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<CreateUserReq, Sys_User>()
|
||||
.Map(d => d.Password, s => s.PasswordText.Pwd().Guid())
|
||||
@ -119,7 +126,7 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
|
||||
? Array.Empty<Sys_Role>()
|
||||
: s.RoleIds.Select(x => new Sys_Role { Id = x }));
|
||||
|
||||
_ = config.ForType<UpdateUserReq, Sys_User>()
|
||||
_ = config.ForType<EditUserReq, Sys_User>()
|
||||
.Map( //
|
||||
d => d.Password, s => s.PasswordText.NullOrEmpty() ? Guid.Empty : s.PasswordText.Pwd().Guid())
|
||||
.Map( //
|
||||
|
@ -1,4 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
@ -9,10 +8,23 @@ namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_UserProfile))]
|
||||
public record Sys_UserProfile : VersionEntity, IRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用配置
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string AppConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出生日期
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual DateTime? BornDate { get; init; }
|
||||
|
||||
@ -20,6 +32,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 证件号码
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string CertificateNumber { get; init; }
|
||||
|
||||
@ -27,6 +40,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 证件类型
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual CertificateTypes? CertificateType { get; init; }
|
||||
|
||||
@ -34,6 +48,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 工作地址
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string CompanyAddress { get; init; }
|
||||
|
||||
@ -41,6 +56,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 工作地区
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public int? CompanyArea { get; init; }
|
||||
|
||||
@ -48,6 +64,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 工作单位
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string CompanyName { get; init; }
|
||||
|
||||
@ -55,6 +72,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 工作电话
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string CompanyTelephone { get; init; }
|
||||
|
||||
@ -62,6 +80,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 文化程度
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual Educations? Education { get; init; }
|
||||
|
||||
@ -69,6 +88,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 紧急联系地址
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string EmergencyContactAddress { get; init; }
|
||||
|
||||
@ -76,13 +96,15 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 紧急联系地区
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public int? EmergencyContactArea { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 紧急联系人手机号码
|
||||
/// 紧急联系人手机号
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_15)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string EmergencyContactMobile { get; init; }
|
||||
|
||||
@ -90,6 +112,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 紧急联系人
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string EmergencyContactName { get; init; }
|
||||
|
||||
@ -97,6 +120,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 毕业学校
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string GraduateSchool { get; init; }
|
||||
|
||||
@ -104,6 +128,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 身高
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual int? Height { get; init; }
|
||||
|
||||
@ -111,6 +136,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 住宅地址
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_127)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string HomeAddress { get; init; }
|
||||
|
||||
@ -118,6 +144,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 住宅地区
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public int? HomeArea { get; init; }
|
||||
|
||||
@ -125,6 +152,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 住宅电话
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string HomeTelephone { get; init; }
|
||||
|
||||
@ -132,6 +160,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 婚姻状况
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual MarriageStatues? MarriageStatus { get; init; }
|
||||
|
||||
@ -140,6 +169,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// </summary>
|
||||
/// 7
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual Nations? Nation { get; init; }
|
||||
|
||||
@ -147,6 +177,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 籍贯
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public int? NationArea { get; init; }
|
||||
|
||||
@ -154,6 +185,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 政治面貌
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual PoliticalStatues? PoliticalStatus { get; init; }
|
||||
|
||||
@ -161,6 +193,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 职业
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Profession { get; init; }
|
||||
|
||||
@ -168,6 +201,7 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 真实姓名
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string RealName { get; init; }
|
||||
|
||||
@ -175,12 +209,14 @@ public record Sys_UserProfile : VersionEntity, IRegister
|
||||
/// 性别
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual Sexes? Sex { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户基本信息
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_User User { get; init; }
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
/// <summary>
|
||||
@ -11,6 +9,7 @@ public record Sys_UserRole : VersionEntity
|
||||
/// <summary>
|
||||
/// 关联的角色
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_Role Role { get; init; }
|
||||
|
||||
@ -18,12 +17,14 @@ public record Sys_UserRole : VersionEntity
|
||||
/// 角色编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long RoleId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的用户
|
||||
/// </summary>
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public Sys_User User { get; init; }
|
||||
|
||||
@ -31,6 +32,7 @@ public record Sys_UserRole : VersionEntity
|
||||
/// 用户编号
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public long UserId { get; init; }
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Sys;
|
||||
@ -13,6 +12,7 @@ public record Sys_VerifyCode : VersionEntity
|
||||
/// 验证码
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_7)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string Code { get; init; }
|
||||
|
||||
@ -20,6 +20,7 @@ public record Sys_VerifyCode : VersionEntity
|
||||
/// 目标设备
|
||||
/// </summary>
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_63)]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual string DestDevice { get; init; }
|
||||
|
||||
@ -27,17 +28,15 @@ public record Sys_VerifyCode : VersionEntity
|
||||
/// 设备类型
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual VerifyCodeDeviceTypes DeviceType { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 发送报告
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLITE
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#else
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_MAX)]
|
||||
#endif
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public string Report { get; init; }
|
||||
|
||||
@ -45,6 +44,7 @@ public record Sys_VerifyCode : VersionEntity
|
||||
/// 验证码状态
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual VerifyCodeStatues Status { get; init; }
|
||||
|
||||
@ -52,6 +52,7 @@ public record Sys_VerifyCode : VersionEntity
|
||||
/// 验证码类型
|
||||
/// </summary>
|
||||
[Column]
|
||||
[Ignore]
|
||||
[JsonIgnore]
|
||||
public virtual VerifyCodeTypes Type { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Tpl;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Dependency;
|
||||
|
||||
/// <inheritdoc cref="DelReq{T}" />
|
||||
@ -8,8 +6,9 @@ public sealed record DelReq : DelReq<long>;
|
||||
/// <summary>
|
||||
/// 请求:通过编号删除
|
||||
/// </summary>
|
||||
public record DelReq<T> : DataAbstraction, IFieldPrimary<T>
|
||||
public record DelReq<T> : EntityBase<T>
|
||||
where T : IEquatable<T>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
public T Id { get; init; }
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
public override T Id { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Api;
|
||||
|
||||
/// <summary>
|
||||
|
35
src/backend/NetAdmin.Domain/Dto/Sys/Api/ExportApiRsp.cs
Normal file
35
src/backend/NetAdmin.Domain/Dto/Sys/Api/ExportApiRsp.cs
Normal file
@ -0,0 +1,35 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Api;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:导出接口
|
||||
/// </summary>
|
||||
public record ExportApiRsp : QueryApiRsp
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Ignore]
|
||||
public override IEnumerable<QueryApiRsp> Children { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(0)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.接口路径))]
|
||||
public override string Id { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(2)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.请求方式))]
|
||||
public override string Method { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(1)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.接口名称))]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(3)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.接口描述))]
|
||||
public override string Summary { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Api;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,17 +1,14 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Api;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询接口
|
||||
/// </summary>
|
||||
public sealed record QueryApiRsp : Sys_Api
|
||||
public record QueryApiRsp : Sys_Api
|
||||
{
|
||||
/// <inheritdoc cref="Sys_Api.Children" />
|
||||
public new IEnumerable<QueryApiRsp> Children { get; init; }
|
||||
public new virtual IEnumerable<QueryApiRsp> Children { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
public override string Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Api.Method" />
|
||||
|
@ -8,5 +8,5 @@ public sealed record GetAllEntriesReq : DataAbstraction
|
||||
/// <summary>
|
||||
/// 数据库索引号
|
||||
/// </summary>
|
||||
public uint DbIndex { get; init; }
|
||||
public int DbIndex { get; init; }
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,11 +1,9 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新配置
|
||||
/// 请求:编辑配置
|
||||
/// </summary>
|
||||
public sealed record UpdateConfigReq : CreateConfigReq
|
||||
public sealed record EditConfigReq : CreateConfigReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
@ -0,0 +1,60 @@
|
||||
using NetAdmin.Domain.Dto.Sys.Dept;
|
||||
using NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:导出配置
|
||||
/// </summary>
|
||||
public record ExportConfigRsp : QueryConfigRsp, IRegister
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(6)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.是否启用))]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(0)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.唯一编码))]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(3)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.人工审核))]
|
||||
public override bool UserRegisterConfirm { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[Ignore]
|
||||
public override QueryDeptRsp UserRegisterDept { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认部门
|
||||
/// </summary>
|
||||
[CsvIndex(1)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.默认部门))]
|
||||
public string UserRegisterDeptName { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[Ignore]
|
||||
public override QueryRoleRsp UserRegisterRole { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认角色
|
||||
/// </summary>
|
||||
[CsvIndex(2)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.默认角色))]
|
||||
public string UserRegisterRoleName { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<Sys_Config, ExportConfigRsp>()
|
||||
.Map(d => d.UserRegisterDeptName, s => s.UserRegisterDept.Name)
|
||||
.Map(d => d.UserRegisterRoleName, s => s.UserRegisterRole.Name);
|
||||
}
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
@ -12,7 +9,7 @@ public sealed record QueryConfigReq : Sys_Config
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public new bool? Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Dept;
|
||||
using NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
@ -8,7 +6,7 @@ namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
/// <summary>
|
||||
/// 响应:查询配置
|
||||
/// </summary>
|
||||
public sealed record QueryConfigRsp : Sys_Config
|
||||
public record QueryConfigRsp : Sys_Config
|
||||
{
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
@ -18,7 +16,7 @@ public sealed record QueryConfigRsp : Sys_Config
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
@ -28,7 +26,7 @@ public sealed record QueryConfigRsp : Sys_Config
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterDept" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public new QueryDeptRsp UserRegisterDept { get; init; }
|
||||
public new virtual QueryDeptRsp UserRegisterDept { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterDeptId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
@ -36,7 +34,7 @@ public sealed record QueryConfigRsp : Sys_Config
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterRole" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public new QueryRoleRsp UserRegisterRole { get; init; }
|
||||
public new virtual QueryRoleRsp UserRegisterRole { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterRoleId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
|
@ -0,0 +1,19 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:启用/禁用配置
|
||||
/// </summary>
|
||||
public sealed record SetConfigEnabledReq : Sys_Config
|
||||
{
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,13 +1,11 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新部门
|
||||
/// 请求:编辑部门
|
||||
/// </summary>
|
||||
public sealed record UpdateDeptReq : CreateDeptReq
|
||||
public sealed record EditDeptReq : CreateDeptReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
47
src/backend/NetAdmin.Domain/Dto/Sys/Dept/ExportDeptRsp.cs
Normal file
47
src/backend/NetAdmin.Domain/Dto/Sys/Dept/ExportDeptRsp.cs
Normal file
@ -0,0 +1,47 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:导出部门
|
||||
/// </summary>
|
||||
public record ExportDeptRsp : QueryDeptRsp
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Ignore]
|
||||
public override IEnumerable<QueryDeptRsp> Children { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(5)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.创建时间))]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(4)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.是否启用))]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(0)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.唯一编码))]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(1)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.部门名称))]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(2)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.排序))]
|
||||
public override long Sort { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(3)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.备注))]
|
||||
public override string Summary { get; init; }
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
@ -8,7 +5,7 @@ namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
/// </summary>
|
||||
public sealed record QueryDeptReq : Sys_Dept
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
@ -1,15 +1,12 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询部门
|
||||
/// </summary>
|
||||
public sealed record QueryDeptRsp : Sys_Dept
|
||||
public record QueryDeptRsp : Sys_Dept
|
||||
{
|
||||
/// <inheritdoc cref="Sys_Dept.Children" />
|
||||
public new IEnumerable<QueryDeptRsp> Children { get; init; }
|
||||
public new virtual IEnumerable<QueryDeptRsp> Children { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
@ -19,7 +16,7 @@ public sealed record QueryDeptRsp : Sys_Dept
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:启用/禁用部门
|
||||
/// </summary>
|
||||
public sealed record SetDeptEnabledReq : Sys_Dept
|
||||
{
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,11 +1,9 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新字典目录
|
||||
/// 请求:编辑字典目录
|
||||
/// </summary>
|
||||
public sealed record UpdateDicCatalogReq : CreateDicCatalogReq
|
||||
public sealed record EditDicCatalogReq : CreateDicCatalogReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
/// <summary>
|
||||
@ -15,7 +12,7 @@ public sealed record QueryDicCatalogRsp : Sys_DicCatalog
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Code { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,11 +1,9 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新字典内容
|
||||
/// 请求:编辑字典内容
|
||||
/// </summary>
|
||||
public sealed record UpdateDicContentReq : CreateDicContentReq
|
||||
public sealed record EditDicContentReq : CreateDicContentReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
@ -0,0 +1,25 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:导出字典内容
|
||||
/// </summary>
|
||||
public record ExportDicContentRsp : QueryDicContentRsp
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(2)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.创建时间))]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(0)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.项名))]
|
||||
public override string Key { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(1)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.项值))]
|
||||
public override string Value { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,12 +1,9 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询字典内容
|
||||
/// </summary>
|
||||
public sealed record QueryDicContentRsp : Sys_DicContent
|
||||
public record QueryDicContentRsp : Sys_DicContent
|
||||
{
|
||||
/// <inheritdoc cref="Sys_DicContent.CatalogId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
using HttpMethods = NetAdmin.Domain.Enums.HttpMethods;
|
||||
|
||||
|
11
src/backend/NetAdmin.Domain/Dto/Sys/Job/EditJobReq.cs
Normal file
11
src/backend/NetAdmin.Domain/Dto/Sys/Job/EditJobReq.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑计划作业
|
||||
/// </summary>
|
||||
public sealed record EditJobReq : CreateJobReq
|
||||
{
|
||||
/// <inheritdoc cref="System.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
81
src/backend/NetAdmin.Domain/Dto/Sys/Job/ExportJobRsp.cs
Normal file
81
src/backend/NetAdmin.Domain/Dto/Sys/Job/ExportJobRsp.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using NetAdmin.Domain.Dto.Sys.User;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
using HttpMethods = NetAdmin.Domain.Enums.HttpMethods;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:导出计划作业
|
||||
/// </summary>
|
||||
public record ExportJobRsp : QueryJobRsp
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(5)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.上次执行状态))]
|
||||
public override string LastStatusCode => base.LastStatusCode;
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(10)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.创建时间))]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(9)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.是否启用))]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(2)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.执行计划))]
|
||||
public override string ExecutionCron { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(4)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.请求方式))]
|
||||
public override HttpMethods HttpMethod { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(0)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.唯一编码))]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(1)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.作业名称))]
|
||||
public override string JobName { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(7)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.上次执行耗时))]
|
||||
public override long? LastDuration { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(6)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.上次执行时间))]
|
||||
public override DateTime? LastExecTime { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(8)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.下次执行时间))]
|
||||
public override DateTime? NextExecTime { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[CsvIndex(3)]
|
||||
[Ignore(false)]
|
||||
[Name(nameof(Ln.作业状态))]
|
||||
public override JobStatues Status { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[Ignore]
|
||||
public override QueryUserRsp User { get; init; }
|
||||
}
|
13
src/backend/NetAdmin.Domain/Dto/Sys/Job/FinishJobReq.cs
Normal file
13
src/backend/NetAdmin.Domain/Dto/Sys/Job/FinishJobReq.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:完成计划作业
|
||||
/// </summary>
|
||||
public sealed record FinishJobReq : Sys_Job, IRegister
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<QueryJobRsp, FinishJobReq>().Map(d => d.LastStatusCode, s => ((Sys_Job)s).LastStatusCode);
|
||||
}
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
|
||||
/// <summary>
|
||||
@ -8,7 +5,7 @@ namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
/// </summary>
|
||||
public sealed record QueryJobReq : Sys_Job
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.User;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
using HttpMethods = NetAdmin.Domain.Enums.HttpMethods;
|
||||
@ -9,8 +7,19 @@ namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
/// <summary>
|
||||
/// 响应:查询计划作业
|
||||
/// </summary>
|
||||
public sealed record QueryJobRsp : Sys_Job
|
||||
public record QueryJobRsp : Sys_Job
|
||||
{
|
||||
/// <inheritdoc cref="Sys_Job.LastStatusCode" />
|
||||
public new virtual string LastStatusCode =>
|
||||
#pragma warning disable IDE0072
|
||||
base.LastStatusCode switch {
|
||||
#pragma warning restore IDE0072
|
||||
null => null
|
||||
, _ => (int)base.LastStatusCode.Value == Numbers.HTTP_STATUS_BIZ_FAIL
|
||||
? nameof(ErrorCodes.Unhandled).ToLowerCamelCase()
|
||||
: base.LastStatusCode.Value.ToString().ToLowerCamelCase()
|
||||
};
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
@ -35,7 +44,7 @@ public sealed record QueryJobRsp : Sys_Job
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override HttpMethods HttpMethod { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
@ -51,10 +60,6 @@ public sealed record QueryJobRsp : Sys_Job
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override DateTime? LastExecTime { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Job.LastStatusCode" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override HttpStatusCode? LastStatusCode { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldModifiedTime.ModifiedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override DateTime? ModifiedTime { get; init; }
|
||||
@ -96,7 +101,7 @@ public sealed record QueryJobRsp : Sys_Job
|
||||
public override string Summary { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Job.User" />
|
||||
public new QueryUserRsp User { get; init; }
|
||||
public new virtual QueryUserRsp User { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Job.UserId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
|
15
src/backend/NetAdmin.Domain/Dto/Sys/Job/SetJobEnabledReq.cs
Normal file
15
src/backend/NetAdmin.Domain/Dto/Sys/Job/SetJobEnabledReq.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:设置计划作业启用状态
|
||||
/// </summary>
|
||||
public sealed record SetJobEnabledReq : Sys_Job
|
||||
{
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user