update 更改操作日志是否成功的类型为bool

This commit is contained in:
2021-04-26 14:02:22 +08:00
parent 26919bf713
commit 789b3b88d2
7 changed files with 6767 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ namespace Ewide.Core
/// 是否执行成功Y-是N-否) /// 是否执行成功Y-是N-否)
/// </summary> /// </summary>
[Comment("是否执行成功")] [Comment("是否执行成功")]
public string Success { get; set; } public bool? Success { get; set; }
/// <summary> /// <summary>
/// 具体消息 /// 具体消息

View File

@@ -38,7 +38,7 @@ namespace Ewide.Core
{ {
Name = descAtt != null ? descAtt.Description : actionDescriptor.ActionName, Name = descAtt != null ? descAtt.Description : actionDescriptor.ActionName,
OpType = 1, OpType = 1,
Success = isRequestSucceed ? YesOrNot.Y.ToString() : YesOrNot.N.ToString(), Success = isRequestSucceed,
//Message = isRequestSucceed ? "成功" : "失败", //Message = isRequestSucceed ? "成功" : "失败",
Ip = httpContext.GetRemoteIpAddressToIPv4(), Ip = httpContext.GetRemoteIpAddressToIPv4(),
Location = httpRequest.GetRequestUrlAddress(), Location = httpRequest.GetRequestUrlAddress(),

View File

@@ -20,7 +20,7 @@ namespace Ewide.Core.Service
/// <summary> /// <summary>
/// 是否执行成功Y-是N-否) /// 是否执行成功Y-是N-否)
/// </summary> /// </summary>
public string Success { get; set; } public bool? Success { get; set; }
/// <summary> /// <summary>
/// 具体消息 /// 具体消息

View File

@@ -33,12 +33,12 @@ namespace Ewide.Core.Service
public async Task<dynamic> QueryOpLogPageList([FromQuery] OpLogInput input) public async Task<dynamic> QueryOpLogPageList([FromQuery] OpLogInput input)
{ {
var name = !string.IsNullOrEmpty(input.Name?.Trim()); var name = !string.IsNullOrEmpty(input.Name?.Trim());
var success = !string.IsNullOrEmpty(input.Success?.Trim()); var success = input.Success.HasValue;
var searchBeginTime = !string.IsNullOrEmpty(input.SearchBeginTime?.Trim()); var searchBeginTime = !string.IsNullOrEmpty(input.SearchBeginTime?.Trim());
var opLogs = await _sysOpLogRep.DetachedEntities var opLogs = await _sysOpLogRep.DetachedEntities
.Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%"))) .Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")))
.Where(input.OpType > 0, u => u.OpType == input.OpType) .Where(input.OpType > 0, u => u.OpType == input.OpType)
.Where(success, u => u.Success == input.Success.Trim()) .Where(success, u => u.Success == input.Success.Value)
.Where(searchBeginTime, u => u.OpTime >= DateTime.Parse(input.SearchBeginTime.Trim()) && .Where(searchBeginTime, u => u.OpTime >= DateTime.Parse(input.SearchBeginTime.Trim()) &&
u.OpTime <= DateTime.Parse(input.SearchEndTime.Trim())) u.OpTime <= DateTime.Parse(input.SearchEndTime.Trim()))
.OrderByDescending(u => u.Id) .OrderByDescending(u => u.Id)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Ewide.Database.Migrations.Migrations
{
public partial class Init20210426a : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<bool>(
name: "Success",
table: "sys_log_op",
type: "tinyint(1)",
nullable: true,
comment: "是否执行成功",
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true,
oldComment: "是否执行成功");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Success",
table: "sys_log_op",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
comment: "是否执行成功",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldNullable: true,
oldComment: "是否执行成功");
}
}
}

View File

@@ -2681,8 +2681,8 @@ namespace Ewide.Database.Migrations.Migrations
.HasColumnType("longtext CHARACTER SET utf8mb4") .HasColumnType("longtext CHARACTER SET utf8mb4")
.HasComment("返回结果"); .HasComment("返回结果");
b.Property<string>("Success") b.Property<bool?>("Success")
.HasColumnType("longtext CHARACTER SET utf8mb4") .HasColumnType("tinyint(1)")
.HasComment("是否执行成功"); .HasComment("是否执行成功");
b.Property<string>("Url") b.Property<string>("Url")