:recycle:代码重构

This commit is contained in:
不做码农
2023-09-02 17:55:34 +08:00
parent c65952202a
commit be515339fe
176 changed files with 372 additions and 245 deletions
@@ -11,7 +11,6 @@ namespace ZR.Admin.WebApi.Controllers
/// 文章目录Controller
/// </summary>
[Route("article/ArticleCategory")]
[Tags("文章目录")]
[ApiExplorerSettings(GroupName = "article")]
public class ArticleCategoryController : BaseController
{
@@ -13,7 +13,6 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary>
[Verify]
[Route("article")]
[Tags("文章管理")]
[ApiExplorerSettings(GroupName = "article")]
public class ArticleController : BaseController
{
@@ -89,7 +88,7 @@ namespace ZR.Admin.WebApi.Controllers
var model = response.Adapt<ArticleDto>();
if (model.IsPublic == 0 && userId != model.UserId)
{
return ToResponse(Infrastructure.ResultCode.CUSTOM_ERROR, "访问失败");
return ToResponse(ResultCode.CUSTOM_ERROR, "访问失败");
}
if (model != null)
{
@@ -1,5 +1,4 @@
using Infrastructure.Extensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
@@ -18,7 +17,6 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary>
[Verify]
[Route("tool/gen")]
[Tags("代码生成CodeGenerator")]
[ApiExplorerSettings(GroupName = "sys")]
public class CodeGeneratorController : BaseController
{
@@ -14,7 +14,6 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary>
[Verify]
[Route("system/CommonLang")]
[Tags("多语言配置CommonLang")]
[ApiExplorerSettings(GroupName = "sys")]
public class CommonLangController : BaseController
{
@@ -14,7 +14,6 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary>
[Verify]
[Route("system/config")]
[Tags("系统配置SysConfig")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysConfigController : BaseController
{
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using System.Collections;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model.System;
using ZR.Model.System.Dto;
@@ -13,7 +12,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/dept")]
[Tags("部门管理SysDept")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysDeptController : BaseController
{
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model;
using ZR.Model.System;
@@ -13,7 +12,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/dict/data")]
[Tags("字典数据SysDictData")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysDictDataController : BaseController
{
@@ -13,7 +13,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/dict/type")]
[Tags("字典数据类型SysDictType")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysDictTypeController : BaseController
{
@@ -12,7 +12,6 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary>
[Verify]
[Route("tool/file")]
[Tags(" 文件存储SysFile")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysFileController : BaseController
{
@@ -12,7 +12,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// <summary>
/// 登录
/// </summary>
[Tags("登录SysLogin")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysLoginController : BaseController
{
@@ -160,7 +159,7 @@ namespace ZR.Admin.WebApi.Controllers.System
/// <returns></returns>
[HttpPost("/register")]
[AllowAnonymous]
[Log(Title = "注册", BusinessType = Infrastructure.Enums.BusinessType.INSERT)]
[Log(Title = "注册", BusinessType = BusinessType.INSERT)]
public IActionResult Register([FromBody] RegisterDto dto)
{
SysConfig config = sysConfigService.GetSysConfigByKey("sys.account.register");
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model.System;
using ZR.Model.System.Dto;
@@ -12,7 +11,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("/system/menu")]
[Tags("菜单管理SysMenu")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysMenuController : BaseController
{
@@ -1,8 +1,6 @@
using Infrastructure.Constant;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using SqlSugar;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Admin.WebApi.Hubs;
using ZR.Model;
@@ -17,7 +15,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/notice")]
[Tags("系统通知SysNotice")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysNoticeController : BaseController
{
@@ -1,7 +1,5 @@
using Infrastructure.Extensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model;
using ZR.Model.System;
@@ -14,7 +12,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/post")]
[Tags("岗位管理SysPost")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysPostController : BaseController
{
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model.System;
using ZR.Model.System.Dto;
@@ -12,7 +11,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/user/profile")]
[Tags("个人中心SysProfile")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysProfileController : BaseController
{
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model;
using ZR.Model.System;
@@ -13,7 +12,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/role")]
[Tags("角色管理SysRole")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysRoleController : BaseController
{
@@ -14,7 +14,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/user")]
[Tags("用户管理SysUser")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysUserController : BaseController
{
@@ -10,7 +10,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("system/userRole")]
[Tags("用户角色管理SysUserRole")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysUserRoleController : BaseController
{
@@ -45,7 +44,7 @@ namespace ZR.Admin.WebApi.Controllers.System
/// <returns></returns>
[HttpPost("create")]
[ActionPermissionFilter(Permission = "system:roleusers:add")]
[Log(Title = "添加角色用户", BusinessType = Infrastructure.Enums.BusinessType.INSERT)]
[Log(Title = "添加角色用户", BusinessType = BusinessType.INSERT)]
public IActionResult Create([FromBody] RoleUsersCreateDto roleUsersCreateDto)
{
var response = SysUserRoleService.InsertRoleUser(roleUsersCreateDto);
@@ -60,7 +59,7 @@ namespace ZR.Admin.WebApi.Controllers.System
/// <returns></returns>
[HttpPost("delete")]
[ActionPermissionFilter(Permission = "system:roleusers:remove")]
[Log(Title = "删除角色用户", BusinessType = Infrastructure.Enums.BusinessType.DELETE)]
[Log(Title = "删除角色用户", BusinessType = BusinessType.DELETE)]
public IActionResult Delete([FromBody] RoleUsersCreateDto roleUsersCreateDto)
{
return SUCCESS(SysUserRoleService.DeleteRoleUserByUserIds(roleUsersCreateDto.RoleId, roleUsersCreateDto.UserIds));
@@ -1,8 +1,6 @@
using Infrastructure.Extensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Quartz;
using SqlSugar;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model.System;
using ZR.Model.System.Dto;
@@ -16,7 +14,6 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary>
[Verify]
[Route("system/Tasks")]
[Tags("计划Tasks")]
[ApiExplorerSettings(GroupName = "sys")]
public class TasksController : BaseController
{
@@ -1,5 +1,4 @@
using Infrastructure.Extensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using ZR.Admin.WebApi.Filters;
using ZR.Model;
@@ -14,7 +13,6 @@ namespace ZR.Admin.WebApi.Controllers.System
/// </summary>
[Verify]
[Route("/monitor/jobLog")]
[Tags("任务日志TasksLog")]
[ApiExplorerSettings(GroupName = "sys")]
public class TasksLogController : BaseController
{
@@ -9,7 +9,6 @@ namespace ZR.Admin.WebApi.Controllers.monitor
/// <summary>
/// 系统监控
/// </summary>
[Tags("系统监控Monitor")]
[ApiExplorerSettings(GroupName = "sys")]
public class MonitorController : BaseController
{
@@ -11,7 +11,6 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary>
[Verify]
[Route("monitor/SqlDiffLog")]
[Tags("差异日志SqlDiffLog")]
[ApiExplorerSettings(GroupName = "sys")]
public class SqlDiffLogController : BaseController
{
@@ -13,7 +13,6 @@ namespace ZR.Admin.WebApi.Controllers.monitor
/// </summary>
[Verify]
[Route("/monitor/logininfor")]
[Tags("登录日志SysLogininfor")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysLogininforController : BaseController
{
@@ -11,7 +11,6 @@ namespace ZR.Admin.WebApi.Controllers.monitor
/// </summary>
[Verify]
[Route("/monitor/operlog")]
[Tags("操作日志SysOperlog")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysOperlogController : BaseController
{
@@ -67,7 +66,7 @@ namespace ZR.Admin.WebApi.Controllers.monitor
{
if (!HttpContextExtension.IsAdmin(HttpContext))
{
return ToResponse(Infrastructure.ResultCode.CUSTOM_ERROR,"操作失败");
return ToResponse(ResultCode.CUSTOM_ERROR,"操作失败");
}
sysOperLogService.CleanOperLog();
@@ -7,9 +7,11 @@ using ZR.Model.System.Dto;
namespace ZR.Admin.WebApi.Controllers.monitor
{
/// <summary>
/// 在线用户
/// </summary>
[Verify]
[Route("monitor/online")]
[Tags("在线用户SysUserOnline")]
[ApiExplorerSettings(GroupName = "sys")]
public class SysUserOnlineController : BaseController
{