优化代码

This commit is contained in:
不做码农
2022-03-05 16:48:40 +08:00
parent 6e8e649e88
commit acc10fde4a
5 changed files with 8 additions and 30 deletions

View File

@@ -37,12 +37,12 @@ namespace ZR.Admin.WebApi.Extensions
ConfigId = "0",
ConnectionString = connStr,
DbType = (IocDbType)dbType,
IsAutoCloseConnection = true//自动释放
IsAutoCloseConnection = true
}, new IocConfig() {
ConfigId = "1",
ConnectionString = connStrBus,
DbType = (IocDbType)dbType_bus,
IsAutoCloseConnection = true//自动释放
IsAutoCloseConnection = true
}
});
//每次Sql执行前事件

View File

@@ -34,21 +34,11 @@ namespace ZR.Admin.WebApi.Extensions
if (types.GetProperty("Create_by") != null && context != null)
{
types.GetProperty("Create_by").SetValue(source, context.GetName(), null);
// types.GetProperty("CreateName").SetValue(source, userSession.UserName, null);
}
if (types.GetProperty("UserId") != null && context != null)
{
types.GetProperty("UserId").SetValue(source, context.GetUId(), null);
}
//if (types.GetProperty("UpdateID") != null)
//{
// types.GetProperty("UpdateID").SetValue(source, userSession.UserID, null);
// types.GetProperty("UpdateName").SetValue(source, userSession.UserName, null);
//}
return source;
}

View File

@@ -34,8 +34,6 @@ namespace ZR.Admin.WebApi.Extensions
{
var _tasksQzService = (ISysTasksQzService)App.GetRequiredService(typeof(ISysTasksQzService));
//此写法不通过有待研究
//var _tasksQzService2 = (ISysTasksQzService)services.GetRequiredService(typeof(SysTasksQzService));
ITaskSchedulerServer _schedulerServer = App.GetRequiredService<ITaskSchedulerServer>();
var tasks = _tasksQzService.GetList(m => m.IsStart);