update 更改操作日志是否成功的类型为bool
This commit is contained in:
@@ -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>
|
||||||
/// 具体消息
|
/// 具体消息
|
||||||
|
|||||||
@@ -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(),
|
||||||
|
|||||||
@@ -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>
|
||||||
/// 具体消息
|
/// 具体消息
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
6725
Api/Ewide.Database.Migrations/Migrations/20210426060021_Init20210426a.Designer.cs
generated
Normal file
6725
Api/Ewide.Database.Migrations/Migrations/20210426060021_Init20210426a.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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: "是否执行成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user