代码优化

master
xiaochanghai 1 year ago
parent a50ccd0a7d
commit 38ac50351e
  1. 5
      Tiobon.Core.Api/Controllers/BlogController.cs
  2. 10
      Tiobon.Core.Api/Controllers/DbFirst/DbFirstController.cs
  3. 19
      Tiobon.Core.Api/Controllers/DbFirst/MigrateController.cs
  4. 2
      Tiobon.Core.Api/Controllers/DepartmentController.cs
  5. 2
      Tiobon.Core.Api/Controllers/HealthCheckController.cs
  6. 2
      Tiobon.Core.Api/Controllers/ImgController.cs
  7. 2
      Tiobon.Core.Api/Controllers/LoginController.cs
  8. 2
      Tiobon.Core.Api/Controllers/ModuleController.cs
  9. 2
      Tiobon.Core.Api/Controllers/MonitorController.cs
  10. 2
      Tiobon.Core.Api/Controllers/NacosController.cs
  11. 2
      Tiobon.Core.Api/Controllers/PayController.cs
  12. 2
      Tiobon.Core.Api/Controllers/PermissionController.cs
  13. 2
      Tiobon.Core.Api/Controllers/RoleController.cs
  14. 2
      Tiobon.Core.Api/Controllers/SignalRTestController.cs
  15. 2
      Tiobon.Core.Api/Controllers/SplitDemoController.cs
  16. 121
      Tiobon.Core.Api/Controllers/Systems/CacheManageController.cs
  17. 8
      Tiobon.Core.Api/Controllers/Systems/DataBaseController.cs
  18. 8
      Tiobon.Core.Api/Controllers/Systems/DynamicCodeFirstController.cs
  19. 2
      Tiobon.Core.Api/Controllers/TasksQzController.cs
  20. 10
      Tiobon.Core.Api/Controllers/Tenant/TenantByDbController.cs
  21. 10
      Tiobon.Core.Api/Controllers/Tenant/TenantByIdController.cs
  22. 10
      Tiobon.Core.Api/Controllers/Tenant/TenantByTableController.cs
  23. 11
      Tiobon.Core.Api/Controllers/Tenant/TenantManagerController.cs
  24. 2
      Tiobon.Core.Api/Controllers/TopicController.cs
  25. 2
      Tiobon.Core.Api/Controllers/TopicDetailController.cs
  26. 2
      Tiobon.Core.Api/Controllers/TransactionController.cs
  27. 2
      Tiobon.Core.Api/Controllers/UserController.cs
  28. 2
      Tiobon.Core.Api/Controllers/UserRoleController.cs
  29. 2
      Tiobon.Core.Api/Controllers/ValuesController.cs
  30. 2
      Tiobon.Core.Api/Controllers/WeChatCompanyController.cs
  31. 2
      Tiobon.Core.Api/Controllers/WeChatConfigController.cs
  32. 2
      Tiobon.Core.Api/Controllers/WeChatController.cs
  33. 2
      Tiobon.Core.Api/Controllers/WeChatPushLogController.cs
  34. 2
      Tiobon.Core.Api/Controllers/WeChatSubController.cs
  35. 7
      Tiobon.Core.Api/Controllers/v1/ApbController.cs
  36. 11
      Tiobon.Core.Api/Controllers/v2/ApbController.cs
  37. 29
      Tiobon.Core.Extensions/ServiceExtensions/SwaggerSetup.cs

@ -1,5 +1,4 @@
using Tiobon.Core.SwaggerHelper; using Serilog;
using Serilog;
using StackExchange.Profiling; using StackExchange.Profiling;
using static Tiobon.Core.Extensions.CustomApiVersion; using static Tiobon.Core.Extensions.CustomApiVersion;
@ -9,7 +8,7 @@ namespace Tiobon.Core.Controllers
/// 博客管理 /// 博客管理
/// </summary> /// </summary>
[Produces("application/json")] [Produces("application/json")]
[Route("api/Tiobon")] [Route("api/Tiobon"), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class TiobonController : BaseApiController public class TiobonController : BaseApiController
{ {
public ITiobonArticleServices _TiobonArticleServices { get; set; } public ITiobonArticleServices _TiobonArticleServices { get; set; }

@ -1,17 +1,11 @@
using Tiobon.Core.Common; using Tiobon.Core.Common.DB;
using Tiobon.Core.Common.DB;
using Tiobon.Core.Common.Seed; using Tiobon.Core.Common.Seed;
using Tiobon.Core.Model;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Hosting;
using SqlSugar; using SqlSugar;
using System.Linq;
namespace Tiobon.Core.Controllers namespace Tiobon.Core.Controllers
{ {
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Assistant)]
//[Authorize(Permissions.Name)] //[Authorize(Permissions.Name)]
public class DbFirstController : ControllerBase public class DbFirstController : ControllerBase
{ {

@ -1,25 +1,10 @@
using Tiobon.Core.Common.Helper; using Magicodes.ExporterAndImporter.Core;
using Tiobon.Core.IServices;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tiobon.Core.Repository.UnitOfWorks;
namespace Tiobon.Core.Controllers namespace Tiobon.Core.Controllers
{ {
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Assistant)]
//[Authorize(Permissions.Name)] //[Authorize(Permissions.Name)]
public class MigrateController : ControllerBase public class MigrateController : ControllerBase
{ {

@ -2,7 +2,7 @@
{ {
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class DepartmentController : BaseApiController public class DepartmentController : BaseApiController
{ {
private readonly IDepartmentServices _departmentServices; private readonly IDepartmentServices _departmentServices;

@ -4,7 +4,7 @@
/// 健康检查 /// 健康检查
/// </summary> /// </summary>
[Route("[controller]")] [Route("[controller]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class HealthCheckController : ControllerBase public class HealthCheckController : ControllerBase
{ {
/// <summary> /// <summary>

@ -5,7 +5,7 @@
/// </summary> /// </summary>
[Route("api/[controller]")] [Route("api/[controller]")]
[ApiController] [ApiController]
[Authorize] [Authorize, ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class ImgController : BaseApiController public class ImgController : BaseApiController
{ {

@ -12,7 +12,7 @@ namespace Tiobon.Core.Controllers
/// 登录管理【无权限】 /// 登录管理【无权限】
/// </summary> /// </summary>
[Produces("application/json")] [Produces("application/json")]
[Route("api/Login")] [Route("api/Login"), ApiExplorerSettings(GroupName = Grouping.GroupName_Auth)]
[AllowAnonymous] [AllowAnonymous]
public class LoginController : BaseApiController public class LoginController : BaseApiController
{ {

@ -5,7 +5,7 @@
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class ModuleController : BaseApiController public class ModuleController : BaseApiController
{ {
readonly IModuleServices _moduleServices; readonly IModuleServices _moduleServices;

@ -8,7 +8,7 @@ namespace Tiobon.Core.Controllers
{ {
[Route("api/[Controller]/[action]")] [Route("api/[Controller]/[action]")]
[ApiController] [ApiController]
[AllowAnonymous] [AllowAnonymous, ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class MonitorController : BaseApiController public class MonitorController : BaseApiController
{ {
private readonly IHubContext<ChatHub> _hubContext; private readonly IHubContext<ChatHub> _hubContext;

@ -7,7 +7,7 @@ namespace Tiobon.Core.Api.Controllers
/// </summary> /// </summary>
[Produces("application/json")] [Produces("application/json")]
[Route("api/[Controller]/[action]")] [Route("api/[Controller]/[action]")]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class NacosController : BaseApiController public class NacosController : BaseApiController
{ {

@ -5,7 +5,7 @@
/// </summary> /// </summary>
[Produces("application/json")] [Produces("application/json")]
[Route("api/Pay")] [Route("api/Pay")]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class PayController : Controller public class PayController : Controller
{ {
private readonly ILogger<PayController> _logger; private readonly ILogger<PayController> _logger;

@ -10,7 +10,7 @@ namespace Tiobon.Core.Controllers
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class PermissionController : BaseApiController public class PermissionController : BaseApiController
{ {
readonly IUnitOfWorkManage _unitOfWorkManage; readonly IUnitOfWorkManage _unitOfWorkManage;

@ -5,7 +5,7 @@
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class RoleController : BaseApiController public class RoleController : BaseApiController
{ {
readonly IRoleServices _roleServices; readonly IRoleServices _roleServices;

@ -8,7 +8,7 @@ namespace Tiobon.Core.Api.Controllers;
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize] [Authorize, ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class SignalRTestController : BaseApiController public class SignalRTestController : BaseApiController
{ {
private readonly IHubContext<ChatHub, IChatClient> _hubContext; private readonly IHubContext<ChatHub, IChatClient> _hubContext;

@ -5,7 +5,7 @@
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class SplitDemoController : ControllerBase public class SplitDemoController : ControllerBase
{ {
readonly ISplitDemoServices splitDemoServices; readonly ISplitDemoServices splitDemoServices;

@ -1,81 +1,76 @@
using Tiobon.Core.Common.Caches; using Tiobon.Core.Common.Caches;
using Tiobon.Core.Controllers;
using Tiobon.Core.Model;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Tiobon.Core.Api.Controllers.Systems; namespace Tiobon.Core.Api.Controllers.Systems;
/// <summary> /// <summary>
/// 缓存管理 /// 缓存管理
/// </summary> /// </summary>
[Route("api/Systems/[controller]")] [Route("api/Systems/[controller]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Assistant)]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name)]
public class CacheManageController : BaseApiController public class CacheManageController : BaseApiController
{ {
private readonly ICaching _caching; private readonly ICaching _caching;
public CacheManageController(ICaching caching) public CacheManageController(ICaching caching)
{ {
_caching = caching; _caching = caching;
} }
/// <summary> /// <summary>
/// 获取全部缓存 /// 获取全部缓存
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public async Task<MessageModel<List<string>>> Get() public async Task<MessageModel<List<string>>> Get()
{ {
return Success(await _caching.GetAllCacheKeysAsync()); return Success(await _caching.GetAllCacheKeysAsync());
} }
/// <summary> /// <summary>
/// 获取缓存 /// 获取缓存
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet("{key}")] [HttpGet("{key}")]
public async Task<MessageModel<string>> Get(string key) public async Task<MessageModel<string>> Get(string key)
{ {
return Success<string>(await _caching.GetStringAsync(key)); return Success<string>(await _caching.GetStringAsync(key));
} }
/// <summary> /// <summary>
/// 新增 /// 新增
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<MessageModel> Post([FromQuery] string key, [FromQuery] string value, [FromQuery] int? expire) public async Task<MessageModel> Post([FromQuery] string key, [FromQuery] string value, [FromQuery] int? expire)
{ {
if (expire.HasValue) if (expire.HasValue)
await _caching.SetStringAsync(key, value, TimeSpan.FromMilliseconds(expire.Value)); await _caching.SetStringAsync(key, value, TimeSpan.FromMilliseconds(expire.Value));
else else
await _caching.SetStringAsync(key, value); await _caching.SetStringAsync(key, value);
return Success(); return Success();
} }
/// <summary> /// <summary>
/// 删除全部缓存 /// 删除全部缓存
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpDelete] [HttpDelete]
public async Task<MessageModel> Delete() public async Task<MessageModel> Delete()
{ {
await _caching.RemoveAllAsync(); await _caching.RemoveAllAsync();
return Success(); return Success();
} }
/// <summary> /// <summary>
/// 删除缓存 /// 删除缓存
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("{key}")] [Route("{key}")]
[HttpDelete] [HttpDelete]
public async Task<MessageModel> Delete(string key) public async Task<MessageModel> Delete(string key)
{ {
await _caching.RemoveAsync(key); await _caching.RemoveAsync(key);
return Success(); return Success();
} }
} }

@ -1,14 +1,8 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Tiobon.Core.Common;
using Tiobon.Core.Common.DB; using Tiobon.Core.Common.DB;
using Tiobon.Core.Controllers;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
using Tiobon.Core.Model.Systems.DataBase; using Tiobon.Core.Model.Systems.DataBase;
using Tiobon.Core.Model.Tenants; using Tiobon.Core.Model.Tenants;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar; using SqlSugar;
namespace Tiobon.Core.Api.Controllers.Systems; namespace Tiobon.Core.Api.Controllers.Systems;
@ -17,7 +11,7 @@ namespace Tiobon.Core.Api.Controllers.Systems;
/// 数据库管理 /// 数据库管理
/// </summary> /// </summary>
[Route("api/Systems/[controller]/[action]")] [Route("api/Systems/[controller]/[action]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Assistant)]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name)]
public class DataBaseController : BaseApiController public class DataBaseController : BaseApiController
{ {

@ -1,11 +1,5 @@
using Tiobon.Core.Common.DB.Extension; using Tiobon.Core.Common.DB.Extension;
using Tiobon.Core.Controllers;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models.RootTkey; using Tiobon.Core.Model.Models.RootTkey;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NetTaste;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using SqlSugar; using SqlSugar;
namespace Tiobon.Core.Api.Controllers.Systems; namespace Tiobon.Core.Api.Controllers.Systems;
@ -14,7 +8,7 @@ namespace Tiobon.Core.Api.Controllers.Systems;
/// 动态建表 CURD /// 动态建表 CURD
/// </summary> /// </summary>
[Route("api/Systems/[controller]/[action]")] [Route("api/Systems/[controller]/[action]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Assistant)]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name)]
public class DynamicCodeFirstController : BaseApiController public class DynamicCodeFirstController : BaseApiController
{ {

@ -6,7 +6,7 @@ namespace Tiobon.Core.Controllers
{ {
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class TasksQzController : ControllerBase public class TasksQzController : ControllerBase
{ {
private readonly ITasksQzServices _tasksQzServices; private readonly ITasksQzServices _tasksQzServices;

@ -1,10 +1,4 @@
using Tiobon.Core.Common.HttpContextUser; using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Controllers;
using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Tiobon.Core.Api.Controllers.Tenant; namespace Tiobon.Core.Api.Controllers.Tenant;
@ -13,7 +7,7 @@ namespace Tiobon.Core.Api.Controllers.Tenant;
/// </summary> /// </summary>
[Produces("application/json")] [Produces("application/json")]
[Route("api/Tenant/ByDb")] [Route("api/Tenant/ByDb")]
[Authorize] [Authorize, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class TenantByDbController : BaseApiController public class TenantByDbController : BaseApiController
{ {
private readonly IBaseServices<SubLibraryBusinessTable> _services; private readonly IBaseServices<SubLibraryBusinessTable> _services;

@ -1,10 +1,4 @@
using Tiobon.Core.Common.HttpContextUser; using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Controllers;
using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Tiobon.Core.Api.Controllers.Tenant; namespace Tiobon.Core.Api.Controllers.Tenant;
@ -13,7 +7,7 @@ namespace Tiobon.Core.Api.Controllers.Tenant;
/// </summary> /// </summary>
[Produces("application/json")] [Produces("application/json")]
[Route("api/Tenant/ById")] [Route("api/Tenant/ById")]
[Authorize] [Authorize, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class TenantByIdController : BaseApiController public class TenantByIdController : BaseApiController
{ {
private readonly IBaseServices<BusinessTable> _services; private readonly IBaseServices<BusinessTable> _services;

@ -1,10 +1,4 @@
using Tiobon.Core.Common.HttpContextUser; using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Controllers;
using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Tiobon.Core.Api.Controllers.Tenant; namespace Tiobon.Core.Api.Controllers.Tenant;
@ -13,7 +7,7 @@ namespace Tiobon.Core.Api.Controllers.Tenant;
/// </summary> /// </summary>
[Produces("application/json")] [Produces("application/json")]
[Route("api/Tenant/ByTable")] [Route("api/Tenant/ByTable")]
[Authorize] [Authorize, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class TenantByTableController : BaseApiController public class TenantByTableController : BaseApiController
{ {
private readonly IBaseServices<MultiBusinessTable> _services; private readonly IBaseServices<MultiBusinessTable> _services;

@ -1,18 +1,11 @@
using Tiobon.Core.Controllers; namespace Tiobon.Core.Api.Controllers.Tenant;
using Tiobon.Core.IServices;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Tiobon.Core.Api.Controllers.Tenant;
/// <summary> /// <summary>
/// 租户管理 /// 租户管理
/// </summary> /// </summary>
[Produces("application/json")] [Produces("application/json")]
[Route("api/TenantManager")] [Route("api/TenantManager")]
[Authorize] [Authorize, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class TenantManagerController : BaseApiController public class TenantManagerController : BaseApiController
{ {
private readonly ITenantService _services; private readonly ITenantService _services;

@ -4,7 +4,7 @@
/// 类别管理【无权限】 /// 类别管理【无权限】
/// </summary> /// </summary>
[Route("api/[controller]")] [Route("api/[controller]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
[AllowAnonymous] [AllowAnonymous]
public class TopicController : ControllerBase public class TopicController : ControllerBase
{ {

@ -5,7 +5,7 @@
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class TopicDetailController : ControllerBase public class TopicDetailController : ControllerBase
{ {
readonly ITopicServices _topicServices; readonly ITopicServices _topicServices;

@ -1,7 +1,7 @@
namespace Tiobon.Core.Controllers namespace Tiobon.Core.Controllers
{ {
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
[AllowAnonymous] [AllowAnonymous]
public class TransactionController : ControllerBase public class TransactionController : ControllerBase
{ {

@ -7,7 +7,7 @@ namespace Tiobon.Core.Controllers
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class UserController : BaseApiController public class UserController : BaseApiController
{ {
private readonly IUnitOfWorkManage _unitOfWorkManage; private readonly IUnitOfWorkManage _unitOfWorkManage;

@ -6,7 +6,7 @@
[Produces("application/json")] [Produces("application/json")]
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class UserRoleController : Controller public class UserRoleController : Controller
{ {
private readonly ISysUserInfoServices _sysUserInfoServices; private readonly ISysUserInfoServices _sysUserInfoServices;

@ -13,7 +13,7 @@ namespace Tiobon.Core.Controllers
/// Values控制器 /// Values控制器
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
//[Authorize] //[Authorize]
//[Authorize(Roles = "Admin,Client")] //[Authorize(Roles = "Admin,Client")]
//[Authorize(Policy = "SystemOrAdmin")] //[Authorize(Policy = "SystemOrAdmin")]

@ -5,7 +5,7 @@ namespace Tiobon.Core.Controllers
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_WeChat)]
public partial class WeChatCompanyController : Controller public partial class WeChatCompanyController : Controller
{ {
readonly IWeChatCompanyServices _WeChatCompanyServices; readonly IWeChatCompanyServices _WeChatCompanyServices;

@ -5,7 +5,7 @@ namespace Tiobon.Core.Controllers
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_WeChat)]
public partial class WeChatConfigController : Controller public partial class WeChatConfigController : Controller
{ {
readonly IWeChatConfigServices _WeChatConfigServices; readonly IWeChatConfigServices _WeChatConfigServices;

@ -5,7 +5,7 @@
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_WeChat)]
public partial class WeChatController : Controller public partial class WeChatController : Controller
{ {
readonly IWeChatConfigServices _weChatConfigServices; readonly IWeChatConfigServices _weChatConfigServices;

@ -5,7 +5,7 @@ namespace Tiobon.Core.Controllers
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_WeChat)]
public partial class WeChatPushLogController : Controller public partial class WeChatPushLogController : Controller
{ {
readonly IWeChatPushLogServices _WeChatPushLogServices; readonly IWeChatPushLogServices _WeChatPushLogServices;

@ -5,7 +5,7 @@ namespace Tiobon.Core.Controllers
/// </summary> /// </summary>
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_WeChat)]
public partial class WeChatSubController : Controller public partial class WeChatSubController : Controller
{ {
readonly IWeChatSubServices _WeChatSubServices; readonly IWeChatSubServices _WeChatSubServices;

@ -1,12 +1,9 @@
using System.Collections.Generic; using static Tiobon.Core.Extensions.CustomApiVersion;
using Tiobon.Core.SwaggerHelper;
using Microsoft.AspNetCore.Mvc;
using static Tiobon.Core.Extensions.CustomApiVersion;
namespace Tiobon.Core.Controllers.v1 namespace Tiobon.Core.Controllers.v1
{ {
[Route("api/[controller]")] [Route("api/[controller]")]
[ApiController] [ApiController, ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class ApbController : ControllerBase public class ApbController : ControllerBase
{ {

@ -1,15 +1,8 @@
using Tiobon.Core.SwaggerHelper; namespace Tiobon.Core.Controllers.v2
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using static Tiobon.Core.Extensions.CustomApiVersion;
namespace Tiobon.Core.Controllers.v2
{ {
[CustomRoute(ApiVersions.V2)]
//[Route("api/[controller]")] //[Route("api/[controller]")]
[ApiController] [ApiController]
[Authorize(Permissions.Name)] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class ApbController : ControllerBase public class ApbController : ControllerBase
{ {

@ -187,6 +187,17 @@ namespace Tiobon.Core.Extensions
} }
}, },
new SwaggerApiInfo new SwaggerApiInfo
{
UrlPrefix = Grouping.GroupName_Assistant,
Name = "工具模块",
OpenApiInfo = new OpenApiInfo
{
Version = version,
Title = "工具模块",
Description = "自助测量程序/中央站...",
}
},
new SwaggerApiInfo
{ {
UrlPrefix = Grouping.GroupName_Other, UrlPrefix = Grouping.GroupName_Other,
Name = "其他模块", Name = "其他模块",
@ -196,6 +207,16 @@ namespace Tiobon.Core.Extensions
Title = "其他模块", Title = "其他模块",
Description = "其他...", Description = "其他...",
} }
}, new SwaggerApiInfo
{
UrlPrefix = Grouping.GroupName_WeChat,
Name = "微信模块",
OpenApiInfo = new OpenApiInfo
{
Version = version,
Title = "微信模块",
Description = "小程序..."
}
}, },
new SwaggerApiInfo new SwaggerApiInfo
{ {
@ -249,6 +270,14 @@ namespace Tiobon.Core.Extensions
/// Ghra /// Ghra
/// </summary> /// </summary>
public const string GroupName_Ghra = "Ghra"; public const string GroupName_Ghra = "Ghra";
/// <summary>
/// 辅助工具
/// </summary>
public const string GroupName_Assistant = "assistant";
/// <summary>
/// 微信
/// </summary>
public const string GroupName_WeChat = " wechat";
} }
} }

Loading…
Cancel
Save