From 3aec182f0df7557de7f2e710cd96dc9abdc2d4d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Fri, 1 Dec 2023 15:35:45 +0800
Subject: [PATCH 1/5] =?UTF-8?q?:arrow=5Fdown:=E9=99=8D=E7=BA=A7jnt?=
=?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=8C=85=EF=BC=8C=E6=9C=80=E6=96=B0=E7=89=88?=
=?UTF-8?q?=E6=9C=AC$=E5=BC=80=E5=A4=B4=E7=9A=84=E5=8F=98=E9=87=8F?=
=?UTF-8?q?=E4=BC=9A=E5=8E=BB=E6=8E=89=E5=89=8D=E9=9D=A2=E7=9A=84=E7=A9=BA?=
=?UTF-8?q?=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Infrastructure/ZR.Infrastructure.csproj | 2 +-
ZR.CodeGenerator/ZR.CodeGenerator.csproj | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Infrastructure/ZR.Infrastructure.csproj b/Infrastructure/ZR.Infrastructure.csproj
index e54e04ac..63a8cafa 100644
--- a/Infrastructure/ZR.Infrastructure.csproj
+++ b/Infrastructure/ZR.Infrastructure.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/ZR.CodeGenerator/ZR.CodeGenerator.csproj b/ZR.CodeGenerator/ZR.CodeGenerator.csproj
index 846d34c0..25dea25b 100644
--- a/ZR.CodeGenerator/ZR.CodeGenerator.csproj
+++ b/ZR.CodeGenerator/ZR.CodeGenerator.csproj
@@ -11,7 +11,7 @@
-
+
--
Gitee
From 9f8e7dbecca4284eddca5c8c65c47317f62109a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Mon, 4 Dec 2023 16:11:57 +0800
Subject: [PATCH 2/5] =?UTF-8?q?:sparkles:=20=E6=96=B0=E5=A2=9Egit=E5=8F=8D?=
=?UTF-8?q?=E9=A6=88=E6=8F=90=E4=BA=A4=E6=A8=A1=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitee/ISSUE_TEMPLATE/config.yaml | 81 ++++++++++++++++++++++++++++++
.gitee/ISSUE_TEMPLATE/feature.yaml | 13 +++++
2 files changed, 94 insertions(+)
create mode 100644 .gitee/ISSUE_TEMPLATE/config.yaml
create mode 100644 .gitee/ISSUE_TEMPLATE/feature.yaml
diff --git a/.gitee/ISSUE_TEMPLATE/config.yaml b/.gitee/ISSUE_TEMPLATE/config.yaml
new file mode 100644
index 00000000..168ba239
--- /dev/null
+++ b/.gitee/ISSUE_TEMPLATE/config.yaml
@@ -0,0 +1,81 @@
+name: 问题反馈
+description: 当你在代码中发现了一个 Bug,导致应用崩溃或抛出异常,或者有一个组件存在问题,或者某些地方看起来不对劲。
+title: "[Bug]: "
+labels: ["bug"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ 感谢对项目的支持与关注。在提出问题之前,请确保你已查看相关开发或使用文档:
+ - http://www.izhaorui.cn/doc
+ - type: checkboxes
+ attributes:
+ label: 这个问题是否已经存在?
+ options:
+ - label: 我已经搜索过现有的问题 (https://gitee.com/../../issues)
+ required: true
+ - type: textarea
+ attributes:
+ label: 如何复现
+ description: 请详细告诉我们如何复现你遇到的问题,如涉及代码,可提供一个最小代码示例,并使用反引号```附上它
+ placeholder: |
+ 1. ...
+ 2. ...
+ 3. ...
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: 预期结果
+ description: 请告诉我们你预期会发生什么。
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: 实际结果
+ description: 请告诉我们实际发生了什么。
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: 截图或视频
+ description: 如果可以的话,上传任何关于 bug 的截图。
+ value: |
+ [在这里上传图片]
+ - type: dropdown
+ id: version
+ attributes:
+ label: vue版本
+ description: 你当前正在使用我们软件的哪个前端版本
+ options:
+ - vue3 (默认)
+ - vue2
+ validations:
+ required: true
+ - type: dropdown
+ id: version
+ attributes:
+ label: 运行环境
+ options:
+ - 开发环境 (development)
+ - 生产环境(production)
+ validations:
+ required: true
+ - type: dropdown
+ id: version
+ attributes:
+ label: 应用程序托管
+ options:
+ - 前端iis + 后端iis
+ - 前端nginx + 后端 iis
+ - 前端nginx + 后端自启动
+ - docker
+ validations:
+ required: true
+contact_links:
+ - name: 使用文档
+ url: http://www.izhaorui.cn/doc/
+ about: 官方文档
+ - name: ♥️ VIP 服务 ♥️
+ url: https://www.izhaorui.cn/doc/support.html
+ about: 支持作者
\ No newline at end of file
diff --git a/.gitee/ISSUE_TEMPLATE/feature.yaml b/.gitee/ISSUE_TEMPLATE/feature.yaml
new file mode 100644
index 00000000..7828cb66
--- /dev/null
+++ b/.gitee/ISSUE_TEMPLATE/feature.yaml
@@ -0,0 +1,13 @@
+name: 功能建议
+description: 对本项目提出一个功能建议
+title: "[功能建议]: "
+labels: ["enhancement"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ 感谢对项目的支持与关注。如果你在使用中有什么好的建议欢迎提出来
+ - type: textarea
+ attributes:
+ label: 请输入内容
+ description: 如果可以的话,上传任何关于 功能 的截图。
\ No newline at end of file
--
Gitee
From 18702eaa38f2967ac28e296dd55df98a7e23f959 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=97=E6=AF=8D=E6=90=AC=E8=BF=90=E5=B7=A5?=
<791736813@qq.com>
Date: Tue, 5 Dec 2023 07:55:09 +0000
Subject: [PATCH 3/5] update .gitee/ISSUE_TEMPLATE/config.yaml.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 字母搬运工 <791736813@qq.com>
---
.gitee/ISSUE_TEMPLATE/config.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitee/ISSUE_TEMPLATE/config.yaml b/.gitee/ISSUE_TEMPLATE/config.yaml
index 168ba239..a8c7ac62 100644
--- a/.gitee/ISSUE_TEMPLATE/config.yaml
+++ b/.gitee/ISSUE_TEMPLATE/config.yaml
@@ -70,6 +70,7 @@ body:
- 前端nginx + 后端 iis
- 前端nginx + 后端自启动
- docker
+ - 其他
validations:
required: true
contact_links:
--
Gitee
From 9f6ee330ae8b755124a88a3085f1641e765a4ddf Mon Sep 17 00:00:00 2001
From: xbzhu <5430389+xbzhu@user.noreply.gitee.com>
Date: Wed, 6 Dec 2023 04:01:55 +0000
Subject: [PATCH 4/5] =?UTF-8?q?update=20ZR.Tasks/TaskScheduler/JobBase.cs.?=
=?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=9E=84=E9=80=A0=E5=8F=91?=
=?UTF-8?q?=E6=94=BE=EF=BC=8C=E5=9C=A8=E6=89=A7=E8=A1=8C=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=8E=A5=E6=94=B6Job=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E7=9A=84=E7=BB=93=E6=9E=9C=EF=BC=8C=E5=B0=86=E7=BB=93=E6=9E=9C?=
=?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=9C=A8=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?=
=?UTF-8?q?=E4=B8=AD=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xbzhu <5430389+xbzhu@user.noreply.gitee.com>
---
ZR.Tasks/TaskScheduler/JobBase.cs | 47 ++++++++++++++++++++++++++++++-
1 file changed, 46 insertions(+), 1 deletion(-)
diff --git a/ZR.Tasks/TaskScheduler/JobBase.cs b/ZR.Tasks/TaskScheduler/JobBase.cs
index 11c10018..01fd43f0 100644
--- a/ZR.Tasks/TaskScheduler/JobBase.cs
+++ b/ZR.Tasks/TaskScheduler/JobBase.cs
@@ -1,4 +1,4 @@
-using Infrastructure;
+using Infrastructure;
using NLog;
using Quartz;
using System;
@@ -62,6 +62,51 @@ namespace ZR.Tasks
return logModel;
}
+ ///
+ /// 执行指定任务(接收返回结果)
+ ///
+ /// 作业上下文
+ /// 业务逻辑方法
+ public async Task ExecuteJob(IJobExecutionContext context, Func> job)
+ {
+ double elapsed = 0;
+ int status = 0;
+ string logMsg;
+ try
+ {
+ //var s = context.Trigger.Key.Name;
+ //记录Job时间
+ Stopwatch stopwatch = new Stopwatch();
+ stopwatch.Start();
+ //执行任,并返回结果
+ string result = await job();
+ stopwatch.Stop();
+ elapsed = stopwatch.Elapsed.TotalMilliseconds;
+ logMsg = result.Length <= 2000 ? result : result.Substring(0, 2000);
+ }
+ catch (Exception ex)
+ {
+ JobExecutionException e2 = new(ex)
+ {
+ //true 是立即重新执行任务
+ RefireImmediately = true
+ };
+ status = 1;
+ logMsg = $"Job Run Fail,Exception:{ex.Message}";
+ WxNoticeHelper.SendMsg("任务执行出错", logMsg);
+ }
+
+ var logModel = new SysTasksLog()
+ {
+ Elapsed = elapsed,
+ Status = status.ToString(),
+ JobMessage = logMsg
+ };
+
+ await RecordTaskLog(context, logModel);
+ return logModel;
+ }
+
///
/// 记录到日志
///
--
Gitee
From b01335a125f2a9d2a142f93499765071fa224e39 Mon Sep 17 00:00:00 2001
From: xbzhu <5430389+xbzhu@user.noreply.gitee.com>
Date: Wed, 6 Dec 2023 04:04:23 +0000
Subject: [PATCH 5/5] =?UTF-8?q?update=20ZR.Tasks/TaskScheduler/Job=5FSyncT?=
=?UTF-8?q?est.cs.=20=E5=A2=9E=E5=8A=A0=E5=B8=A6=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E5=80=BC=E7=9A=84Job=20Demo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xbzhu <5430389+xbzhu@user.noreply.gitee.com>
---
ZR.Tasks/TaskScheduler/Job_SyncTest.cs | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/ZR.Tasks/TaskScheduler/Job_SyncTest.cs b/ZR.Tasks/TaskScheduler/Job_SyncTest.cs
index 5494c43f..b9d6b233 100644
--- a/ZR.Tasks/TaskScheduler/Job_SyncTest.cs
+++ b/ZR.Tasks/TaskScheduler/Job_SyncTest.cs
@@ -1,4 +1,4 @@
-using Infrastructure.Attribute;
+using Infrastructure.Attribute;
using Quartz;
using System.Threading.Tasks;
@@ -25,5 +25,23 @@ namespace ZR.Tasks.TaskScheduler
System.Console.WriteLine("job test");
}
+
+
+ //public async Task Execute(IJobExecutionContext context)
+ //{
+ // await ExecuteJob(context, async () =>
+ // {
+ // return await Run(context);
+ // });
+ //}
+
+
+ //public async Task Run()
+ //{
+ // await Task.Delay(1);
+ //TODO 业务逻辑
+ // System.Console.WriteLine("job test");
+ // return "成功";
+ //}
}
}
--
Gitee