基础框架
This commit is contained in:
commit
f99f612b3c
45
admin.net.pro/.gitignore
vendored
Normal file
45
admin.net.pro/.gitignore
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
# Build and Release Folders
|
||||
bin-debug/
|
||||
bin-release/
|
||||
[Oo]bj/
|
||||
[Bb]in/
|
||||
|
||||
# Other files and folders
|
||||
.settings/
|
||||
|
||||
# Executables
|
||||
*.swf
|
||||
*.air
|
||||
*.ipa
|
||||
*.apk
|
||||
|
||||
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||
# should NOT be excluded as they contain compiler settings and other important
|
||||
# information for Eclipse / Flash Builder.
|
||||
/Admin.NET/.vs
|
||||
/Admin.NET/packages
|
||||
/Admin.NET/Admin.NET.Web.Entry/wwwroot/Upload
|
||||
/Admin.NET/Admin.NET.Web.Entry/wwwroot/Avatar
|
||||
/Admin.NET/Admin.NET.Web.Entry/wwwroot/Signature
|
||||
/Admin.NET/Admin.NET.Web.Entry/wwwroot/CodeGen
|
||||
/Admin.NET/Admin.NET.Web.Entry/wwwroot/is-cache
|
||||
/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj.user
|
||||
/Admin.NET/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj.user
|
||||
/Admin.NET/Admin.NET.Web.Entry/Properties/PublishProfiles
|
||||
/Admin.NET/Admin.NET.Web.Entry/publish
|
||||
/Admin.NET/Admin.NET.Web.Entry/logs
|
||||
/Admin.NET/Admin.NET.Web.Entry/Admin.NET.db
|
||||
|
||||
# folders
|
||||
dist/
|
||||
node_modules/
|
||||
/Web/package-lock.json
|
||||
/Web/public/config.js
|
||||
/Web/stats.html
|
||||
/Web/npminstall-debug.log
|
||||
.vs
|
||||
.idea
|
||||
.DS_Store
|
||||
/Admin.NET/.vs
|
||||
/Admin.NET.App/unpackage
|
||||
/App/unpackage
|
25
admin.net.pro/Admin.NET/.dockerignore
Normal file
25
admin.net.pro/Admin.NET/.dockerignore
Normal file
@ -0,0 +1,25 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
178
admin.net.pro/Admin.NET/.editorconfig
Normal file
178
admin.net.pro/Admin.NET/.editorconfig
Normal file
@ -0,0 +1,178 @@
|
||||
|
||||
[*.cs]
|
||||
#### 命名样式 ####
|
||||
|
||||
# 命名规则
|
||||
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||
|
||||
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||
|
||||
# 符号规范
|
||||
|
||||
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.interface.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.types.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||
|
||||
# 命名样式
|
||||
|
||||
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||
dotnet_naming_style.begins_with_i.required_suffix =
|
||||
dotnet_naming_style.begins_with_i.word_separator =
|
||||
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.pascal_case.required_prefix =
|
||||
dotnet_naming_style.pascal_case.required_suffix =
|
||||
dotnet_naming_style.pascal_case.word_separator =
|
||||
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.pascal_case.required_prefix =
|
||||
dotnet_naming_style.pascal_case.required_suffix =
|
||||
dotnet_naming_style.pascal_case.word_separator =
|
||||
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||
csharp_using_directive_placement = outside_namespace:silent
|
||||
csharp_style_expression_bodied_methods = false:silent
|
||||
csharp_style_expression_bodied_constructors = false:silent
|
||||
csharp_style_expression_bodied_operators = false:silent
|
||||
csharp_style_expression_bodied_properties = true:silent
|
||||
csharp_style_expression_bodied_indexers = true:silent
|
||||
csharp_style_expression_bodied_accessors = true:silent
|
||||
csharp_style_expression_bodied_lambdas = true:silent
|
||||
csharp_style_expression_bodied_local_functions = false:silent
|
||||
csharp_style_conditional_delegate_call = true:suggestion
|
||||
csharp_style_var_for_built_in_types = false:silent
|
||||
csharp_style_var_when_type_is_apparent = false:silent
|
||||
csharp_style_var_elsewhere = false:silent
|
||||
csharp_prefer_simple_using_statement = true:suggestion
|
||||
csharp_prefer_braces = true:silent
|
||||
csharp_style_namespace_declarations = file_scoped:silent
|
||||
csharp_style_prefer_top_level_statements = true:silent
|
||||
csharp_style_prefer_method_group_conversion = true:silent
|
||||
csharp_prefer_static_local_function = true:suggestion
|
||||
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
|
||||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
|
||||
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
|
||||
csharp_style_prefer_switch_expression = true:suggestion
|
||||
csharp_style_prefer_pattern_matching = true:silent
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||
csharp_style_prefer_not_pattern = true:suggestion
|
||||
csharp_style_prefer_extended_property_pattern = true:suggestion
|
||||
csharp_style_throw_expression = true:suggestion
|
||||
csharp_style_prefer_null_check_over_type_check = true:suggestion
|
||||
csharp_prefer_simple_default_expression = true:suggestion
|
||||
csharp_style_prefer_local_over_anonymous_function = true:suggestion
|
||||
csharp_style_prefer_index_operator = true:suggestion
|
||||
csharp_style_prefer_range_operator = true:suggestion
|
||||
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
|
||||
csharp_style_prefer_tuple_swap = true:suggestion
|
||||
csharp_style_prefer_utf8_string_literals = true:suggestion
|
||||
csharp_style_inlined_variable_declaration = true:suggestion
|
||||
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
||||
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_indent_labels = one_less_than_current
|
||||
|
||||
[*.vb]
|
||||
#### 命名样式 ####
|
||||
|
||||
# 命名规则
|
||||
|
||||
dotnet_naming_rule.interface_should_be_以_i_开始.severity = suggestion
|
||||
dotnet_naming_rule.interface_should_be_以_i_开始.symbols = interface
|
||||
dotnet_naming_rule.interface_should_be_以_i_开始.style = 以_i_开始
|
||||
|
||||
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.severity = suggestion
|
||||
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.symbols = 类型
|
||||
dotnet_naming_rule.类型_should_be_帕斯卡拼写法.style = 帕斯卡拼写法
|
||||
|
||||
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.severity = suggestion
|
||||
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.symbols = 非字段成员
|
||||
dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.style = 帕斯卡拼写法
|
||||
|
||||
# 符号规范
|
||||
|
||||
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||
dotnet_naming_symbols.interface.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
|
||||
dotnet_naming_symbols.interface.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.类型.applicable_kinds = class, struct, interface, enum
|
||||
dotnet_naming_symbols.类型.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
|
||||
dotnet_naming_symbols.类型.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.非字段成员.applicable_kinds = property, event, method
|
||||
dotnet_naming_symbols.非字段成员.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
|
||||
dotnet_naming_symbols.非字段成员.required_modifiers =
|
||||
|
||||
# 命名样式
|
||||
|
||||
dotnet_naming_style.以_i_开始.required_prefix = I
|
||||
dotnet_naming_style.以_i_开始.required_suffix =
|
||||
dotnet_naming_style.以_i_开始.word_separator =
|
||||
dotnet_naming_style.以_i_开始.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.帕斯卡拼写法.required_prefix =
|
||||
dotnet_naming_style.帕斯卡拼写法.required_suffix =
|
||||
dotnet_naming_style.帕斯卡拼写法.word_separator =
|
||||
dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.帕斯卡拼写法.required_prefix =
|
||||
dotnet_naming_style.帕斯卡拼写法.required_suffix =
|
||||
dotnet_naming_style.帕斯卡拼写法.word_separator =
|
||||
dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case
|
||||
|
||||
[*.{cs,vb}]
|
||||
end_of_line = crlf
|
||||
dotnet_style_qualification_for_field = false:silent
|
||||
dotnet_style_qualification_for_property = false:silent
|
||||
dotnet_style_qualification_for_method = false:silent
|
||||
dotnet_style_qualification_for_event = false:silent
|
||||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
||||
dotnet_code_quality_unused_parameters = all:suggestion
|
||||
dotnet_style_readonly_field = true:suggestion
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
||||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
|
||||
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
|
||||
dotnet_style_prefer_auto_properties = true:silent
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
||||
dotnet_style_explicit_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||
dotnet_style_prefer_compound_assignment = true:suggestion
|
||||
dotnet_style_prefer_simplified_interpolation = true:suggestion
|
||||
dotnet_style_namespace_match_folder = true:suggestion
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
|
||||
dotnet_style_predefined_type_for_member_access = true:silent
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||
|
||||
# Add copyright file header
|
||||
file_header_template = Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。\n\n本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。\n\n不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
@ -0,0 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
|
||||
<NoWarn>1701;1702;1591;8632</NoWarn>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<Nullable>disable</Nullable>
|
||||
<Copyright>Admin.NET</Copyright>
|
||||
<Description>Admin.NET 通用权限开发平台</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Configuration\**\*">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="wwwroot\**\*">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Admin.NET.Core\Admin.NET.Core.csproj" />
|
||||
<ProjectReference Include="..\Plugins\Admin.NET.Plugin.GoView\Admin.NET.Plugin.GoView.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,34 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"APIJSON": {
|
||||
"Roles": [
|
||||
{
|
||||
"RoleName": "Role1", // 权限名称 唯一
|
||||
"Select": { // 查询
|
||||
"Table": [ "*" ], // 可操作的表
|
||||
"Column": [ "*" ], // 可操作的字段
|
||||
"Filter": []
|
||||
},
|
||||
"Insert": { // 添加
|
||||
"Table": [ "table1", "table2", "table3" ],
|
||||
"Column": [ "*", "*", "tb.*" ]
|
||||
},
|
||||
"Update": { // 修改
|
||||
"Table": [ "table1", "table2", "table3" ],
|
||||
"Column": [ "*", "tb.*", "tb.*" ]
|
||||
},
|
||||
"Delete": { // 删除
|
||||
"Table": [ "table1", "table2", "table3" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
"RoleName": "Role2",
|
||||
"Select": {
|
||||
"Table": [ "table1" ],
|
||||
"Column": [ "tb.*" ]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"Urls": "http://*:5005", // 配置默认端口
|
||||
// "https_port": 44325,
|
||||
|
||||
"AllowedHosts": "*",
|
||||
|
||||
"AppSettings": {
|
||||
"InjectSpecificationDocument": true, // 生产环境是否开启Swagger
|
||||
"ExternalAssemblies": [ "plugins" ] // 插件目录
|
||||
},
|
||||
"DynamicApiControllerSettings": {
|
||||
//"DefaultRoutePrefix": "api", // 默认路由前缀
|
||||
"CamelCaseSeparator": "", // 驼峰命名分隔符
|
||||
"SplitCamelCase": false, // 切割骆驼(驼峰)/帕斯卡命名
|
||||
"LowercaseRoute": false, // 小写路由格式
|
||||
"AsLowerCamelCase": true, // 小驼峰命名(首字母小写)
|
||||
"KeepVerb": false, // 保留动作方法请求谓词
|
||||
"KeepName": false // 保持原有名称不处理
|
||||
},
|
||||
"FriendlyExceptionSettings": {
|
||||
"DefaultErrorMessage": "系统异常,请联系管理员",
|
||||
"ThrowBah": true, // 是否将 Oops.Oh 默认抛出为业务异常
|
||||
"LogError": false // 是否输出异常日志
|
||||
},
|
||||
"LocalizationSettings": {
|
||||
"SupportedCultures": [ "zh-CN", "en" ], // 语言列表
|
||||
"DefaultCulture": "zh-CN", // 默认语言
|
||||
"DateTimeFormatCulture": "zh-CN" // 固定时间区域为特定时区(多语言)
|
||||
},
|
||||
"CorsAccessorSettings": {
|
||||
//"PolicyName": "App.Cors.Policy",
|
||||
//"WithOrigins": [ "http://localhost:5005", "https://gitee.com" ],
|
||||
"WithExposedHeaders": [ "Content-Disposition", "X-Pagination", "access-token", "x-access-token", "Access-Control-Expose-Headersx-access-token" ], // 如果前端不代理且是axios请求
|
||||
"SignalRSupport": true // 启用 SignalR 跨域支持
|
||||
},
|
||||
"SnowId": {
|
||||
"WorkerId": 1, // 机器码 全局唯一
|
||||
"WorkerIdBitLength": 6, // 机器码位长 默认值6,取值范围 [1, 19]
|
||||
"SeqBitLength": 6, // 序列数位长 默认值6,取值范围 [3, 21](建议不小于4,值越大性能越高、Id位数也更长)
|
||||
"WorkerPrefix": "adminnet_" // 缓存前缀
|
||||
},
|
||||
"Cryptogram": {
|
||||
"StrongPassword": false, // 是否开启密码强度验证
|
||||
"PasswordStrengthValidation": "(?=^.{6,16}$)(?=.*\\d)(?=.*\\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\\n).*$", // 密码强度验证正则表达式,必须须包含大小写字母、数字和特殊字符的组合,长度在6-16之间
|
||||
"PasswordStrengthValidationMsg": "密码必须包含大小写字母、数字和特殊字符的组合,长度在6-16之间", // 密码强度验证消息提示
|
||||
"CryptoType": "SM2", // 密码加密算法:MD5、SM2、SM4
|
||||
// 新业务系统记得改密匙,通过接口(http://localhost:5005/api/sysCommon/smKeyPair)获取。记得同步修改前端公钥配置:VITE_SM_PUBLIC_KEY
|
||||
"PublicKey": "04851D329AA3E38C2E7670AFE70E6E70E92F8769CA27C8766B12209A0FFBA4493B603EF7A0B9B1E16F0E8930C0406EA0B179B68DF28E25334BDEC4AE76D907E9E9", // 公钥
|
||||
"PrivateKey": "3A61D1D30C6302DABFF36201D936D0143EEF0C850AF28C5CA6D5C045AF8C5C8A" // 私钥
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"Cache": {
|
||||
"Prefix": "adminnet_", // 全局缓存前缀
|
||||
"CacheType": "Memory", // Memory、Redis
|
||||
"Redis": {
|
||||
"Configuration": "server=127.0.0.1:6379;password=;db=5;", // Redis连接字符串
|
||||
"Prefix": "adminnet_", // Redis前缀(目前没用)
|
||||
"MaxMessageSize": "1048576", // 最大消息大小 默认1024 * 1024
|
||||
"AutoDetect": false // 自动检测集群节点 阿里云的Redis分布式集群使用代理模式,需要设置为false关闭自动检测;如果不用代理地址,就配置多个节点地址并打开自动检测
|
||||
}
|
||||
},
|
||||
"Cluster": { // 集群配置
|
||||
"Enabled": false, // 启用集群:前提开启Redis缓存模式
|
||||
"ServerId": "adminnet", // 服务器标识
|
||||
"ServerIp": "", // 服务器IP
|
||||
"SignalR": {
|
||||
"RedisConfiguration": "127.0.0.1:6379,ssl=false,password=,defaultDatabase=5",
|
||||
"ChannelPrefix": "signalrPrefix_"
|
||||
},
|
||||
"DataProtecteKey": "AdminNet:DataProtection-Keys",
|
||||
"IsSentinel": false, // 是否哨兵模式
|
||||
"SentinelConfig": {
|
||||
"DefaultDb": "4",
|
||||
"EndPoints": [ // 哨兵端口
|
||||
// "10.10.0.124:26380"
|
||||
],
|
||||
"MainPrefix": "adminNet:",
|
||||
"Password": "123456",
|
||||
"SentinelPassword": "adminNet",
|
||||
"ServiceName": "adminNet",
|
||||
"SignalRChannelPrefix": "signalR:"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
// Lazy.Captcha.Core 组件详细文档(https://api.gitee.com/pojianbing/lazy-captcha/)
|
||||
"CaptchaOptions": {
|
||||
"CaptchaType": 10, // 验证码类型0、1、2、3、4、5、6、7、8、9、10、11
|
||||
"CodeLength": 1, // 验证码长度, 要放在CaptchaType设置后 当类型为算术表达式时,长度代表操作的个数, 例如2
|
||||
"ExpirySeconds": 60, // 验证码过期秒数
|
||||
"IgnoreCase": true, // 比较时是否忽略大小写
|
||||
"StoreageKeyPrefix": "", // 存储键前缀
|
||||
"ImageOption": {
|
||||
"Animation": true, // 是否启用动画
|
||||
"FontSize": 36, // 字体大小
|
||||
"Width": 150, // 验证码宽度
|
||||
"Height": 50, // 验证码高度
|
||||
"BubbleMinRadius": 5, // 气泡最小半径
|
||||
"BubbleMaxRadius": 10, // 气泡最大半径
|
||||
"BubbleCount": 3, // 气泡数量
|
||||
"BubbleThickness": 1.0, // 气泡边沿厚度
|
||||
"InterferenceLineCount": 3, // 干扰线数量
|
||||
"FontFamily": "kaiti", // 包含actionj,epilog,fresnel,headache,lexo,prefix,progbot,ransom,robot,scandal,kaiti
|
||||
"FrameDelay": 300, // 每帧延迟,Animation=true时有效, 默认300
|
||||
"BackgroundColor": "#ffffff", // 格式: rgb, rgba, rrggbb, or rrggbbaa format to match web syntax, 默认#fff
|
||||
"ForegroundColors": "", // 颜色格式同BackgroundColor,多个颜色逗号分割,随机选取。不填,空值,则使用默认颜色集
|
||||
"Quality": 100, // 图片质量(质量越高图片越大,gif调整无效可能会更大)
|
||||
"TextBold": true // 粗体
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
// 代码生成配置项-程序集名称集合
|
||||
"CodeGen": {
|
||||
"EntityAssemblyNames": [ "Admin.NET.Core", "Admin.NET.Application" ],
|
||||
"BaseEntityNames": [ "EntityTenantId", "EntityTenant", "EntityTenantBaseData", "EntityBaseData", "EntityBase", "EntityBaseId" ],
|
||||
"EntityBaseColumn": {
|
||||
"EntityTenantId": [ "Id", "TenantId" ],
|
||||
"EntityTenant": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete", "TenantId" ],
|
||||
"EntityTenantBaseData": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete", "CreateOrgId", "CreateOrgName", "TenantId" ],
|
||||
"EntityBaseData": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete", "CreateOrgId", "CreateOrgName" ],
|
||||
"EntityBase": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete" ],
|
||||
"EntityBaseId": [ "Id" ]
|
||||
//"BaseId": [ "Id" ]
|
||||
},
|
||||
"FrontRootPath": "Web", // 前端项目根目录
|
||||
"BackendApplicationNamespaces": [ "Admin.NET.Application", "Admin.NET.Application2" ] // 后端生成到的项目
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
// 详细数据库配置见SqlSugar官网(第一个为默认库),极力推荐 PostgreSQL 数据库
|
||||
// 数据库连接字符串参考地址:https://www.connectionstrings.com/
|
||||
"DbConnection": {
|
||||
"EnableConsoleSql": false, // 启用控制台打印SQL
|
||||
"ConnectionConfigs": [
|
||||
{
|
||||
//"ConfigId": "1300000000001", // 默认库标识-禁止修改
|
||||
"DbType": "Sqlite", // MySql、SqlServer、Sqlite、Oracle、PostgreSQL、Dm、Kdbndp、Oscar、MySqlConnector、Access、OpenGauss、QuestDB、HG、ClickHouse、GBase、Odbc、Custom
|
||||
"ConnectionString": "DataSource=./Admin.NET.db", // Sqlite 库连接字符串
|
||||
//"ConnectionString": "PORT=5432;DATABASE=xxx;HOST=localhost;PASSWORD=xxx;USER ID=xxx", // PostgreSQL 库连接字符串
|
||||
//"ConnectionString": "Server=localhost;Database=xxx;Uid=xxx;Pwd=xxx;SslMode=None;", // MySql 库连接字符串",
|
||||
//"ConnectionString": "User Id=xxx; Password=xxx; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)))", // Oracle 库连接字符串
|
||||
//"ConnectionString": "Server=localhost;Database=xxx;User Id=xxx;Password=xxx;", // SqlServer 库连接字符串
|
||||
|
||||
//"SlaveConnectionConfigs": [ // 读写分离/主从
|
||||
// {
|
||||
// "HitRate": 10,
|
||||
// "ConnectionString": "DataSource=./Admin.NET1.db"
|
||||
// },
|
||||
// {
|
||||
// "HitRate": 10,
|
||||
// "ConnectionString": "DataSource=./Admin.NET2.db"
|
||||
// }
|
||||
//],
|
||||
"DbSettings": {
|
||||
"EnableInitDb": true, // 启用库初始化
|
||||
"EnableDiffLog": false, // 启用库表差异日志
|
||||
"EnableUnderLine": false // 启用驼峰转下划线
|
||||
},
|
||||
"TableSettings": {
|
||||
"EnableInitTable": true, // 启用表初始化
|
||||
"EnableIncreTable": false // 启用表增量更新-特性[IncreTable]
|
||||
},
|
||||
"SeedSettings": {
|
||||
"EnableInitSeed": true, // 启用种子初始化
|
||||
"EnableIncreSeed": false // 启用种子增量更新-特性[IncreSeed]
|
||||
}
|
||||
}
|
||||
//// 日志独立数据库配置
|
||||
//{
|
||||
// "ConfigId": "1300000000002", // 日志库标识-禁止修改
|
||||
// "DbType": "Sqlite",
|
||||
// "ConnectionString": "DataSource=./Admin.NET.Log.db", // 库连接字符串
|
||||
// "DbSettings": {
|
||||
// "EnableInitDb": true, // 启用库初始化
|
||||
// "EnableDiffLog": false, // 启用库表差异日志
|
||||
// "EnableUnderLine": false // 启用驼峰转下划线
|
||||
// },
|
||||
// "TableSettings": {
|
||||
// "EnableInitTable": true, // 启用表初始化
|
||||
// "EnableIncreTable": false // 启用表增量更新-特性[IncreTable]
|
||||
// },
|
||||
// "SeedSettings": {
|
||||
// "EnableInitSeed": false, // 启用种子初始化
|
||||
// "EnableIncreSeed": false // 启用种子增量更新-特性[IncreSeed]
|
||||
// }
|
||||
//},
|
||||
//// 其他数据库配置(可以配置多个)
|
||||
//{
|
||||
// "ConfigId": "test", // 库标识
|
||||
// "DbType": "Sqlite", // 库类型
|
||||
// "ConnectionString": "DataSource=./Admin.NET.Test.db", // 库连接字符串
|
||||
// "DbSettings": {
|
||||
// "EnableInitDb": true, // 启用库初始化
|
||||
// "EnableDiffLog": false, // 启用库表差异日志
|
||||
// "EnableUnderLine": false // 启用驼峰转下划线
|
||||
// },
|
||||
// "TableSettings": {
|
||||
// "EnableInitTable": true, // 启用表初始化
|
||||
// "EnableIncreTable": false // 启用表增量更新-特性[IncreTable]
|
||||
// },
|
||||
// "SeedSettings": {
|
||||
// "EnableInitSeed": true, // 启用种子初始化
|
||||
// "EnableIncreSeed": false // 启用种子增量更新-特性[IncreSeed]
|
||||
// }
|
||||
//}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"Email": {
|
||||
"Host": "smtp.163.com", // 主机
|
||||
"Port": 465, // 端口 465、994、25
|
||||
"EnableSsl": true, // 启用SSL
|
||||
"DefaultFromEmail": "xxx@163.com", // 默认发件者邮箱
|
||||
"DefaultToEmail": "xxx@qq.com", // 默认接收人邮箱
|
||||
"UserName": "xxx@163.com", // 邮箱账号
|
||||
"Password": "", // 邮箱授权码
|
||||
"DefaultFromName": "Admin.NET 通用权限开发平台" // 默认邮件标题
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
// 枚举实体所在程序集名称集合
|
||||
"Enum": {
|
||||
"EntityAssemblyNames": [ "Admin." ]
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"EventBus": {
|
||||
"RabbitMQ": {
|
||||
"UserName": "adminnet",
|
||||
"Password": "adminnet++123456",
|
||||
"HostName": "127.0.0.1",
|
||||
"Port": 5672
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"JWTSettings": {
|
||||
"ValidateIssuerSigningKey": true, // 是否验证密钥,bool 类型,默认true
|
||||
"IssuerSigningKey": "3F025D682370B0126BBAE7A93D9B66CE3F025D682370B0126BBAE7A93D9B66CE", // 密钥,string 类型,必须是复杂密钥,长度大于16,.NET8+ 长度需大于 32,推荐MD5直接生成
|
||||
"ValidateIssuer": true, // 是否验证签发方,bool 类型,默认true
|
||||
"ValidIssuer": "Admin.NET", // 签发方,string 类型
|
||||
"ValidateAudience": true, // 是否验证签收方,bool 类型,默认true
|
||||
"ValidAudience": "Admin.NET", // 签收方,string 类型
|
||||
"ValidateLifetime": true, // 是否验证过期时间,bool 类型,默认true,建议true
|
||||
//"ExpiredTime": 20, // 过期时间,long 类型,单位分钟,默认20分钟,最大支持 13 年
|
||||
"ClockSkew": 5, // 过期时间容错值,long 类型,单位秒,默认5秒
|
||||
"Algorithm": "HS256", // 加密算法,string 类型,默认 HS256
|
||||
"RequireExpirationTime": true // 验证过期时间,设置 false 将永不过期
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
// IP限流配置
|
||||
"IpRateLimiting": {
|
||||
// 例如:设置每分钟5次访问限流
|
||||
// 当False时:每个接口都加入计数,不管你访问哪个接口,只要在一分钟内累计够5次,将禁止访问。
|
||||
// 当True 时:当一分钟请求了5次GetData接口,则该接口将在时间段内禁止访问,但是还可以访问PostData()5次,总得来说是每个接口都有5次在这一分钟,互不干扰。
|
||||
"EnableEndpointRateLimiting": true,
|
||||
// 如果StackBlockedRequests设置为false,拒绝的API调用不会添加到调用次数计数器上。比如:如果客户端每秒发出3个请求并且您设置了每秒一个调用的限制,
|
||||
// 则每分钟或每天计数器等其他限制将仅记录第一个调用,即成功的API调用。如果您希望被拒绝的API调用计入其他时间的显示(分钟,小时等),则必须设置
|
||||
"StackBlockedRequests": false,
|
||||
// 在RealIpHeader使用时,你的Kestrel服务器背后是一个反向代理,如果你的代理服务器使用不同的页眉然后提取客户端IP X-Real-IP使用此选项来设置它。
|
||||
"RealIpHeader": "X-Real-IP",
|
||||
// 将ClientIdHeader被用于提取白名单的客户端ID。如果此标头中存在客户端ID并且与ClientWhitelist中指定的值匹配,则不应用速率限制。
|
||||
"ClientIdHeader": "X-ClientId",
|
||||
// IP白名单:支持Ipv4和Ipv6
|
||||
"IpWhitelist": [],
|
||||
// 端点白名单
|
||||
"EndpointWhitelist": [],
|
||||
// 客户端白名单
|
||||
"ClientWhitelist": [],
|
||||
"QuotaExceededResponse": {
|
||||
"Content": "{{\"code\":429,\"type\":\"error\",\"message\":\"访问过于频繁,请稍后重试!禁止违法行为否则110 👮\",\"result\":null,\"extras\":null}}",
|
||||
"ContentType": "application/json",
|
||||
"StatusCode": 429
|
||||
},
|
||||
// 返回状态码
|
||||
"HttpStatusCode": 429,
|
||||
// API规则,结尾一定要带*
|
||||
"GeneralRules": [
|
||||
// 1秒钟只能调用1000次
|
||||
{
|
||||
"Endpoint": "*",
|
||||
"Period": "1s",
|
||||
"Limit": 1000
|
||||
},
|
||||
// 1分钟只能调用60000次
|
||||
{
|
||||
"Endpoint": "*",
|
||||
"Period": "1m",
|
||||
"Limit": 60000
|
||||
}
|
||||
//// 1小时只能调用3600000次
|
||||
//{
|
||||
// "Endpoint": "*",
|
||||
// "Period": "1h",
|
||||
// "Limit": 3600000
|
||||
//},
|
||||
//// 1天只能调用86400000次
|
||||
//{
|
||||
// "Endpoint": "*",
|
||||
// "Period": "1d",
|
||||
// "Limit": 86400000
|
||||
//}
|
||||
]
|
||||
},
|
||||
// IP 黑名单
|
||||
"IpRateLimitPolicies": {
|
||||
"IpRules": [
|
||||
{
|
||||
"Ip": "0.0.0.0", // IP可用:"::1/10"
|
||||
"Rules": [
|
||||
{
|
||||
"Endpoint": "*",
|
||||
"Period": "1s",
|
||||
"Limit": 0 // 设置为0就是1次都不能请求,完全屏蔽
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
// 客户端限流配置
|
||||
"ClientRateLimiting": {
|
||||
"EnableEndpointRateLimiting": true,
|
||||
"ClientIdHeader": "X-ClientId",
|
||||
"EndpointWhitelist": [],
|
||||
"ClientWhitelist": [],
|
||||
"QuotaExceededResponse": {
|
||||
"Content": "{{\"code\":429,\"type\":\"error\",\"message\":\"访问人数过多,请稍后重试!\",\"result\":null,\"extras\":null}}",
|
||||
"ContentType": "application/json",
|
||||
"StatusCode": 429
|
||||
},
|
||||
"HttpStatusCode": 429,
|
||||
"GeneralRules": [
|
||||
{
|
||||
"Endpoint": "*",
|
||||
"Period": "1s",
|
||||
"Limit": 2000
|
||||
}
|
||||
]
|
||||
},
|
||||
"ClientRateLimitPolicies": {
|
||||
"ClientRules": [
|
||||
{
|
||||
"ClientId": "",
|
||||
"Rules": [
|
||||
{
|
||||
"Endpoint": "*",
|
||||
"Period": "1s",
|
||||
"Limit": 2000
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore": "Information",
|
||||
"AspNetCoreRateLimit": "None"
|
||||
},
|
||||
"File": {
|
||||
"Enabled": false, // 启用文件日志
|
||||
"FileName": "logs/{0:yyyyMMdd}_{1}.log", // 日志文件
|
||||
"Append": true, // 追加覆盖
|
||||
// "MinimumLevel": "Information", // 日志级别
|
||||
"FileSizeLimitBytes": 10485760, // 10M=10*1024*1024
|
||||
"MaxRollingFiles": 30 // 只保留30个文件
|
||||
},
|
||||
"Database": {
|
||||
"Enabled": true, // 启用数据库日志
|
||||
"MinimumLevel": "Information"
|
||||
},
|
||||
"ElasticSearch": {
|
||||
"Enabled": false, // 启用ES日志
|
||||
"AuthType": "Basic", // ES认证类型,可选 Basic、ApiKey、Base64ApiKey
|
||||
"User": "admin", // Basic认证的用户名,使用Basic认证类型时必填
|
||||
"Password": "123456", // Basic认证的密码,使用Basic认证类型时必填
|
||||
"ApiId": "", // 使用ApiKey认证类型时必填
|
||||
"ApiKey": "", // 使用ApiKey认证类型时必填
|
||||
"Base64ApiKey": "TmtrOEszNEJuQ0NyaWlydGtROFk6SG1RZ0w3YzBTc2lCanJTYlV3aXNzZw==", // 使用Base64ApiKey认证类型时必填
|
||||
"Fingerprint": "37:08:6A:C6:06:CC:9A:43:CF:ED:25:A2:1C:A4:69:57:90:31:2C:06:CA:61:56:39:6A:9C:46:11:BD:22:51:DA", // ES使用Https时的证书指纹
|
||||
"ServerUris": [ "http://192.168.1.100:9200" ], // 地址
|
||||
"DefaultIndex": "adminnet" // 索引
|
||||
},
|
||||
"Monitor": {
|
||||
"GlobalEnabled": true, // 启用全局拦截日志
|
||||
"IncludeOfMethods": [], // 拦截特定方法,当GlobalEnabled=false有效
|
||||
"ExcludeOfMethods": [], // 排除特定方法,当GlobalEnabled=true有效
|
||||
"BahLogLevel": "Information", // Oops.Oh 和 Oops.Bah 业务日志输出级别
|
||||
"WithReturnValue": true, // 是否包含返回值,默认true
|
||||
"ReturnValueThreshold": 500, // 返回值字符串阈值,默认0全量输出
|
||||
"JsonBehavior": "None", // 是否输出Json,默认None(OnlyJson、All)
|
||||
"JsonIndented": false, // 是否格式化Json
|
||||
"UseUtcTimestamp": false, // 时间格式UTC、LOCAL
|
||||
"ConsoleLog": true // 是否显示控制台日志
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"OAuth": {
|
||||
"Weixin": {
|
||||
"ClientId": "xxx",
|
||||
"ClientSecret": "xxx"
|
||||
},
|
||||
"Gitee": {
|
||||
"ClientId": "xxx",
|
||||
"ClientSecret": "xxx"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"SMS": {
|
||||
"Aliyun": {
|
||||
"AccessKeyId": "",
|
||||
"AccessKeySecret": "",
|
||||
"Templates": [
|
||||
{
|
||||
"Id": "0",
|
||||
"SignName": "AdminNET 平台",
|
||||
"TemplateCode": "SMS_291005708",
|
||||
"Content": "您的验证码为:${code},请勿泄露于他人!"
|
||||
},
|
||||
{
|
||||
"Id": "1",
|
||||
"SignName": "AdminNET 平台",
|
||||
"TemplateCode": "SMS_462801755",
|
||||
"Content": "注册成功,感谢您的注册,请妥善保管您的账户信息"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Tencentyun": {
|
||||
"SdkAppId": "",
|
||||
"AccessKeyId": "",
|
||||
"AccessKeySecret": "",
|
||||
"Templates": [
|
||||
{
|
||||
"Id": "0",
|
||||
"SignName": "AdminNET 平台",
|
||||
"TemplateCode": "",
|
||||
"Content": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"SpecificationDocumentSettings": {
|
||||
"DocumentTitle": "Admin.NET 通用权限开发平台",
|
||||
"GroupOpenApiInfos": [
|
||||
{
|
||||
"Group": "Default",
|
||||
"Title": "Admin.NET 通用权限开发平台",
|
||||
"Description": "让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。",
|
||||
"Version": "1.0.0",
|
||||
"Order": 1000
|
||||
},
|
||||
{
|
||||
"Group": "All Groups",
|
||||
"Title": "所有接口",
|
||||
"Description": "让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。",
|
||||
"Version": "1.0.0",
|
||||
"Order": 0
|
||||
}
|
||||
],
|
||||
"DefaultGroupName": "Default", // 默认分组名
|
||||
"DocExpansionState": "List", // List、Full、None
|
||||
"EnableAllGroups": true,
|
||||
"LoginInfo": {
|
||||
"Enabled": true, // 是否开启Swagger登录
|
||||
"CheckUrl": "/api/swagger/checkUrl",
|
||||
"SubmitUrl": "/api/swagger/submitUrl"
|
||||
},
|
||||
"EnumToNumber": true // 枚举类型生成值类型
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"Upload": {
|
||||
"Path": "upload/{yyyy}/{MM}/{dd}", // 文件上传目录
|
||||
"MaxSize": 51200, // 文件最大限制KB:1024*50
|
||||
"ContentType": [ "image/jpg", "image/png", "image/jpeg", "image/gif", "image/bmp", "text/plain", "application/pdf", "application/msword", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "video/mp4", "application/wps-office.docx", "application/wps-office.xlsx", "application/wps-office.pptx", "application/vnd.android.package-archive" ],
|
||||
"EnableMd5": false // 启用文件MDF5验证-防止重复上传
|
||||
},
|
||||
"OSSProvider": {
|
||||
"IsEnable": false,
|
||||
"Provider": "Minio", // OSS提供者 Invalid/Minio/Aliyun/QCloud/Qiniu/HuaweiCloud
|
||||
"Endpoint": "xxx.xxx.xxx.xxx:8090", // 节点/API地址(在腾讯云OSS中表示AppId)
|
||||
"Region": "xxx.xxx.xxx.xxx", // 地域
|
||||
"AccessKey": "",
|
||||
"SecretKey": "",
|
||||
"IsEnableHttps": false, // 是否启用HTTPS
|
||||
"IsEnableCache": true, // 是否启用缓存
|
||||
"Bucket": "admin.net",
|
||||
"CustomHost": "" // 自定义Host:拼接外链的Host,若空则使用Endpoint拼接
|
||||
},
|
||||
"SSHProvider": {
|
||||
"IsEnable": false,
|
||||
"Host": "127.0.0.1",
|
||||
"Port": 8222,
|
||||
"Username": "sshuser",
|
||||
"Password": "Password.1"
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
|
||||
"Wechat": {
|
||||
// 公众号
|
||||
"WechatAppId": "",
|
||||
"WechatAppSecret": "",
|
||||
"WechatToken": "", // 微信公众号服务器配置中的令牌(Token)
|
||||
"WechatEncodingAESKey": "", // 微信公众号服务器配置中的消息加解密密钥(EncodingAESKey)
|
||||
// 小程序
|
||||
"WxOpenAppId": "",
|
||||
"WxOpenAppSecret": "",
|
||||
"WxToken": "", // 小程序消息推送中的令牌(Token)
|
||||
"WxEncodingAESKey": "", // 小程序消息推送中的消息加解密密钥(EncodingAESKey)
|
||||
"QRImagePath": "" //小程序生成带参数二维码保存位置(绝对路径 eg: D:\\Web\\wwwroot\\upload\\QRImage)
|
||||
},
|
||||
// 微信支付
|
||||
"WechatPay": {
|
||||
"AppId": "", // 微信公众平台AppId、开放平台AppId、小程序AppId、企业微信CorpId
|
||||
"MerchantId": "", // 商户平台的商户号
|
||||
"MerchantV3Secret": "", // 商户平台的APIv3密钥
|
||||
"MerchantCertificateSerialNumber": "", // 商户平台的证书序列号
|
||||
"MerchantCertificatePrivateKey": "\\WxPayCert\\apiclient_key.pem" // 商户平台的API证书私钥(apiclient_key.pem文件内容)
|
||||
},
|
||||
// 支付回调
|
||||
"PayCallBack": {
|
||||
"WechatPayUrl": "https://xxx/api/sysWechatPay/payCallBack", // 微信支付回调
|
||||
"WechatRefundUrl": "", // 微信退款回调
|
||||
"AlipayUrl": "", // 支付宝支付回调
|
||||
"AlipayRefundUrl": "" // 支付宝退款回调
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 移动端Claim相关常量
|
||||
/// </summary>
|
||||
public class AppClaimConst : ClaimConst
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 业务应用相关常量
|
||||
/// </summary>
|
||||
public class ApplicationConst
|
||||
{
|
||||
/// <summary>
|
||||
/// API分组名称
|
||||
/// </summary>
|
||||
public const string GroupName = "xxx业务应用";
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
global using Admin.NET.Core;
|
||||
global using Furion;
|
||||
global using Furion.DependencyInjection;
|
||||
global using Furion.DynamicApiController;
|
||||
global using Furion.FriendlyException;
|
||||
global using Mapster;
|
||||
global using Microsoft.AspNetCore.Authorization;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.Extensions.DependencyInjection;
|
||||
global using SqlSugar;
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.ComponentModel;
|
||||
global using System.ComponentModel.DataAnnotations;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Linq;
|
@ -0,0 +1,28 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
|
||||
///// <summary>
|
||||
///// 示例开放接口
|
||||
///// </summary>
|
||||
//[ApiDescriptionSettings("开放接口", Name = "Demo", Order = 100)]
|
||||
//[Authorize(AuthenticationSchemes = SignatureAuthenticationDefaults.AuthenticationScheme)]
|
||||
//public class DemoOpenApi : IDynamicApiController
|
||||
//{
|
||||
// private readonly UserManager _userManager;
|
||||
|
||||
// public DemoOpenApi(UserManager userManager)
|
||||
// {
|
||||
// _userManager = userManager;
|
||||
// }
|
||||
|
||||
// [HttpGet("helloWord")]
|
||||
// public Task<string> HelloWord()
|
||||
// {
|
||||
// return Task.FromResult($"Hello word. {_userManager.Account}");
|
||||
// }
|
||||
//}
|
@ -0,0 +1,319 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using Admin.NET.Core.Service;
|
||||
using Furion.DataEncryption;
|
||||
using Furion.DataValidation;
|
||||
using Lazy.Captcha.Core;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
namespace Admin.NET.Application.Service.App;
|
||||
|
||||
/// <summary>
|
||||
/// 移动应用服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(ApplicationConst.GroupName, Order = 500, Description = "移动应用")]
|
||||
public class AppAuthService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly AppUserManager _appUserManager;
|
||||
private readonly SqlSugarRepository<SysUser> _sysUserRep;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly SysRoleService _sysRoleService;
|
||||
private readonly SysOnlineUserService _sysOnlineUserService;
|
||||
private readonly SysConfigService _sysConfigService;
|
||||
private readonly ICaptcha _captcha;
|
||||
private readonly SysCacheService _sysCacheService;
|
||||
|
||||
public AppAuthService(AppUserManager appUserManager,
|
||||
SqlSugarRepository<SysUser> sysUserRep,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
SysRoleService sysRoleService,
|
||||
SysOnlineUserService sysOnlineUserService,
|
||||
SysConfigService sysConfigService,
|
||||
ICaptcha captcha,
|
||||
SysCacheService sysCacheService)
|
||||
{
|
||||
_appUserManager = appUserManager;
|
||||
_sysUserRep = sysUserRep;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_sysRoleService = sysRoleService;
|
||||
_sysOnlineUserService = sysOnlineUserService;
|
||||
_sysConfigService = sysConfigService;
|
||||
_captcha = captcha;
|
||||
_sysCacheService = sysCacheService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 账号密码登录 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[DisplayName("账号密码登录")]
|
||||
public virtual async Task<LoginOutput> Login([Required] LoginInput input)
|
||||
{
|
||||
// 判断密码错误次数(缓存30分钟)
|
||||
var keyPasswordErrorTimes = $"{CacheConst.KeyPasswordErrorTimes}{input.Account}";
|
||||
var passwordErrorTimes = _sysCacheService.Get<int>(keyPasswordErrorTimes);
|
||||
var passwdMaxErrorTimes = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysPasswordMaxErrorTimes);
|
||||
if (passwordErrorTimes >= passwdMaxErrorTimes)
|
||||
throw Oops.Oh(ErrorCodeEnum.D1027);
|
||||
|
||||
// 是否开启验证码
|
||||
if (await _sysConfigService.GetConfigValueByCode<bool>(ConfigConst.SysCaptcha))
|
||||
{
|
||||
// 判断验证码
|
||||
if (!_captcha.Validate(input.CodeId.ToString(), input.Code))
|
||||
throw Oops.Oh(ErrorCodeEnum.D0008);
|
||||
}
|
||||
|
||||
// 账号是否存在
|
||||
var user = await _sysUserRep.AsQueryable().Includes(t => t.SysOrg).ClearFilter().FirstAsync(u => u.Account.Equals(input.Account));
|
||||
_ = user ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
||||
|
||||
// 账号是否被冻结
|
||||
if (user.Status == StatusEnum.Disable)
|
||||
throw Oops.Oh(ErrorCodeEnum.D1017);
|
||||
|
||||
// 租户是否被禁用
|
||||
var tenant = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysTenant>>().GetByIdAsync(user.TenantId);
|
||||
if (tenant != null && tenant.Status == StatusEnum.Disable)
|
||||
throw Oops.Oh(ErrorCodeEnum.Z1003);
|
||||
|
||||
// 国密SM2解密(前端密码传输SM2加密后的)
|
||||
try
|
||||
{
|
||||
input.Password = CryptogramUtil.SM2Decrypt(input.Password);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw Oops.Oh(ErrorCodeEnum.D0010);
|
||||
}
|
||||
|
||||
VerifyPassword(input, keyPasswordErrorTimes, passwordErrorTimes, user);
|
||||
|
||||
// 登录成功则清空密码错误次数
|
||||
_sysCacheService.Remove(keyPasswordErrorTimes);
|
||||
|
||||
return await CreateToken(user, input.LoginMode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证用户密码
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="keyErrorPasswordCount"></param>
|
||||
/// <param name="errorPasswordCount"></param>
|
||||
/// <param name="user"></param>
|
||||
private void VerifyPassword(LoginInput input, string keyErrorPasswordCount, int errorPasswordCount, SysUser user)
|
||||
{
|
||||
if (CryptogramUtil.CryptoType == CryptogramEnum.MD5.ToString())
|
||||
{
|
||||
if (!user.Password.Equals(MD5Encryption.Encrypt(input.Password)))
|
||||
{
|
||||
_sysCacheService.Set(keyErrorPasswordCount, ++errorPasswordCount, TimeSpan.FromMinutes(30));
|
||||
throw Oops.Oh(ErrorCodeEnum.D1000);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!CryptogramUtil.Decrypt(user.Password).Equals(input.Password))
|
||||
{
|
||||
_sysCacheService.Set(keyErrorPasswordCount, ++errorPasswordCount, TimeSpan.FromMinutes(30));
|
||||
throw Oops.Oh(ErrorCodeEnum.D1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 手机号登录 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[DisplayName("手机号登录")]
|
||||
public virtual async Task<LoginOutput> LoginPhone([Required] LoginPhoneInput input)
|
||||
{
|
||||
var verifyCode = _sysCacheService.Get<string>($"{CacheConst.KeyPhoneVerCode}{input.Phone}");
|
||||
if (string.IsNullOrWhiteSpace(verifyCode))
|
||||
throw Oops.Oh("验证码不存在或已失效,请重新获取!");
|
||||
if (verifyCode != input.Code)
|
||||
throw Oops.Oh("验证码错误!");
|
||||
|
||||
// 账号是否存在
|
||||
var user = await _sysUserRep.AsQueryable().Includes(t => t.SysOrg).ClearFilter().FirstAsync(u => u.Phone.Equals(input.Phone));
|
||||
_ = user ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
||||
|
||||
return await CreateToken(user, input.LoginMode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成Token令牌 🔖
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="loginMode"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public virtual async Task<LoginOutput> CreateToken(SysUser user, LoginModeEnum loginMode)
|
||||
{
|
||||
// 默认PC端登录模式
|
||||
if (loginMode == 0)
|
||||
loginMode = LoginModeEnum.PC;
|
||||
|
||||
// 单用户登录
|
||||
await _sysOnlineUserService.SingleLogin(user.Id, loginMode);
|
||||
|
||||
// 生成Token令牌
|
||||
var tokenExpire = await _sysConfigService.GetTokenExpire();
|
||||
var accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>
|
||||
{
|
||||
{ AppClaimConst.UserId, user.Id },
|
||||
{ AppClaimConst.TenantId, user.TenantId },
|
||||
{ AppClaimConst.Account, user.Account },
|
||||
{ AppClaimConst.RealName, user.RealName },
|
||||
{ AppClaimConst.AccountType, user.AccountType },
|
||||
{ AppClaimConst.OrgId, user.OrgId },
|
||||
{ AppClaimConst.OrgName, user.SysOrg?.Name },
|
||||
{ AppClaimConst.OrgType, user.SysOrg?.Type },
|
||||
{ ClaimConst.LoginMode, loginMode },
|
||||
}, tokenExpire);
|
||||
|
||||
// 生成刷新Token令牌
|
||||
var refreshTokenExpire = await _sysConfigService.GetRefreshTokenExpire();
|
||||
var refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, refreshTokenExpire);
|
||||
|
||||
// 设置响应报文头
|
||||
_httpContextAccessor.HttpContext.SetTokensOfResponseHeaders(accessToken, refreshToken);
|
||||
|
||||
// Swagger Knife4UI-AfterScript登录脚本
|
||||
// ke.global.setAllHeader('Authorization', 'Bearer ' + ke.response.headers['access-token']);
|
||||
|
||||
return new LoginOutput
|
||||
{
|
||||
AccessToken = accessToken,
|
||||
RefreshToken = refreshToken
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取登录账号 🔖
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取登录账号")]
|
||||
public virtual async Task<LoginUserOutput> GetUserInfo()
|
||||
{
|
||||
var user = await _sysUserRep.GetByIdAsync(_appUserManager.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D1011).StatusCode(401);
|
||||
// 机构
|
||||
var org = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysOrg>>().GetByIdAsync(user.OrgId);
|
||||
// 职位
|
||||
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetByIdAsync(user.PosId);
|
||||
// 角色集合
|
||||
var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable().Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync();
|
||||
// 接口集合
|
||||
var apis = (await _sysRoleService.GetUserApiList())[0];
|
||||
|
||||
return new LoginUserOutput
|
||||
{
|
||||
Id = user.Id,
|
||||
Account = user.Account,
|
||||
RealName = user.RealName,
|
||||
Phone = user.Phone,
|
||||
IdCardNum = user.IdCardNum,
|
||||
Email = user.Email,
|
||||
AccountType = user.AccountType,
|
||||
Avatar = user.Avatar,
|
||||
Address = user.Address,
|
||||
Signature = user.Signature,
|
||||
OrgId = user.OrgId,
|
||||
OrgName = org?.Name,
|
||||
OrgType = org?.Type,
|
||||
PosName = pos?.Name,
|
||||
Apis = apis,
|
||||
RoleIds = roleIds
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取刷新Token 🔖
|
||||
/// </summary>
|
||||
/// <param name="accessToken"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取刷新Token")]
|
||||
public virtual string GetRefreshToken([FromQuery] string accessToken)
|
||||
{
|
||||
var refreshTokenExpire = _sysConfigService.GetRefreshTokenExpire().GetAwaiter().GetResult();
|
||||
return JWTEncryption.GenerateRefreshToken(accessToken, refreshTokenExpire);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退出系统 🔖
|
||||
/// </summary>
|
||||
[DisplayName("退出系统")]
|
||||
public void Logout()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_appUserManager.Account))
|
||||
throw Oops.Oh(ErrorCodeEnum.D1011);
|
||||
|
||||
_httpContextAccessor.HttpContext.SignoutToSwagger();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取验证码 🔖
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[SuppressMonitor]
|
||||
[DisplayName("获取验证码")]
|
||||
public dynamic GetCaptcha()
|
||||
{
|
||||
var codeId = YitIdHelper.NextId().ToString();
|
||||
var captcha = _captcha.Generate(codeId);
|
||||
return new { Id = codeId, Img = captcha.Base64 };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户密码
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("修改用户密码")]
|
||||
public async Task<int> ChangePwd(ChangePwdInput input)
|
||||
{
|
||||
// 国密SM2解密(前端密码传输SM2加密后的)
|
||||
input.PasswordOld = CryptogramUtil.SM2Decrypt(input.PasswordOld);
|
||||
input.PasswordNew = CryptogramUtil.SM2Decrypt(input.PasswordNew);
|
||||
|
||||
var user = await _sysUserRep.GetByIdAsync(_appUserManager.UserId) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
||||
if (CryptogramUtil.CryptoType == CryptogramEnum.MD5.ToString())
|
||||
{
|
||||
if (user.Password != MD5Encryption.Encrypt(input.PasswordOld))
|
||||
throw Oops.Oh(ErrorCodeEnum.D1004);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CryptogramUtil.Decrypt(user.Password) != input.PasswordOld)
|
||||
throw Oops.Oh(ErrorCodeEnum.D1004);
|
||||
}
|
||||
|
||||
if (input.PasswordOld == input.PasswordNew)
|
||||
throw Oops.Oh(ErrorCodeEnum.D1028);
|
||||
|
||||
// 验证密码强度
|
||||
if (CryptogramUtil.StrongPassword)
|
||||
{
|
||||
user.Password = input.PasswordNew.TryValidate(CryptogramUtil.PasswordStrengthValidation)
|
||||
? CryptogramUtil.Encrypt(input.PasswordNew)
|
||||
: throw Oops.Oh(CryptogramUtil.PasswordStrengthValidationMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
user.Password = CryptogramUtil.Encrypt(input.PasswordNew);
|
||||
}
|
||||
|
||||
return await _sysUserRep.AsUpdateable(user).UpdateColumns(u => u.Password).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Admin.NET.Application.Service.App;
|
||||
|
||||
public class AppUserManager : UserManager
|
||||
{
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public AppUserManager(IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor)
|
||||
{
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
// 扩展属性
|
||||
|
||||
}
|
22
admin.net.pro/Admin.NET/Admin.NET.Application/Startup.cs
Normal file
22
admin.net.pro/Admin.NET/Admin.NET.Application/Startup.cs
Normal file
@ -0,0 +1,22 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace Admin.NET.Application;
|
||||
|
||||
[AppStartup(100)]
|
||||
public class Startup : AppStartup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
}
|
||||
}
|
70
admin.net.pro/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj
Normal file
70
admin.net.pro/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj
Normal file
@ -0,0 +1,70 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
|
||||
<NoWarn>1701;1702;1591;8632</NoWarn>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<Nullable>disable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<Copyright>Admin.NET</Copyright>
|
||||
<Description>Admin.NET 通用权限开发平台</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.0.0" />
|
||||
<PackageReference Include="AngleSharp" Version="1.1.2" />
|
||||
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.15.6" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.7" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.7" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.5.7" />
|
||||
<PackageReference Include="Hardware.Info" Version="100.1.1" />
|
||||
<PackageReference Include="Hashids.net" Version="1.7.0" />
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
<PackageReference Include="IPTools.International" Version="1.6.0" />
|
||||
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.5.2" />
|
||||
<PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.2" />
|
||||
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.2" />
|
||||
<PackageReference Include="MailKit" Version="4.7.1.1" />
|
||||
<PackageReference Include="MySqlBackup.NET.MySqlConnector" Version="2.3.8" />
|
||||
<PackageReference Include="NewLife.Redis" Version="5.7.2024.801" />
|
||||
<PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" />
|
||||
<PackageReference Include="PluginCore.AspNetCore" Version="1.4.3" />
|
||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
|
||||
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" />
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.5.0" />
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.7.0" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.167" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.1.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.5" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1082" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
|
||||
<PackageReference Include="AspNet.Security.OAuth.Gitee" Version="6.0.15" />
|
||||
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" />
|
||||
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.33" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="6.0.33" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.33" />
|
||||
<PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.1.9" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
|
||||
<PackageReference Include="AspNet.Security.OAuth.Gitee" Version="8.1.0" />
|
||||
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="8.1.0" />
|
||||
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.8" />
|
||||
<PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,22 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 常量特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
|
||||
public class ConstAttribute : Attribute
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public ConstAttribute(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 自定义规范化结果特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
|
||||
public class CustomUnifyResultAttribute : Attribute
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public CustomUnifyResultAttribute(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 字典值合规性校验特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = true)]
|
||||
public class DictAttribute : ValidationAttribute, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典值合规性校验特性
|
||||
/// </summary>
|
||||
/// <param name="dictTypeCode"></param>
|
||||
/// <param name="errorMessage"></param>
|
||||
public DictAttribute(string dictTypeCode, string errorMessage = "字典值不合法!")
|
||||
{
|
||||
DictTypeCode = dictTypeCode;
|
||||
ErrorMessage = errorMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 字典值合规性校验
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="validationContext"></param>
|
||||
/// <returns></returns>
|
||||
protected override ValidationResult IsValid(object? value, ValidationContext validationContext)
|
||||
{
|
||||
var valueAsString = value?.ToString();
|
||||
|
||||
// 判断是否允许空值
|
||||
if (AllowNullValue && value == null) return ValidationResult.Success;
|
||||
|
||||
// 是否忽略空字符串
|
||||
if (AllowEmptyStrings && string.IsNullOrEmpty(valueAsString)) return ValidationResult.Success;
|
||||
|
||||
var sysDictDataServiceProvider = App.GetRequiredService<SysDictDataService>();
|
||||
var dictDataList = sysDictDataServiceProvider.GetDataList(DictTypeCode).Result;
|
||||
|
||||
// 使用HashSet来提高查找效率
|
||||
var dictCodes = new HashSet<string>(dictDataList.Select(u => u.Code));
|
||||
|
||||
if (!dictCodes.Contains(valueAsString))
|
||||
return new ValidationResult($"提示:{ErrorMessage}|字典【{DictTypeCode}】不包含【{valueAsString}】!");
|
||||
else
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 字典编码
|
||||
/// </summary>
|
||||
public string DictTypeCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否允许空字符串
|
||||
/// </summary>
|
||||
public bool AllowEmptyStrings { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 允许空值,有值才验证,默认 false
|
||||
/// </summary>
|
||||
public bool AllowNullValue { get; set; } = false;
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 防止重复请求过滤器特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
|
||||
public class IdempotentAttribute : Attribute, IAsyncActionFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求间隔时间/秒
|
||||
/// </summary>
|
||||
public int IntervalTime { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// 错误提示内容
|
||||
/// </summary>
|
||||
public string Message { get; set; } = "你操作频率过快,请稍后重试!";
|
||||
|
||||
/// <summary>
|
||||
/// 缓存前缀: Key+请求路由+用户Id+请求参数
|
||||
/// </summary>
|
||||
public string CacheKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否直接抛出异常:Ture是,False返回上次请求结果
|
||||
/// </summary>
|
||||
public bool ThrowBah { get; set; }
|
||||
|
||||
public IdempotentAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
||||
{
|
||||
var httpContext = context.HttpContext;
|
||||
var path = httpContext.Request.Path.Value.ToString();
|
||||
var userId = httpContext.User?.FindFirstValue(ClaimConst.UserId);
|
||||
var cacheExpireTime = TimeSpan.FromSeconds(IntervalTime);
|
||||
|
||||
var parameters = "";
|
||||
foreach (var parameter in context.ActionDescriptor.Parameters)
|
||||
{
|
||||
parameters += parameter.Name;
|
||||
parameters += context.ActionArguments[parameter.Name].ToJson();
|
||||
}
|
||||
|
||||
var cacheKey = MD5Encryption.Encrypt($"{CacheKey}{path}{userId}{parameters}");
|
||||
var sysCacheService = App.GetRequiredService<SysCacheService>();
|
||||
if (sysCacheService.ExistKey(cacheKey))
|
||||
{
|
||||
if (ThrowBah) throw Oops.Oh(Message);
|
||||
|
||||
try
|
||||
{
|
||||
var cachedResult = sysCacheService.Get<ResponseData>(cacheKey);
|
||||
context.Result = new ObjectResult(cachedResult.Value);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw Oops.Oh($"{Message}-{ex}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 先加入一个空缓存,防止第一次请求结果没回来导致连续请求
|
||||
sysCacheService.Set(cacheKey, "", cacheExpireTime);
|
||||
var resultContext = await next();
|
||||
if (resultContext.Result is ObjectResult objectResult)
|
||||
{
|
||||
var valueType = objectResult.Value.GetType();
|
||||
var responseData = new ResponseData
|
||||
{
|
||||
Type = valueType.Name,
|
||||
Value = objectResult.Value
|
||||
};
|
||||
sysCacheService.Set(cacheKey, responseData, cacheExpireTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 请求结果数据
|
||||
/// </summary>
|
||||
private class ResponseData
|
||||
{
|
||||
/// <summary>
|
||||
/// 结果类型
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求结果
|
||||
/// </summary>
|
||||
public dynamic Value { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 忽略表结构初始化特性(标记在实体)
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class IgnoreTableAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 忽略更新种子特性(标记在种子类)
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class IgnoreUpdateSeedAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 忽略更新种子列特性(标记在实体属性)
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
|
||||
public class IgnoreUpdateSeedColumnAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 属性字典配置
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class ImportDictAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典Code
|
||||
/// </summary>
|
||||
public string TypeCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 目标对象名称
|
||||
/// </summary>
|
||||
public string TargetPropName { get; set; }
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 增量种子特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class IncreSeedAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 增量表特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class IncreTableAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 日志表特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class LogTableAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 字符串掩码
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class MaskNewtonsoftJsonConverter : JsonConverter<string>
|
||||
{
|
||||
public override string ReadJson(JsonReader reader, Type objectType, string existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
return reader.Value.ToString();
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, string value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteValue(value?.ToString().Mask());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 身份证掩码
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class MaskIdCardNewtonsoftJsonConverter : JsonConverter<string>
|
||||
{
|
||||
public override string ReadJson(JsonReader reader, Type objectType, string existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
return reader.Value.ToString();
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, string value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteValue(value?.ToString().MaskIdCard());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱掩码
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class MaskEmailNewtonsoftJsonConverter : JsonConverter<string>
|
||||
{
|
||||
public override string ReadJson(JsonReader reader, Type objectType, string existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
return reader.Value.ToString();
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, string value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteValue(value?.ToString().MaskEmail());
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 字符串掩码
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class MaskSystemTextJsonConverter : JsonConverter<string>
|
||||
{
|
||||
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
return reader.GetString();
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
|
||||
{
|
||||
writer.WriteStringValue(value?.ToString().Mask());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 身份证掩码
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class MaskIdCardSystemTextJsonConverter : JsonConverter<string>
|
||||
{
|
||||
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
return reader.GetString();
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
|
||||
{
|
||||
writer.WriteStringValue(value?.ToString().MaskIdCard());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱掩码
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class MaskEmailSystemTextJsonConverter : JsonConverter<string>
|
||||
{
|
||||
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
return reader.GetString();
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
|
||||
{
|
||||
writer.WriteStringValue(value?.ToString().MaskEmail());
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 最大值校验
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class MaxValueAttribute : ValidationAttribute
|
||||
{
|
||||
private double MaxValue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大值
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public MaxValueAttribute(double value) => this.MaxValue = value;
|
||||
|
||||
/// <summary>
|
||||
/// 最大值校验
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public override bool IsValid(object value)
|
||||
{
|
||||
return value == null || Convert.ToDouble(value) <= this.MaxValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public override string FormatErrorMessage(string name) => base.FormatErrorMessage(name);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 最小值校验
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class MinValueAttribute : ValidationAttribute
|
||||
{
|
||||
private double MinValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最小值
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public MinValueAttribute(double value) => this.MinValue = value;
|
||||
|
||||
/// <summary>
|
||||
/// 最小值校验
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public override bool IsValid(object value)
|
||||
{
|
||||
return value == null || Convert.ToDouble(value) > this.MinValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public override string FormatErrorMessage(string name) => base.FormatErrorMessage(name);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 校验集合不能为空
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class NotEmptyAttribute : ValidationAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 校验集合不能为空
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public override bool IsValid(object value) => (value as IEnumerable)?.GetEnumerator().MoveNext() ?? false;
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public override string FormatErrorMessage(string name) => base.FormatErrorMessage(name);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 所属机构数据权限
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
|
||||
public class OwnerOrgAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 所属用户数据权限
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
|
||||
public class OwnerUserAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 种子数据特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class SeedDataAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 排序(越大越后执行)
|
||||
/// </summary>
|
||||
public int Order { get; set; } = 0;
|
||||
|
||||
public SeedDataAttribute(int orderNo)
|
||||
{
|
||||
Order = orderNo;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统表特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class SysTableAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 租户种子数据特性
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class TenantSeedAttribute : Attribute
|
||||
{
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 枚举拓展主题样式
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field)]
|
||||
public class ThemeAttribute : Attribute
|
||||
{
|
||||
public string Theme { get; private set; }
|
||||
|
||||
public ThemeAttribute(string theme)
|
||||
{
|
||||
this.Theme = theme;
|
||||
}
|
||||
}
|
41
admin.net.pro/Admin.NET/Admin.NET.Core/Cache/CacheSetup.cs
Normal file
41
admin.net.pro/Admin.NET/Admin.NET.Core/Cache/CacheSetup.cs
Normal file
@ -0,0 +1,41 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using NewLife.Caching.Services;
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
public static class CacheSetup
|
||||
{
|
||||
/// <summary>
|
||||
/// 缓存注册(新生命Redis组件)
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
public static void AddCache(this IServiceCollection services)
|
||||
{
|
||||
var cacheOptions = App.GetConfig<CacheOptions>("Cache", true);
|
||||
if (cacheOptions.CacheType == CacheTypeEnum.Redis.ToString())
|
||||
{
|
||||
var redis = new FullRedis(new RedisOptions
|
||||
{
|
||||
Configuration = cacheOptions.Redis.Configuration,
|
||||
Prefix = cacheOptions.Redis.Prefix
|
||||
});
|
||||
// 自动检测集群节点
|
||||
redis.AutoDetect = App.GetConfig<bool>("Cache:Redis:AutoDetect", true);
|
||||
// 最大消息大小
|
||||
if (cacheOptions.Redis.MaxMessageSize > 0)
|
||||
redis.MaxMessageSize = cacheOptions.Redis.MaxMessageSize;
|
||||
|
||||
// 注入 Redis 缓存提供者
|
||||
services.AddSingleton<ICacheProvider>(p => new RedisCacheProvider(p) { Cache = redis });
|
||||
}
|
||||
|
||||
// 内存缓存兜底。在没有配置Redis时,使用内存缓存,逻辑代码无需修改
|
||||
services.TryAddSingleton<ICacheProvider, CacheProvider>();
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// SqlSugar二级缓存
|
||||
/// </summary>
|
||||
public class SqlSugarCache : ICacheService
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统缓存服务
|
||||
/// </summary>
|
||||
private static readonly SysCacheService _cache = App.GetRequiredService<SysCacheService>();
|
||||
|
||||
public void Add<V>(string key, V value)
|
||||
{
|
||||
_cache.Set($"{CacheConst.SqlSugar}{key}", value);
|
||||
}
|
||||
|
||||
public void Add<V>(string key, V value, int cacheDurationInSeconds)
|
||||
{
|
||||
_cache.Set($"{CacheConst.SqlSugar}{key}", value, TimeSpan.FromSeconds(cacheDurationInSeconds));
|
||||
}
|
||||
|
||||
public bool ContainsKey<V>(string key)
|
||||
{
|
||||
return _cache.ExistKey($"{CacheConst.SqlSugar}{key}");
|
||||
}
|
||||
|
||||
public V Get<V>(string key)
|
||||
{
|
||||
return _cache.Get<V>($"{CacheConst.SqlSugar}{key}");
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllKey<V>()
|
||||
{
|
||||
return _cache.GetKeysByPrefixKey(CacheConst.SqlSugar);
|
||||
}
|
||||
|
||||
public V GetOrCreate<V>(string key, Func<V> create, int cacheDurationInSeconds = int.MaxValue)
|
||||
{
|
||||
return _cache.GetOrAdd<V>($"{CacheConst.SqlSugar}{key}", (cacheKey) =>
|
||||
{
|
||||
return create();
|
||||
}, cacheDurationInSeconds);
|
||||
}
|
||||
|
||||
public void Remove<V>(string key)
|
||||
{
|
||||
_cache.Remove(key); // SqlSugar调用Remove方法时,key中已包含了CacheConst.SqlSugar前缀
|
||||
}
|
||||
}
|
98
admin.net.pro/Admin.NET/Admin.NET.Core/Const/CacheConst.cs
Normal file
98
admin.net.pro/Admin.NET/Admin.NET.Core/Const/CacheConst.cs
Normal file
@ -0,0 +1,98 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 缓存相关常量
|
||||
/// </summary>
|
||||
public class CacheConst
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户接口缓存(接口集合)
|
||||
/// </summary>
|
||||
public const string KeyUserApi = "sys_user_api:";
|
||||
|
||||
/// <summary>
|
||||
/// 用户机构缓存
|
||||
/// </summary>
|
||||
public const string KeyUserOrg = "sys_user_org:";
|
||||
|
||||
/// <summary>
|
||||
/// 角色最大数据范围缓存
|
||||
/// </summary>
|
||||
public const string KeyRoleMaxDataScope = "sys_role_maxDataScope:";
|
||||
|
||||
/// <summary>
|
||||
/// 在线用户缓存
|
||||
/// </summary>
|
||||
public const string KeyUserOnline = "sys_user_online:";
|
||||
|
||||
/// <summary>
|
||||
/// 图形验证码缓存
|
||||
/// </summary>
|
||||
public const string KeyVerCode = "sys_verCode:";
|
||||
|
||||
/// <summary>
|
||||
/// 手机验证码缓存
|
||||
/// </summary>
|
||||
public const string KeyPhoneVerCode = "sys_phoneVerCode:";
|
||||
|
||||
/// <summary>
|
||||
/// 密码错误次数缓存
|
||||
/// </summary>
|
||||
public const string KeyPasswordErrorTimes = "sys_password_error_times:";
|
||||
|
||||
/// <summary>
|
||||
/// 租户缓存
|
||||
/// </summary>
|
||||
public const string KeyTenant = "sys_tenant";
|
||||
|
||||
/// <summary>
|
||||
/// 常量下拉框
|
||||
/// </summary>
|
||||
public const string KeyConst = "sys_const:";
|
||||
|
||||
/// <summary>
|
||||
/// 所有缓存关键字集合
|
||||
/// </summary>
|
||||
public const string KeyAll = "sys_keys";
|
||||
|
||||
/// <summary>
|
||||
/// SqlSugar二级缓存
|
||||
/// </summary>
|
||||
public const string SqlSugar = "sys_sqlSugar:";
|
||||
|
||||
/// <summary>
|
||||
/// 开放接口身份缓存
|
||||
/// </summary>
|
||||
public const string KeyOpenAccess = "sys_open_access:";
|
||||
|
||||
/// <summary>
|
||||
/// 开放接口身份随机数缓存
|
||||
/// </summary>
|
||||
public const string KeyOpenAccessNonce = "sys_open_access_nonce:";
|
||||
|
||||
/// <summary>
|
||||
/// 登录黑名单
|
||||
/// </summary>
|
||||
public const string KeyBlacklist = "sys_blacklist:";
|
||||
|
||||
/// <summary>
|
||||
/// 系统配置缓存
|
||||
/// </summary>
|
||||
public const string KeyConfig = "sys_config:";
|
||||
|
||||
/// <summary>
|
||||
/// 系统字典缓存
|
||||
/// </summary>
|
||||
public const string KeyDict = "sys_dict:";
|
||||
|
||||
/// <summary>
|
||||
/// Excel临时文件缓存
|
||||
/// </summary>
|
||||
public const string KeyExcelTemp = "sys_excel_temp:";
|
||||
}
|
73
admin.net.pro/Admin.NET/Admin.NET.Core/Const/ClaimConst.cs
Normal file
73
admin.net.pro/Admin.NET/Admin.NET.Core/Const/ClaimConst.cs
Normal file
@ -0,0 +1,73 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Claim相关常量
|
||||
/// </summary>
|
||||
public class ClaimConst
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
public const string UserId = "UserId";
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
public const string Account = "Account";
|
||||
|
||||
/// <summary>
|
||||
/// 真实姓名
|
||||
/// </summary>
|
||||
public const string RealName = "RealName";
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
public const string NickName = "NickName";
|
||||
|
||||
/// <summary>
|
||||
/// 账号类型
|
||||
/// </summary>
|
||||
public const string AccountType = "AccountType";
|
||||
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
/// </summary>
|
||||
public const string TenantId = "TenantId";
|
||||
|
||||
/// <summary>
|
||||
/// 组织机构Id
|
||||
/// </summary>
|
||||
public const string OrgId = "OrgId";
|
||||
|
||||
/// <summary>
|
||||
/// 组织机构名称
|
||||
/// </summary>
|
||||
public const string OrgName = "OrgName";
|
||||
|
||||
/// <summary>
|
||||
/// 组织机构类型
|
||||
/// </summary>
|
||||
public const string OrgType = "OrgType";
|
||||
|
||||
/// <summary>
|
||||
/// 微信OpenId
|
||||
/// </summary>
|
||||
public const string OpenId = "OpenId";
|
||||
|
||||
/// <summary>
|
||||
/// 登录模式PC、APP
|
||||
/// </summary>
|
||||
public const string LoginMode = "LoginMode";
|
||||
|
||||
/// <summary>
|
||||
/// Token版本号
|
||||
/// </summary>
|
||||
public const string TokenVersion = "TokenVersion";
|
||||
}
|
34
admin.net.pro/Admin.NET/Admin.NET.Core/Const/CommonConst.cs
Normal file
34
admin.net.pro/Admin.NET/Admin.NET.Core/Const/CommonConst.cs
Normal file
@ -0,0 +1,34 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 通用常量
|
||||
/// </summary>
|
||||
[Const("平台配置")]
|
||||
public class CommonConst
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统管理员角色编码
|
||||
/// </summary>
|
||||
public const string SysAdminRole = "sys_admin";
|
||||
|
||||
/// <summary>
|
||||
/// 日志分组名称
|
||||
/// </summary>
|
||||
public const string SysLogCategoryName = "System.Logging.LoggingMonitor";
|
||||
|
||||
/// <summary>
|
||||
/// 事件-增加异常日志
|
||||
/// </summary>
|
||||
public const string AddExLog = "Add:ExLog";
|
||||
|
||||
/// <summary>
|
||||
/// 事件-发送异常邮件
|
||||
/// </summary>
|
||||
public const string SendErrorMail = "Send:ErrorMail";
|
||||
}
|
138
admin.net.pro/Admin.NET/Admin.NET.Core/Const/ConfigConst.cs
Normal file
138
admin.net.pro/Admin.NET/Admin.NET.Core/Const/ConfigConst.cs
Normal file
@ -0,0 +1,138 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 配置常量
|
||||
/// </summary>
|
||||
public class ConfigConst
|
||||
{
|
||||
/// <summary>
|
||||
/// 演示环境
|
||||
/// </summary>
|
||||
public const string SysDemoEnv = "sys_demo";
|
||||
|
||||
/// <summary>
|
||||
/// 默认密码
|
||||
/// </summary>
|
||||
public const string SysPassword = "sys_password";
|
||||
|
||||
/// <summary>
|
||||
/// 密码最大错误次数
|
||||
/// </summary>
|
||||
public const string SysPasswordMaxErrorTimes = "sys_password_max_error_times";
|
||||
|
||||
/// <summary>
|
||||
/// 日志保留天数
|
||||
/// </summary>
|
||||
public const string SysLogRetentionDays = "sys_log_retention_days";
|
||||
|
||||
/// <summary>
|
||||
/// 记录操作日志
|
||||
/// </summary>
|
||||
public const string SysOpLog = "sys_oplog";
|
||||
|
||||
/// <summary>
|
||||
/// 单设备登录
|
||||
/// </summary>
|
||||
public const string SysSingleLogin = "sys_single_login";
|
||||
|
||||
/// <summary>
|
||||
/// 登录二次验证
|
||||
/// </summary>
|
||||
public const string SysSecondVer = "sys_second_ver";
|
||||
|
||||
/// <summary>
|
||||
/// 图形验证码
|
||||
/// </summary>
|
||||
public const string SysCaptcha = "sys_captcha";
|
||||
|
||||
/// <summary>
|
||||
/// Token过期时间
|
||||
/// </summary>
|
||||
public const string SysTokenExpire = "sys_token_expire";
|
||||
|
||||
/// <summary>
|
||||
/// RefreshToken过期时间
|
||||
/// </summary>
|
||||
public const string SysRefreshTokenExpire = "sys_refresh_token_expire";
|
||||
|
||||
/// <summary>
|
||||
/// 发送异常日志邮件
|
||||
/// </summary>
|
||||
public const string SysErrorMail = "sys_error_mail";
|
||||
|
||||
/// <summary>
|
||||
/// 域登录验证
|
||||
/// </summary>
|
||||
public const string SysDomainLogin = "sys_domain_login";
|
||||
|
||||
/// <summary>
|
||||
/// 数据校验日志
|
||||
/// </summary>
|
||||
public const string SysValidationLog = "sys_validation_log";
|
||||
|
||||
/// <summary>
|
||||
/// 行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级
|
||||
/// </summary>
|
||||
public const string SysRegionSyncLevel = "sys_region_sync_level";
|
||||
|
||||
/// <summary>
|
||||
/// 开启强制修改密码
|
||||
/// </summary>
|
||||
public const string SysForceChangePassword = "sys_force_change_password";
|
||||
|
||||
/// <summary>
|
||||
/// Default 分组
|
||||
/// </summary>
|
||||
public const string SysDefaultGroup = "Default";
|
||||
|
||||
/// <summary>
|
||||
/// WebConfig 分组
|
||||
/// </summary>
|
||||
public const string SysWebConfigGroup = "WebConfig";
|
||||
|
||||
/// <summary>
|
||||
/// 系统图标
|
||||
/// </summary>
|
||||
public const string SysWebLogo = "sys_web_logo";
|
||||
|
||||
/// <summary>
|
||||
/// 系统主标题
|
||||
/// </summary>
|
||||
public const string SysWebTitle = "sys_web_title";
|
||||
|
||||
/// <summary>
|
||||
/// 系统副标题
|
||||
/// </summary>
|
||||
public const string SysWebViceTitle = "sys_web_viceTitle";
|
||||
|
||||
/// <summary>
|
||||
/// 系统描述
|
||||
/// </summary>
|
||||
public const string SysWebViceDesc = "sys_web_viceDesc";
|
||||
|
||||
/// <summary>
|
||||
/// 水印内容
|
||||
/// </summary>
|
||||
public const string SysWebWatermark = "sys_web_watermark";
|
||||
|
||||
/// <summary>
|
||||
/// 版权说明
|
||||
/// </summary>
|
||||
public const string SysWebCopyright = "sys_web_copyright";
|
||||
|
||||
/// <summary>
|
||||
/// ICP备案号
|
||||
/// </summary>
|
||||
public const string SysWebIcp = "sys_web_icp";
|
||||
|
||||
/// <summary>
|
||||
/// ICP地址
|
||||
/// </summary>
|
||||
public const string SysWebIcpUrl = "sys_web_icpUrl";
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// SqlSugar相关常量
|
||||
/// </summary>
|
||||
public class SqlSugarConst
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认主数据库标识(默认租户)
|
||||
/// </summary>
|
||||
public const string MainConfigId = "1300000000001";
|
||||
|
||||
/// <summary>
|
||||
/// 默认日志数据库标识
|
||||
/// </summary>
|
||||
public const string LogConfigId = "1300000000002";
|
||||
|
||||
/// <summary>
|
||||
/// 默认表主键
|
||||
/// </summary>
|
||||
public const string PrimaryKey = "Id";
|
||||
|
||||
/// <summary>
|
||||
/// 默认租户Id
|
||||
/// </summary>
|
||||
public const long DefaultTenantId = 1300000000001;
|
||||
}
|
148
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/EntityBase.cs
Normal file
148
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/EntityBase.cs
Normal file
@ -0,0 +1,148 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 框架实体基类Id
|
||||
/// </summary>
|
||||
public abstract class EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 雪花Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Id", ColumnDescription = "主键Id", IsPrimaryKey = true, IsIdentity = false)]
|
||||
public virtual long Id { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 框架实体基类
|
||||
/// </summary>
|
||||
[SugarIndex("index_{table}_CT", nameof(CreateTime), OrderByType.Asc)]
|
||||
public abstract class EntityBase : EntityBaseId, IDeletedFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "创建时间", IsNullable = true, IsOnlyIgnoreUpdate = true)]
|
||||
public virtual DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "更新时间")]
|
||||
public virtual DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "创建者Id", IsOnlyIgnoreUpdate = true)]
|
||||
[OwnerUser]
|
||||
public virtual long? CreateUserId { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 创建者
|
||||
///// </summary>
|
||||
//[Newtonsoft.Json.JsonIgnore]
|
||||
//[System.Text.Json.Serialization.JsonIgnore]
|
||||
//[Navigate(NavigateType.OneToOne, nameof(CreateUserId))]
|
||||
//public virtual SysUser CreateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "创建者姓名", Length = 64, IsOnlyIgnoreUpdate = true)]
|
||||
public virtual string? CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "修改者Id")]
|
||||
public virtual long? UpdateUserId { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 修改者
|
||||
///// </summary>
|
||||
//[Newtonsoft.Json.JsonIgnore]
|
||||
//[System.Text.Json.Serialization.JsonIgnore]
|
||||
//[Navigate(NavigateType.OneToOne, nameof(UpdateUserId))]
|
||||
//public virtual SysUser UpdateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "修改者姓名", Length = 64)]
|
||||
public virtual string? UpdateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "软删除")]
|
||||
public virtual bool IsDelete { get; set; } = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 业务数据实体基类(数据权限)
|
||||
/// </summary>
|
||||
public abstract class EntityBaseData : EntityBase, IOrgIdFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建者部门Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "创建者部门Id", IsOnlyIgnoreUpdate = true)]
|
||||
[OwnerOrg]
|
||||
public virtual long? CreateOrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者部门
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(CreateOrgId))]
|
||||
public virtual SysOrg CreateOrg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者部门名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "创建者部门名称", Length = 64, IsOnlyIgnoreUpdate = true)]
|
||||
public virtual string? CreateOrgName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 租户实体基类
|
||||
/// </summary>
|
||||
public abstract class EntityTenant : EntityBase, ITenantIdFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true)]
|
||||
public virtual long? TenantId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 租户实体基类Id
|
||||
/// </summary>
|
||||
public abstract class EntityTenantId : EntityBaseId, ITenantIdFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true)]
|
||||
public virtual long? TenantId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 租户实体基类 + 业务数据(数据权限)
|
||||
/// </summary>
|
||||
public abstract class EntityTenantBaseData : EntityBaseData, ITenantIdFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true)]
|
||||
public virtual long? TenantId { get; set; }
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 假删除接口过滤器
|
||||
/// </summary>
|
||||
internal interface IDeletedFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
bool IsDelete { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 租户Id接口过滤器
|
||||
/// </summary>
|
||||
internal interface ITenantIdFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
/// </summary>
|
||||
long? TenantId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 机构Id接口过滤器
|
||||
/// </summary>
|
||||
internal interface IOrgIdFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建者部门Id
|
||||
/// </summary>
|
||||
long? CreateOrgId { get; set; }
|
||||
}
|
137
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysCodeGen.cs
Normal file
137
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysCodeGen.cs
Normal file
@ -0,0 +1,137 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成表
|
||||
/// </summary>
|
||||
[SugarTable(null, "代码生成表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_B", nameof(BusName), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_T", nameof(TableName), OrderByType.Asc)]
|
||||
public partial class SysCodeGen : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作者姓名", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否移除表前缀", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "生成方式", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 库定位器名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "库定位器名", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? ConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库名(保留字段)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库库名", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? DbName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库类型", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? DbType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库链接
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库链接", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? ConnectionString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库表名", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "命名空间", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "业务名", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成菜单
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否生成菜单")]
|
||||
public bool GenerateMenu { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 菜单图标
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单图标", Length = 32)]
|
||||
public string? MenuIcon { get; set; } = "ele-Menu";
|
||||
|
||||
/// <summary>
|
||||
/// 菜单编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单编码")]
|
||||
public long? MenuPid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 页面目录
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "页面目录", Length = 32)]
|
||||
public string? PagePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支持打印类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "支持打印类型", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PrintType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印模版名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "打印模版名称", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PrintName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用 Api Service
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否使用 Api Service")]
|
||||
public bool IsApiService { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 模板关系:SysCodeGenTemplateRelation表中的CodeGenId,注意禁止给CodeGenTemplateRelations手动赋值
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToMany, nameof(SysCodeGenTemplateRelation.CodeGenId))]
|
||||
public List<SysCodeGenTemplateRelation> CodeGenTemplateRelations { get; set; }
|
||||
}
|
@ -0,0 +1,220 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成字段配置表
|
||||
/// </summary>
|
||||
[SugarTable(null, "代码生成字段配置表")]
|
||||
[SysTable]
|
||||
public partial class SysCodeGenConfig : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成主表Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "主表Id")]
|
||||
public long CodeGenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库字段名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "字段名称", Length = 128)]
|
||||
[Required, MaxLength(128)]
|
||||
public virtual string ColumnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实体属性名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "属性名称", Length = 128)]
|
||||
[Required, MaxLength(128)]
|
||||
public virtual string PropertyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字段数据长度
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "字段数据长度", DefaultValue = "0")]
|
||||
public int ColumnLength { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 字段描述
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "字段描述", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? ColumnComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// .NET数据类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "NET数据类型", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? NetType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作用类型(字典)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作用类型", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? EffectType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外键库标识
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "外键库标识", Length = 20)]
|
||||
[MaxLength(20)]
|
||||
public string? FkConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外键实体名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "外键实体名称", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? FkEntityName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外键表名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "外键表名称", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? FkTableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外键显示字段
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "外键显示字段", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? FkColumnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外键链接字段
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "外键链接字段", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? FkLinkColumnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外键显示字段.NET类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "外键显示字段.NET类型", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? FkColumnNetType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "字典编码", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? DictTypeCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表是否缩进(字典)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "列表是否缩进", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? WhetherRetract { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否必填(字典)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否必填", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? WhetherRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否可排序(字典)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否可排序", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? WhetherSortable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是查询条件
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否是查询条件", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? QueryWhether { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询方式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "查询方式", Length = 16)]
|
||||
[MaxLength(16)]
|
||||
public string? QueryType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表显示
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "列表显示", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? WhetherTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 增改
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "增改", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? WhetherAddUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "主键", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? ColumnKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库中类型(物理类型)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库中类型", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否通用字段
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否通用字段", Length = 8)]
|
||||
[MaxLength(8)]
|
||||
public string? WhetherCommon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示文本字段
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "显示文本字段", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? DisplayColumn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 选中值字段
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "选中值字段", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? ValueColumn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父级字段
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "父级字段", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? PidColumn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 字段验证规则
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "字段验证规则", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Rules { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "默认值", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? DefaultValue { get; set; }
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成模板配置表
|
||||
/// </summary>
|
||||
[SugarTable(null, "代码生成模板配置表")]
|
||||
[SysTable]
|
||||
public partial class SysCodeGenTemplate : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 模板文件名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "模板文件名", Length = 128)]
|
||||
[Required, MaxLength(128)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "代码生成类型", DefaultValue = "2")]
|
||||
public CodeGenTypeEnum Type { get; set; } = CodeGenTypeEnum.Backend;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是内置模板(Y-是,N-否)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否是内置模板", DefaultValue = "1")]
|
||||
public YesNoEnum SysFlag { get; set; } = YesNoEnum.Y;
|
||||
|
||||
/// <summary>
|
||||
/// 是否默认
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否默认")]
|
||||
public bool? IsDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出位置
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "输出位置", Length = 256)]
|
||||
[Required, MaxLength(256)]
|
||||
public string OutputFile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "描述", Length = 256)]
|
||||
[Required, MaxLength(256)]
|
||||
public string Describe { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成模板关系表
|
||||
/// </summary>
|
||||
[SugarTable(null, "代码生成模板关系表")]
|
||||
[SysTable]
|
||||
public partial class SysCodeGenTemplateRelation : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "代码生成Id")]
|
||||
[Required]
|
||||
public long CodeGenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "模板Id")]
|
||||
[Required]
|
||||
public long TemplateId { get; set; }
|
||||
}
|
64
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysConfig.cs
Normal file
64
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysConfig.cs
Normal file
@ -0,0 +1,64 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统参数配置表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统参数配置表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc, IsUnique = true)]
|
||||
public partial class SysConfig : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "编码", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 属性值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "属性值", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是内置参数(Y-是,N-否)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否是内置参数", DefaultValue = "1")]
|
||||
public YesNoEnum SysFlag { get; set; } = YesNoEnum.Y;
|
||||
|
||||
/// <summary>
|
||||
/// 分组编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "分组编码", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? GroupCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Remark { get; set; }
|
||||
}
|
97
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysDictData.cs
Normal file
97
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysDictData.cs
Normal file
@ -0,0 +1,97 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统字典值表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统字典值表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
|
||||
public partial class SysDictData : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典类型Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "字典类型Id")]
|
||||
public long DictTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(DictTypeId))]
|
||||
public SysDictType DictType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "值", Length = 128)]
|
||||
[Required, MaxLength(128)]
|
||||
public virtual string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "编码", Length = 256)]
|
||||
[Required, MaxLength(256)]
|
||||
public virtual string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public virtual string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示样式-标签颜色
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "显示样式-标签颜色", Length = 16)]
|
||||
[MaxLength(16)]
|
||||
public string? TagType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示样式-Style(控制显示样式)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "显示样式-Style", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
public string? StyleSetting { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示样式-Class(控制显示样式)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "显示样式-Class", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
public string? ClassSetting { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 2048)]
|
||||
[MaxLength(2048)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拓展数据(保存业务功能的配置项)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "拓展数据(保存业务功能的配置项)", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? ExtData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
}
|
56
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysDictType.cs
Normal file
56
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysDictType.cs
Normal file
@ -0,0 +1,56 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统字典类型表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统字典类型表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
|
||||
public partial class SysDictType : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "编码", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
|
||||
/// <summary>
|
||||
/// 字典值集合
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToMany, nameof(SysDictData.DictTypeId))]
|
||||
public List<SysDictData> Children { get; set; }
|
||||
}
|
111
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysFile.cs
Normal file
111
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysFile.cs
Normal file
@ -0,0 +1,111 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统文件表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统文件表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_F", nameof(FileName), OrderByType.Asc)]
|
||||
public partial class SysFile : EntityTenantBaseData
|
||||
{
|
||||
/// <summary>
|
||||
/// 提供者
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "提供者", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Provider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仓储名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "仓储名称", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? BucketName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名称(源文件名)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文件名称", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件后缀
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文件后缀", Length = 16)]
|
||||
[MaxLength(16)]
|
||||
public string? Suffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 存储路径
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "存储路径", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
public string? FilePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小KB
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文件大小KB")]
|
||||
public long SizeKb { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小信息-计算后的
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文件大小信息", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? SizeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外链地址-OSS上传后生成外链地址方便前端预览
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "外链地址", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件MD5
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文件MD5", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? FileMd5 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象名称(如子对象)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "关联对象名称", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? RelationName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "关联对象Id")]
|
||||
public long? RelationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属Id(如主对象)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "所属Id")]
|
||||
public long? BelongId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件类别
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文件类别", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? FileType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否公开
|
||||
/// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否公开")]
|
||||
public bool IsPublic { get; set; } = false;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统作业集群表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统作业集群表")]
|
||||
[SysTable]
|
||||
public partial class SysJobCluster : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 作业集群Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业集群Id", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string ClusterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "描述信息", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public ClusterStatus Status { get; set; } = ClusterStatus.Working;
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "更新时间")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统作业信息表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统作业信息表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_J", nameof(JobId), OrderByType.Asc)]
|
||||
public partial class SysJobDetail : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 作业Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业Id", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "组名称", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? GroupName { get; set; } = "default";
|
||||
|
||||
/// <summary>
|
||||
/// 作业类型FullName
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业类型", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? JobType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 程序集Name
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "程序集", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? AssemblyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "描述信息", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否并行执行
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否并行执行")]
|
||||
public bool Concurrent { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否扫描特性触发器
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否扫描特性触发器", ColumnName = "annotation")]
|
||||
public bool IncludeAnnotation { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 额外数据
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "额外数据", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Properties { get; set; } = "{}";
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "更新时间")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作业创建类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业创建类型", DefaultValue = "0")]
|
||||
public JobCreateTypeEnum CreateType { get; set; } = JobCreateTypeEnum.BuiltIn;
|
||||
|
||||
/// <summary>
|
||||
/// 脚本代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "脚本代码", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? ScriptCode { get; set; }
|
||||
}
|
147
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysJobTrigger.cs
Normal file
147
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysJobTrigger.cs
Normal file
@ -0,0 +1,147 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统作业触发器表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统作业触发器表")]
|
||||
[SysTable]
|
||||
public partial class SysJobTrigger : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 触发器Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发器Id", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string TriggerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作业Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业Id", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发器类型FullName
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发器类型", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? TriggerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 程序集Name
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "程序集", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? AssemblyName { get; set; } = "Furion.Pure";
|
||||
|
||||
/// <summary>
|
||||
/// 参数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "参数", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Args { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "描述信息", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public TriggerStatus Status { get; set; } = TriggerStatus.Ready;
|
||||
|
||||
/// <summary>
|
||||
/// 起始时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "起始时间")]
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "结束时间")]
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近运行时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最近运行时间")]
|
||||
public DateTime? LastRunTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下一次运行时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "下一次运行时间")]
|
||||
public DateTime? NextRunTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发次数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发次数")]
|
||||
public long NumberOfRuns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大触发次数(0:不限制,n:N次)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最大触发次数")]
|
||||
public long MaxNumberOfRuns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出错次数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "出错次数")]
|
||||
public long NumberOfErrors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大出错次数(0:不限制,n:N次)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最大出错次数")]
|
||||
public long MaxNumberOfErrors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重试次数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "重试次数")]
|
||||
public int NumRetries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重试间隔时间(ms)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "重试间隔时间(ms)", DefaultValue = "3000")]
|
||||
public int RetryTimeout { get; set; } = 3000;
|
||||
|
||||
/// <summary>
|
||||
/// 是否立即启动
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否立即启动")]
|
||||
public bool StartNow { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启动时执行一次
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否启动时执行一次")]
|
||||
public bool RunOnStart { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否在启动时重置最大触发次数等于一次的作业
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否重置触发次数")]
|
||||
public bool ResetOnlyOnce { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "更新时间")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统作业触发器运行记录表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统作业触发器运行记录表")]
|
||||
[SysTable]
|
||||
public partial class SysJobTriggerRecord : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 作业Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业Id", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发器Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发器Id", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string TriggerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前运行次数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "当前运行次数")]
|
||||
public long NumberOfRuns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近运行时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最近运行时间")]
|
||||
public DateTime? LastRunTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下一次运行时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "下一次运行时间")]
|
||||
public DateTime? NextRunTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发器状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发器状态", DefaultValue = "1")]
|
||||
public TriggerStatus Status { get; set; } = TriggerStatus.Ready;
|
||||
|
||||
/// <summary>
|
||||
/// 本次执行结果
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "本次执行结果", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 本次执行耗时
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "本次执行耗时")]
|
||||
public long ElapsedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "创建时间")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
}
|
89
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLdap.cs
Normal file
89
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLdap.cs
Normal file
@ -0,0 +1,89 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统域登录信息配置表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统域登录信息配置表")]
|
||||
[SysTable]
|
||||
public class SysLdap : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 主机
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "主机", Length = 128)]
|
||||
[Required]
|
||||
public virtual string Host { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "端口")]
|
||||
public virtual int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户搜索基准
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户搜索基准", Length = 128)]
|
||||
[Required]
|
||||
public virtual string BaseDn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 绑定DN(有管理权限制的用户)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "绑定DN", Length = 32)]
|
||||
[Required]
|
||||
public virtual string BindDn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 绑定密码(有管理权限制的用户密码)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "绑定密码", Length = 512)]
|
||||
[Required]
|
||||
public virtual string BindPass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户过滤规则
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户过滤规则", Length = 128)]
|
||||
[Required]
|
||||
public virtual string AuthFilter { get; set; } = "sAMAccountName=%s";
|
||||
|
||||
/// <summary>
|
||||
/// Ldap版本
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "Ldap版本")]
|
||||
public int Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 绑定域账号字段属性值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "绑定域账号字段属性值", Length = 32)]
|
||||
[Required]
|
||||
public virtual string BindAttrAccount { get; set; } = "sAMAccountName";
|
||||
|
||||
/// <summary>
|
||||
/// 绑定用户EmployeeId属性值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "绑定用户EmployeeId属性值", Length = 32)]
|
||||
[Required]
|
||||
public virtual string BindAttrEmployeeId { get; set; } = "EmployeeId";
|
||||
|
||||
/// <summary>
|
||||
/// 绑定Code属性值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "绑定对象Code属性值", Length = 64)]
|
||||
[Required]
|
||||
public virtual string BindAttrCode { get; set; } = "objectGUID";
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
}
|
58
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLogDiff.cs
Normal file
58
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLogDiff.cs
Normal file
@ -0,0 +1,58 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统差异日志表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统差异日志表")]
|
||||
[SysTable]
|
||||
[LogTable]
|
||||
public partial class SysLogDiff : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作前记录
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "操作前记录", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? BeforeData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作后记录
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "操作后记录", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? AfterData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sql
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "Sql", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Sql { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参数 手动传入的参数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "参数", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Parameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务对象
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "业务对象", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? BusinessData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 差异操作
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "差异操作", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? DiffType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 耗时
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "耗时")]
|
||||
public long? Elapsed { get; set; }
|
||||
}
|
72
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLogEx.cs
Normal file
72
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLogEx.cs
Normal file
@ -0,0 +1,72 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统异常日志表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统异常日志表")]
|
||||
[SysTable]
|
||||
[LogTable]
|
||||
public partial class SysLogEx : SysLogVis
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求方式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求方式", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? HttpMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求地址", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? RequestUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求参数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求参数", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? RequestParam { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回结果
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "返回结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? ReturnResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 事件Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "事件Id")]
|
||||
public int? EventId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 线程Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "线程Id")]
|
||||
public int? ThreadId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求跟踪Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求跟踪Id", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? TraceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 异常信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "异常信息", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Exception { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志消息Json
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "日志消息Json", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Message { get; set; }
|
||||
}
|
72
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLogOp.cs
Normal file
72
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLogOp.cs
Normal file
@ -0,0 +1,72 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统操作日志表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统操作日志表")]
|
||||
[SysTable]
|
||||
[LogTable]
|
||||
public partial class SysLogOp : SysLogVis
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求方式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求方式", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? HttpMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求地址", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? RequestUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求参数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求参数", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? RequestParam { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回结果
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "返回结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? ReturnResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 事件Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "事件Id")]
|
||||
public int? EventId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 线程Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "线程Id")]
|
||||
public int? ThreadId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求跟踪Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求跟踪Id", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? TraceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 异常信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "异常信息", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Exception { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志消息Json
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "日志消息Json", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Message { get; set; }
|
||||
}
|
116
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLogVis.cs
Normal file
116
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysLogVis.cs
Normal file
@ -0,0 +1,116 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统访问日志表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统访问日志表")]
|
||||
[SysTable]
|
||||
[LogTable]
|
||||
public partial class SysLogVis : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 模块名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "模块名称", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? ControllerName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 方法名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnDescription = "方法名称", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? ActionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnDescription = "显示名称", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? DisplayTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "执行状态", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "IP地址", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? RemoteIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录地点
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "登录地点", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经度
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "经度")]
|
||||
public double? Longitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 维度
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "维度")]
|
||||
public double? Latitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 浏览器
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "浏览器", Length = 1024)]
|
||||
[MaxLength(1024)]
|
||||
public string? Browser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作系统
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "操作系统", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Os { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作用时
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "操作用时")]
|
||||
public long? Elapsed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "日志时间")]
|
||||
public DateTime? LogDateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志级别
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "日志级别")]
|
||||
public LogLevel? LogLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "账号", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 真实姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "真实姓名", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? RealName { get; set; }
|
||||
}
|
134
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysMenu.cs
Normal file
134
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysMenu.cs
Normal file
@ -0,0 +1,134 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统菜单表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统菜单表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_T", nameof(Title), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_T2", nameof(Type), OrderByType.Asc)]
|
||||
public partial class SysMenu : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 父Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "父Id")]
|
||||
public long Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单类型(1目录 2菜单 3按钮)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单类型", DefaultValue = "2")]
|
||||
public MenuTypeEnum Type { get; set; } = MenuTypeEnum.Menu;
|
||||
|
||||
/// <summary>
|
||||
/// 路由名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "路由名称", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 路由地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "路由地址", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件路径
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "组件路径", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Component { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重定向
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "重定向", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Redirect { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权限标识
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "权限标识", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Permission { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单名称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "图标", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Icon { get; set; } = "ele-Menu";
|
||||
|
||||
/// <summary>
|
||||
/// 是否内嵌
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否内嵌")]
|
||||
public bool IsIframe { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外链链接
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "外链链接", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? OutLink { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否隐藏
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否隐藏")]
|
||||
public bool IsHide { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否缓存
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否缓存")]
|
||||
public bool IsKeepAlive { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否固定
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否固定")]
|
||||
public bool IsAffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单子项
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<SysMenu> Children { get; set; } = new List<SysMenu>();
|
||||
}
|
82
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysNotice.cs
Normal file
82
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysNotice.cs
Normal file
@ -0,0 +1,82 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统通知公告表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统通知公告表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_T", nameof(Type), OrderByType.Asc)]
|
||||
public partial class SysNotice : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "标题", Length = 32)]
|
||||
[Required, MaxLength(32)]
|
||||
[SensitiveDetection('*')]
|
||||
public virtual string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "内容", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
[Required]
|
||||
[SensitiveDetection('*')]
|
||||
public virtual string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型(1通知 2公告)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "类型(1通知 2公告)", DefaultValue = "1")]
|
||||
public NoticeTypeEnum Type { get; set; } = NoticeTypeEnum.NOTICE;
|
||||
|
||||
/// <summary>
|
||||
/// 发布人Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "发布人Id")]
|
||||
public long PublicUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布人姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "发布人姓名", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PublicUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布机构Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "发布机构Id")]
|
||||
public long PublicOrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布机构名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "发布机构名称", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? PublicOrgName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "发布时间")]
|
||||
public DateTime? PublicTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 撤回时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "撤回时间")]
|
||||
public DateTime? CancelTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(0草稿 1发布 2撤回 3删除)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态(0草稿 1发布 2撤回 3删除)", DefaultValue = "0")]
|
||||
public NoticeStatusEnum Status { get; set; } = NoticeStatusEnum.DRAFT;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统通知公告用户表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统通知公告用户表")]
|
||||
[SysTable]
|
||||
public partial class SysNoticeUser : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知公告Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "通知公告Id")]
|
||||
public long NoticeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 通知公告
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToOne, nameof(NoticeId))]
|
||||
public SysNotice SysNotice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阅读时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "阅读时间")]
|
||||
public DateTime? ReadTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(0未读 1已读)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态(0未读 1已读)", DefaultValue = "0")]
|
||||
public NoticeUserStatusEnum ReadStatus { get; set; } = NoticeUserStatusEnum.UNREAD;
|
||||
}
|
166
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysOAuthUser.cs
Normal file
166
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysOAuthUser.cs
Normal file
@ -0,0 +1,166 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统三方用户表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统三方用户表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(NickName), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_M", nameof(Mobile), OrderByType.Asc)]
|
||||
public partial class SysOAuthUser : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "系统用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统用户
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(UserId))]
|
||||
public SysUser SysUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平台类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "平台类型", DefaultValue = "1")]
|
||||
public PlatformTypeEnum PlatformType { get; set; } = PlatformTypeEnum.微信公众号;
|
||||
|
||||
/// <summary>
|
||||
/// OpenId
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "OpenId", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public virtual string? OpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会话密钥
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "会话密钥", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? SessionKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UnionId
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "UnionId", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? UnionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "账号", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "昵称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public string? NickName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "头像", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Avatar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "邮箱", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public virtual string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "手机号码", Length = 16)]
|
||||
[MaxLength(16)]
|
||||
public string? Mobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "性别")]
|
||||
public int? Sex { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// IP 地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "IP 地址", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? IpAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 语言
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "语言", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Language { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "城市", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 省
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "省", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "国家", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AccessToken
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "AccessToken", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RefreshToken
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "RefreshToken", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? RefreshToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "ExpiresIn")]
|
||||
public int? ExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权的作用域,使用逗号分隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "授权作用域", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Scope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Remark { get; set; }
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统在线用户表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统在线用户表")]
|
||||
[SysTable]
|
||||
public partial class SysOnlineUser : EntityTenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 连接Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "连接Id")]
|
||||
public string? ConnectionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "账号", Length = 32)]
|
||||
[Required, MaxLength(32)]
|
||||
public virtual string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 真实姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "真实姓名", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? RealName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "连接时间")]
|
||||
public DateTime? Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接IP
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "连接IP", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 浏览器
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "浏览器", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Browser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作系统
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "操作系统", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Os { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录模式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "登录模式", DefaultValue = "1")]
|
||||
public LoginModeEnum? LoginMode { get; set; } = LoginModeEnum.PC;
|
||||
|
||||
/// <summary>
|
||||
/// 登录设备
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "登录设备", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Device { get; set; }
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 开放接口身份表
|
||||
/// </summary>
|
||||
[SugarTable(null, "开放接口身份表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_A", nameof(AccessKey), OrderByType.Asc)]
|
||||
public partial class SysOpenAccess : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 身份标识
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "身份标识", Length = 128)]
|
||||
[Required, MaxLength(128)]
|
||||
public virtual string AccessKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密钥
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "密钥", Length = 256)]
|
||||
[Required, MaxLength(256)]
|
||||
public virtual string AccessSecret { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 绑定租户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "绑定租户Id")]
|
||||
public long BindTenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 绑定租户
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(BindTenantId))]
|
||||
public SysTenant BindTenant { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 绑定用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "绑定用户Id")]
|
||||
public virtual long BindUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 绑定用户
|
||||
/// </summary>
|
||||
//[Newtonsoft.Json.JsonIgnore]
|
||||
//[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(BindUserId))]
|
||||
public SysUser BindUser { get; set; }
|
||||
}
|
96
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysOrg.cs
Normal file
96
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysOrg.cs
Normal file
@ -0,0 +1,96 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统机构表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统机构表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_T", nameof(Type), OrderByType.Asc)]
|
||||
public partial class SysOrg : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 父Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "父Id")]
|
||||
public long Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "编码", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 级别
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "级别")]
|
||||
public int? Level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构类型-数据字典
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "机构类型", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public virtual string? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "负责人Id", IsNullable = true)]
|
||||
public long? DirectorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(DirectorId))]
|
||||
public SysUser Director { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构子项
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<SysOrg> Children { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否禁止选中
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public bool Disabled { get; set; }
|
||||
}
|
56
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysPlugin.cs
Normal file
56
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysPlugin.cs
Normal file
@ -0,0 +1,56 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统动态插件表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统动态插件表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
|
||||
public partial class SysPlugin : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// C#代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "C#代码", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
[Required]
|
||||
public virtual string CsharpCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 程序集名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "程序集名称", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
public string? AssemblyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Remark { get; set; }
|
||||
}
|
50
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysPos.cs
Normal file
50
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysPos.cs
Normal file
@ -0,0 +1,50 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统职位表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统职位表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
|
||||
public partial class SysPos : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "编码", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
}
|
69
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysPrint.cs
Normal file
69
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysPrint.cs
Normal file
@ -0,0 +1,69 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统打印模板表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统打印模板表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
|
||||
public partial class SysPrint : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印模板
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "打印模板", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
[Required]
|
||||
public virtual string Template { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "打印类型", DefaultValue = "1")]
|
||||
[Required]
|
||||
public virtual PrintTypeEnum? PrintType { get; set; } = PrintTypeEnum.Browser;
|
||||
|
||||
/// <summary>
|
||||
/// 客户端服务地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "客户端服务地址", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public virtual string? ClientServiceAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打印参数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "打印参数", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public virtual string? PrintParam { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Remark { get; set; }
|
||||
}
|
116
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRegion.cs
Normal file
116
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRegion.cs
Normal file
@ -0,0 +1,116 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统行政地区表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统行政地区表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
|
||||
public partial class SysRegion : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 父Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "父Id")]
|
||||
public long Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 128)]
|
||||
[Required, MaxLength(128)]
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 简称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "简称", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? ShortName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组合名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "组合名", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? MergerName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 行政代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "行政代码", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮政编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "邮政编码", Length = 6)]
|
||||
[MaxLength(6)]
|
||||
public string? ZipCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "区号", Length = 6)]
|
||||
[MaxLength(6)]
|
||||
public string? CityCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 层级
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "层级")]
|
||||
public int Level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "类型", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拼音
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "拼音", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? PinYin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经度
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "经度")]
|
||||
public float Lng { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 维度
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "维度")]
|
||||
public float Lat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构子项
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<SysRegion> Children { get; set; }
|
||||
}
|
62
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRole.cs
Normal file
62
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRole.cs
Normal file
@ -0,0 +1,62 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统角色表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统角色表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
|
||||
public partial class SysRole : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称", Length = 64)]
|
||||
[Required, MaxLength(64)]
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "编码", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 数据范围(1全部数据 2本部门及以下数据 3本部门数据 4仅本人数据 5自定义数据)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据范围", DefaultValue = "4")]
|
||||
public DataScopeEnum DataScope { get; set; } = DataScopeEnum.Self;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是内置(Y-是,N-否)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否是内置", DefaultValue = "1")]
|
||||
public YesNoEnum SysFlag { get; set; } = YesNoEnum.Y;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
}
|
28
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRoleApi.cs
Normal file
28
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRoleApi.cs
Normal file
@ -0,0 +1,28 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统角色接口黑名单表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统角色接口黑名单表")]
|
||||
[SysTable]
|
||||
public class SysRoleApi : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "角色Id")]
|
||||
public long RoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 接口路由
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "接口路由", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
[Required]
|
||||
public string Route { get; set; }
|
||||
}
|
35
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRoleMenu.cs
Normal file
35
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRoleMenu.cs
Normal file
@ -0,0 +1,35 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统角色菜单表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统角色菜单表")]
|
||||
[SysTable]
|
||||
public class SysRoleMenu : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "角色Id")]
|
||||
public long RoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单Id")]
|
||||
public long MenuId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(MenuId))]
|
||||
public SysMenu SysMenu { get; set; }
|
||||
}
|
35
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRoleOrg.cs
Normal file
35
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysRoleOrg.cs
Normal file
@ -0,0 +1,35 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统角色机构表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统角色机构表")]
|
||||
[SysTable]
|
||||
public class SysRoleOrg : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "角色Id")]
|
||||
public long RoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "机构Id")]
|
||||
public long OrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(OrgId))]
|
||||
public SysOrg SysOrg { get; set; }
|
||||
}
|
52
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysSchedule.cs
Normal file
52
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysSchedule.cs
Normal file
@ -0,0 +1,52 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统日程表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统日程表")]
|
||||
[SysTable]
|
||||
public class SysSchedule : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日程日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "日程日期")]
|
||||
public DateTime? ScheduleTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "开始时间", Length = 10)]
|
||||
public string? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "结束时间", Length = 10)]
|
||||
public string? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日程内容
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "日程内容", Length = 256)]
|
||||
[Required, MaxLength(256)]
|
||||
public virtual string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 完成状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "完成状态", DefaultValue = "0")]
|
||||
public FinishStatusEnum Status { get; set; } = FinishStatusEnum.UnFinish;
|
||||
}
|
85
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysTenant.cs
Normal file
85
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysTenant.cs
Normal file
@ -0,0 +1,85 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统租户表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统租户表")]
|
||||
[SysTable]
|
||||
public partial class SysTenant : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "机构Id")]
|
||||
public long OrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主机
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "主机", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Host { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "租户类型", DefaultValue = "0")]
|
||||
public TenantTypeEnum TenantType { get; set; } = TenantTypeEnum.Id;
|
||||
|
||||
/// <summary>
|
||||
/// 数据库类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库类型", DefaultValue = "4")]
|
||||
public SqlSugar.DbType DbType { get; set; } = SqlSugar.DbType.PostgreSQL;
|
||||
|
||||
/// <summary>
|
||||
/// 数据库连接
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库连接", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Connection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库标识
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据库标识", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? ConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 从库连接/读写分离
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "从库连接/读写分离", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? SlaveConnections { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
}
|
352
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysUser.cs
Normal file
352
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysUser.cs
Normal file
@ -0,0 +1,352 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统用户表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统用户表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_A", nameof(Account), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_P", nameof(Phone), OrderByType.Asc)]
|
||||
public partial class SysUser : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "账号", Length = 32)]
|
||||
[Required, MaxLength(32)]
|
||||
public virtual string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "密码", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public virtual string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 真实姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "真实姓名", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public virtual string RealName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "昵称", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? NickName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "头像", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
public string? Avatar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别-男_1、女_2
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "性别", DefaultValue = "1")]
|
||||
public GenderEnum Sex { get; set; } = GenderEnum.Male;
|
||||
|
||||
/// <summary>
|
||||
/// 年龄
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "年龄")]
|
||||
public int Age { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出生日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "出生日期")]
|
||||
public DateTime? Birthday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 民族
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "民族", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? Nation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "手机号码", Length = 16)]
|
||||
[MaxLength(16)]
|
||||
public string? Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "证件类型", DefaultValue = "0")]
|
||||
public CardTypeEnum CardType { get; set; } = CardTypeEnum.IdCard;
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "身份证号", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? IdCardNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "邮箱", Length = 64)]
|
||||
[MaxLength(64)]
|
||||
public string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "地址", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文化程度
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文化程度", DefaultValue = "10")]
|
||||
public CultureLevelEnum CultureLevel { get; set; } = CultureLevelEnum.Level10;
|
||||
|
||||
/// <summary>
|
||||
/// 政治面貌
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "政治面貌", Length = 16)]
|
||||
[MaxLength(16)]
|
||||
public string? PoliticalOutlook { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 毕业院校
|
||||
/// </summary>COLLEGE
|
||||
[SugarColumn(ColumnDescription = "毕业院校", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? College { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 办公电话
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "办公电话", Length = 16)]
|
||||
[MaxLength(16)]
|
||||
public string? OfficePhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 紧急联系人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "紧急联系人", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? EmergencyContact { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 紧急联系人电话
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "紧急联系人电话", Length = 16)]
|
||||
[MaxLength(16)]
|
||||
public string? EmergencyPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 紧急联系人地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "紧急联系人地址", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? EmergencyAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 个人简介
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "个人简介", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
public string? Introduction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "排序")]
|
||||
public int OrderNo { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "账号类型", DefaultValue = "777")]
|
||||
public AccountTypeEnum AccountType { get; set; } = AccountTypeEnum.NormalUser;
|
||||
|
||||
/// <summary>
|
||||
/// 直属机构Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "直属机构Id")]
|
||||
public long OrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直属机构
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToOne, nameof(OrgId))]
|
||||
public SysOrg SysOrg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直属主管Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "直属主管Id")]
|
||||
public long? ManagerUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直属主管
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(ManagerUserId))]
|
||||
public SysUser ManagerUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职位Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "职位Id")]
|
||||
public long PosId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职位
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(PosId))]
|
||||
public SysPos SysPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "工号", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? JobNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职级
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "职级", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PosLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "职称", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PosTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 擅长领域
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "擅长领域", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? Expertise { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 办公区域
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "办公区域", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? OfficeZone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 办公室
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "办公室", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? Office { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "入职日期")]
|
||||
public DateTime? JoinDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新登录Ip
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最新登录Ip", Length = 256)]
|
||||
[MaxLength(256)]
|
||||
public string? LastLoginIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新登录地点
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最新登录地点", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? LastLoginAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新登录时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最新登录时间")]
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新登录设备
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最新登录设备", Length = 128)]
|
||||
[MaxLength(128)]
|
||||
public string? LastLoginDevice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电子签名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "电子签名", Length = 512)]
|
||||
[MaxLength(512)]
|
||||
public string? Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Token版本号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "Token版本号", DefaultValue = "1")]
|
||||
public int TokenVersion { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 最新密码修改时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最新密码修改时间")]
|
||||
public DateTime? LastChangePasswordTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证超级管理员类型,若账号类型为超级管理员则报错
|
||||
/// </summary>
|
||||
/// <param name="errorMsg">自定义错误消息</param>
|
||||
public void ValidateIsSuperAdminAccountType(ErrorCodeEnum? errorMsg = ErrorCodeEnum.D1014)
|
||||
{
|
||||
if (AccountType == AccountTypeEnum.SuperAdmin)
|
||||
{
|
||||
throw Oops.Oh(errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证用户Id是否相同,若用户Id相同则报错
|
||||
/// </summary>
|
||||
/// <param name="userId">用户Id</param>
|
||||
/// <param name="errorMsg">自定义错误消息</param>
|
||||
public void ValidateIsUserId(long userId, ErrorCodeEnum? errorMsg = ErrorCodeEnum.D1001)
|
||||
{
|
||||
if (Id == userId)
|
||||
{
|
||||
throw Oops.Oh(errorMsg);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统用户扩展机构表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统用户扩展机构表")]
|
||||
[SysTable]
|
||||
public partial class SysUserExtOrg : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(UserId))]
|
||||
public SysUser SysUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "机构Id")]
|
||||
public long OrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(OrgId))]
|
||||
public SysOrg SysOrg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职位Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "职位Id")]
|
||||
public long PosId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职位
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(PosId))]
|
||||
public SysPos SysPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "工号", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? JobNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职级
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "职级", Length = 32)]
|
||||
[MaxLength(32)]
|
||||
public string? PosLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入职日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "入职日期")]
|
||||
public DateTime? JoinDate { get; set; }
|
||||
}
|
44
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysUserLdap.cs
Normal file
44
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysUserLdap.cs
Normal file
@ -0,0 +1,44 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统用户域配置表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统用户域配置表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_A", nameof(Account), OrderByType.Asc)]
|
||||
[SugarIndex("index_{table}_U", nameof(UserId), OrderByType.Asc)]
|
||||
public class SysUserLdap : EntityTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 域账号
|
||||
/// AD域对应sAMAccountName
|
||||
/// Ldap对应uid
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "域账号", Length = 32)]
|
||||
[Required]
|
||||
public string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 对应EmployeeId(用于数据导入对照)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "对应EmployeeId", Length = 32)]
|
||||
public string? EmployeeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组织代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "组织代码", Length = 64)]
|
||||
public string? DeptCode { get; set; }
|
||||
}
|
41
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysUserMenu.cs
Normal file
41
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysUserMenu.cs
Normal file
@ -0,0 +1,41 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统用户菜单快捷导航表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统用户菜单快捷导航表")]
|
||||
[SysTable]
|
||||
public partial class SysUserMenu : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(UserId))]
|
||||
public SysUser SysUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单Id")]
|
||||
public long MenuId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToOne, nameof(MenuId))]
|
||||
public SysMenu SysMenu { get; set; }
|
||||
}
|
41
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysUserRole.cs
Normal file
41
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysUserRole.cs
Normal file
@ -0,0 +1,41 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统用户角色表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统用户角色表")]
|
||||
[SysTable]
|
||||
public class SysUserRole : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户Id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(UserId))]
|
||||
public SysUser SysUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "角色Id")]
|
||||
public long RoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToOne, nameof(RoleId))]
|
||||
public SysRole SysRole { get; set; }
|
||||
}
|
201
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysWechatPay.cs
Normal file
201
admin.net.pro/Admin.NET/Admin.NET.Core/Entity/SysWechatPay.cs
Normal file
@ -0,0 +1,201 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统微信支付表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统微信支付表")]
|
||||
[SysTable]
|
||||
[SugarIndex("index_{table}_O", nameof(OrderId), OrderByType.Desc)]
|
||||
public partial class SysWechatPay : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 关联的商户订单号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "关联的商户订单号")]
|
||||
public virtual string? OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "关联的商户订单状态")]
|
||||
public virtual string? OrderStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信商户号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "微信商户号")]
|
||||
[Required]
|
||||
public virtual string MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商AppId
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "服务商AppId")]
|
||||
[Required]
|
||||
public virtual string AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商户订单号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "商户订单号")]
|
||||
[Required]
|
||||
public virtual string OutTradeNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付订单号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "支付订单号")]
|
||||
[Required]
|
||||
public virtual string TransactionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "交易类型")]
|
||||
public string? TradeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "交易状态")]
|
||||
public string? TradeState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易状态描述
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "交易状态描述")]
|
||||
public string? TradeStateDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 付款银行类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "付款银行类型")]
|
||||
public string? BankType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单总金额
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "订单总金额")]
|
||||
public int Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户支付金额
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用户支付金额")]
|
||||
public int? PayerTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付完成时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "支付完成时间")]
|
||||
public DateTimeOffset? SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易结束时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "交易结束时间")]
|
||||
public DateTimeOffset? ExpireTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品描述
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "商品描述")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 场景信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "场景信息")]
|
||||
public string? Scene { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 附加数据
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "附加数据")]
|
||||
public string? Attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 优惠标记
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "优惠标记")]
|
||||
public string? GoodsTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结算信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "结算信息")]
|
||||
public string? Settlement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回调通知地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "回调通知地址")]
|
||||
public string? NotifyUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "备注", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信OpenId标识
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "微信OpenId标识")]
|
||||
public string? OpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务标签,用来区分做什么业务
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Tags标识用来区分这个支付记录对应什么业务从而确定相关联的表名,
|
||||
/// 再结合BusinessId保存了对应的业务数据的ID,就可以确定这个支付
|
||||
/// 记录与哪一条业务数据相关联
|
||||
/// </remarks>
|
||||
[SugarColumn(ColumnDescription = "业务标签,用来区分做什么业务", Length = 64)]
|
||||
public string? Tags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 对应业务的主键
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "对应业务的主键")]
|
||||
public long BusinessId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 付款二维码内容
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "付款二维码内容")]
|
||||
public string? QrcodeContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联微信用户
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(OpenId))]
|
||||
public SysOAuthUser SysOAuthUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子商户号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "子商户号")]
|
||||
public string? SubMerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子商户AppId
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "子商户AppId")]
|
||||
public string? SubAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子商户唯一标识
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "子商户唯一标识")]
|
||||
public string? SubOpenId { get; set; }
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user