From 77a178a6bff106fea37532f04710fd5a22bedd57 Mon Sep 17 00:00:00 2001
From: sunkaixuan <610262374@qq.com>
Date: Mon, 18 Sep 2023 15:06:53 +0800
Subject: [PATCH] Add unit test
---
.../SqlServerTest/SqlServerTest.csproj | 1 +
Src/Asp.Net/SqlServerTest/UnitTest/Main.cs | 1 +
.../SqlServerTest/UnitTest/UnitBizDel.cs | 260 ++++++++++++++++++
3 files changed, 262 insertions(+)
create mode 100644 Src/Asp.Net/SqlServerTest/UnitTest/UnitBizDel.cs
diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj
index 399618fc9..ff9949a9c 100644
--- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj
+++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj
@@ -97,6 +97,7 @@
+
diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs
index 7fc39380d..d99b38f4d 100644
--- a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs
+++ b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs
@@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
+ UnitBizDel.Init();
UnitFilterUpdate.Init();
Unitadf1131.Init();
UEnum2.Init();
diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UnitBizDel.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UnitBizDel.cs
new file mode 100644
index 000000000..006a87c8e
--- /dev/null
+++ b/Src/Asp.Net/SqlServerTest/UnitTest/UnitBizDel.cs
@@ -0,0 +1,260 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OrmTest
+{
+ internal class UnitBizDel
+ {
+ public static void Init()
+ {
+ var db = NewUnitTest.Db;
+ db.CodeFirst.InitTables();
+ db.Deleteable()
+ .Where(t => long.Parse(t.Id) > 0)
+ .IsLogic()
+ .ExecuteCommandAsync("Deleted", true, "UpdateTime", "UpdateUserId", "111")
+ .GetAwaiter().GetResult();
+
+ db.Deleteable()
+ .Where(t => long.Parse(t.Id) > 0)
+ .IsLogic()
+ .ExecuteCommand ("Deleted", true, "UpdateTime", "UpdateUserId", "111")
+ ;
+ }
+ ///
+ ///系统操作日志表
+ ///
+ public partial class SysLogOp
+ {
+ public SysLogOp()
+ {
+
+
+ }
+ ///
+ /// Desc:Id
+ /// Default:
+ /// Nullable:False
+ ///
+ [SugarColumn(IsPrimaryKey = true)]
+ public string Id { get; set; }
+
+ ///
+ /// Desc:请求方式
+ /// Default:
+ /// Nullable:True
+ ///
+ public string HttpMethod { get; set; }
+
+ ///
+ /// Desc:请求地址
+ /// Default:
+ /// Nullable:True
+ ///
+ public string RequestUrl { get; set; }
+
+ ///
+ /// Desc:请求参数
+ /// Default:
+ /// Nullable:True
+ ///
+ public string RequestParam { get; set; }
+
+ ///
+ /// Desc:返回结果
+ /// Default:
+ /// Nullable:True
+ ///
+ public string ReturnResult { get; set; }
+
+ ///
+ /// Desc:事件Id
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? EventId { get; set; }
+
+ ///
+ /// Desc:线程Id
+ /// Default:
+ /// Nullable:True
+ ///
+ public int? ThreadId { get; set; }
+
+ ///
+ /// Desc:请求跟踪Id
+ /// Default:
+ /// Nullable:True
+ ///
+ public string TraceId { get; set; }
+
+ ///
+ /// Desc:异常信息
+ /// Default:
+ /// Nullable:True
+ ///
+ public string Exception { get; set; }
+
+ ///
+ /// Desc:日志消息Json
+ /// Default:
+ /// Nullable:True
+ ///
+ public string Message { get; set; }
+
+ ///
+ /// Desc:模块名称
+ /// Default:
+ /// Nullable:True
+ ///
+ public string ControllerName { get; set; }
+
+ ///
+ /// Desc:方法名称
+ /// Default:
+ /// Nullable:True
+ ///
+ public string ActionName { get; set; }
+
+ ///
+ /// Desc:显示名称
+ /// Default:
+ /// Nullable:True
+ ///
+ public string DisplayTitle { get; set; }
+
+ ///
+ /// Desc:执行状态
+ /// Default:
+ /// Nullable:True
+ ///
+ public string Status { get; set; }
+
+ ///
+ /// Desc:IP地址
+ /// Default:
+ /// Nullable:True
+ ///
+ public string RemoteIp { get; set; }
+
+ ///
+ /// Desc:登录地点
+ /// Default:
+ /// Nullable:True
+ ///
+ public string Location { get; set; }
+
+ ///
+ /// Desc:经度
+ /// Default:
+ /// Nullable:True
+ ///
+ public double? Longitude { get; set; }
+
+ ///
+ /// Desc:维度
+ /// Default:
+ /// Nullable:True
+ ///
+ public double? Latitude { get; set; }
+
+ ///
+ /// Desc:浏览器
+ /// Default:
+ /// Nullable:True
+ ///
+ public string Browser { get; set; }
+
+ ///
+ /// Desc:操作系统
+ /// Default:
+ /// Nullable:True
+ ///
+ public string Os { get; set; }
+
+ ///
+ /// Desc:操作用时
+ /// Default:
+ /// Nullable:True
+ ///
+ public long? Elapsed { get; set; }
+
+ ///
+ /// Desc:日志时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? LogDateTime { get; set; }
+
+
+
+ ///
+ /// Desc:账号
+ /// Default:
+ /// Nullable:True
+ ///
+ public string Account { get; set; }
+
+ ///
+ /// Desc:真实姓名
+ /// Default:
+ /// Nullable:True
+ ///
+ public string RealName { get; set; }
+
+ ///
+ /// Desc:租户Id
+ /// Default:
+ /// Nullable:True
+ ///
+ public long? TenantId { get; set; }
+
+ ///
+ /// Desc:创建时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? CreateTime { get; set; }
+
+ ///
+ /// Desc:更新时间
+ /// Default:
+ /// Nullable:True
+ ///
+ public DateTime? UpdateTime { get; set; }
+
+ ///
+ /// Desc:创建者Id
+ /// Default:
+ /// Nullable:True
+ ///
+ public string CreateUserId { get; set; }
+
+ ///
+ /// Desc:修改者Id
+ /// Default:
+ /// Nullable:True
+ ///
+ public string UpdateUserId { get; set; }
+
+ ///
+ /// Desc:软删除
+ /// Default:0
+ /// Nullable:False
+ ///
+ public bool Deleted { get; set; }
+
+ ///
+ /// Desc:版本号
+ /// Default:1
+ /// Nullable:True
+ ///
+ public int? Version { get; set; }
+
+ }
+ }
+}