升级到net6.0

This commit is contained in:
不做码农
2022-03-06 14:26:05 +08:00
parent 013b6ea4db
commit 7fe07b104c
50 changed files with 306 additions and 495 deletions

View File

@@ -67,7 +67,7 @@ namespace ZR.Admin.WebApi.Controllers
/// <returns></returns>
[HttpGet("getTableList")]
[ActionPermissionFilter(Permission = "tool:gen:list")]
public IActionResult FindListTable(string dbName, string tableName, PagerInfo pager)
public IActionResult FindListTable(string dbName, string? tableName, PagerInfo pager)
{
List<DbTableInfo> list = _CodeGeneraterService.GetAllTables(dbName, tableName, pager);
var page = new PagedInfo<DbTableInfo>
@@ -89,7 +89,7 @@ namespace ZR.Admin.WebApi.Controllers
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "tool:gen:list")]
public IActionResult GetGenTable(string tableName, PagerInfo pagerInfo)
public IActionResult GetGenTable(string? tableName, PagerInfo pagerInfo)
{
//查询原表数据,部分字段映射到代码生成表字段
var rows = GenTableService.GetGenTables(new GenTable() { TableName = tableName }, pagerInfo);
@@ -160,7 +160,7 @@ namespace ZR.Admin.WebApi.Controllers
throw new CustomException("表不能为空");
}
string[] tableNames = tables.Split(',', StringSplitOptions.RemoveEmptyEntries);
string userName = User.Identity.Name;
var userName = HttpContext.GetName();
foreach (var tableName in tableNames)
{
@@ -269,9 +269,9 @@ namespace ZR.Admin.WebApi.Controllers
if (genTableInfo.GenType == "1")
{
string tempPath = WebHostEnvironment.ContentRootPath;
var parentPath = Directory.GetParent(tempPath)?.Parent?.FullName;
//代码生成文件夹路径
dto.GenCodePath = genTableInfo.GenPath.IsEmpty() ? Directory.GetParent(tempPath).FullName : genTableInfo.GenPath;
dto.GenCodePath = genTableInfo.GenPath.IsEmpty() ? parentPath : genTableInfo.GenPath;
}
else
{

View File

@@ -16,6 +16,7 @@ using ZR.Service.System;
using ZR.Model.System;
using Infrastructure.Extensions;
using Microsoft.AspNetCore.Authorization;
using ZR.Model.System.Dto;
namespace ZR.Admin.WebApi.Controllers
{

View File

@@ -2,15 +2,10 @@
using Infrastructure.Enums;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using ZR.Admin.WebApi.Filters;
using ZR.Common;
using ZR.Model;
using ZR.Model.System;
using ZR.Model.System.Dto;
using ZR.Model.Vo;
using ZR.Service.System.IService;
namespace ZR.Admin.WebApi.Controllers.System

View File

@@ -2,13 +2,11 @@
using Infrastructure.Enums;
using Infrastructure.Model;
using Microsoft.AspNetCore.Mvc;
using System;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Common;
using ZR.Model;
using ZR.Model.System;
using ZR.Model.Vo;
using ZR.Service.System.IService;
namespace ZR.Admin.WebApi.Controllers.System

View File

@@ -1,20 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using System;
using Infrastructure;
using Infrastructure;
using Infrastructure.Attribute;
using Infrastructure.Constant;
using Infrastructure.Enums;
using Infrastructure.Model;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using SqlSugar;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Common;
using ZR.Model.Dto;
using ZR.Model.Models;
using ZR.Service.System.IService;
using ZR.Admin.WebApi.Hubs;
using Microsoft.AspNetCore.SignalR;
using Infrastructure.Constant;
using ZR.Common;
using ZR.Model.System;
using ZR.Model.System.Dto;
using ZR.Service.System.IService;
namespace ZR.Admin.WebApi.Controllers.System
{
@@ -99,7 +98,7 @@ namespace ZR.Admin.WebApi.Controllers.System
}
//从 Dto 映射到 实体
var modal = parm.Adapt<SysNotice>().ToCreate(HttpContext);
modal.Create_by = User.Identity.Name;
modal.Create_by = HttpContext.GetName();
modal.Create_time = DateTime.Now;
int result = _SysNoticeService.Insert(modal, it => new

View File

@@ -97,7 +97,7 @@ namespace ZR.Admin.WebApi.Controllers
tasksQz.ID = worker.NextId().ToString();
tasksQz.IsStart = false;
tasksQz.Create_by = User.Identity.Name;
tasksQz.Create_by = HttpContext.GetName();
return SUCCESS(_tasksQzService.Add(tasksQz));
}

View File

@@ -8,7 +8,6 @@ using ZR.Admin.WebApi.Filters;
using ZR.Common;
using ZR.Model;
using ZR.Model.System;
using ZR.Model.Vo;
using ZR.Service.System.IService;
namespace ZR.Admin.WebApi.Controllers.monitor

View File

@@ -6,14 +6,7 @@ using ZR.Admin.WebApi.Filters;
using ZR.Common;
using ZR.Model;
using ZR.Model.System.Dto;
using ZR.Model.System;
using ZR.Model.Vo;
using ZR.Service.System.IService;
using System;
using System.IO;
using OfficeOpenXml;
using Microsoft.AspNetCore.Hosting;
using System.Collections.Generic;
namespace ZR.Admin.WebApi.Controllers.monitor
{