From fa7fae95754481967851520c575b33f862bca1af Mon Sep 17 00:00:00 2001
From: zhangpeihang <948869991@qq.com>
Date: Thu, 27 Jan 2022 17:33:50 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20=E5=AD=97=E5=85=B8?=
=?UTF-8?q?=20=E8=8F=9C=E5=8D=95=20=E8=A7=92=E8=89=B2=20=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=20=E6=8E=A7=E5=88=B6=E5=99=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/DictsController.cs | 58 ++++++++++++
.../Controllers/MenusController.cs | 92 +++++++++++++++++++
.../Controllers/RolesController.cs | 91 ++++++++++++++++++
.../Controllers/UsersController.cs | 49 ++++++++++
4 files changed, 290 insertions(+)
create mode 100644 src/vue/api/BootstrapAdmin.Api/Controllers/DictsController.cs
create mode 100644 src/vue/api/BootstrapAdmin.Api/Controllers/MenusController.cs
create mode 100644 src/vue/api/BootstrapAdmin.Api/Controllers/RolesController.cs
create mode 100644 src/vue/api/BootstrapAdmin.Api/Controllers/UsersController.cs
diff --git a/src/vue/api/BootstrapAdmin.Api/Controllers/DictsController.cs b/src/vue/api/BootstrapAdmin.Api/Controllers/DictsController.cs
new file mode 100644
index 00000000..24f94022
--- /dev/null
+++ b/src/vue/api/BootstrapAdmin.Api/Controllers/DictsController.cs
@@ -0,0 +1,58 @@
+// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
+// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
+// Website: https://admin.blazor.zone
+
+using BootstrapAdmin.DataAccess.Models;
+using BootstrapAdmin.Web.Core;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace BootstrapAdmin.Api.Controllers
+{
+ ///
+ /// 字典表维护控制器
+ ///
+ [Route("api/[controller]")]
+ [Authorize]
+ [ApiController]
+ public class DictsController : ControllerBase
+ {
+ private IDict DictService { get; }
+
+ ///
+ ///
+ ///
+ ///
+ public DictsController(IDict dictService) => DictService = dictService;
+
+ ///
+ /// 获取所有字典表数据方法
+ ///
+ ///
+ [HttpGet]
+ public ActionResult> Get()
+ {
+ return DictService.GetAll();
+ }
+ ///
+ /// 保存字典方法
+ ///
+ ///
+ [HttpPost]
+ public bool Post([FromBody] Dict value)
+ {
+ return true;
+ }
+
+ ///
+ /// 删除字典项方法
+ ///
+ ///
+ [HttpDelete]
+ [Authorize(Roles = "Administrators")]
+ public bool Delete([FromBody] IEnumerable value)
+ {
+ return true;
+ }
+ }
+}
diff --git a/src/vue/api/BootstrapAdmin.Api/Controllers/MenusController.cs b/src/vue/api/BootstrapAdmin.Api/Controllers/MenusController.cs
new file mode 100644
index 00000000..bb96555c
--- /dev/null
+++ b/src/vue/api/BootstrapAdmin.Api/Controllers/MenusController.cs
@@ -0,0 +1,92 @@
+// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
+// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
+// Website: https://admin.blazor.zone
+
+using Bootstrap.Admin.Query;
+using Bootstrap.DataAccess;
+using Bootstrap.Security;
+using Longbow.Web.Mvc;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Filters;
+using System.Collections.Generic;
+
+namespace Bootstrap.Admin.Controllers.Api
+{
+ ///
+ ///
+ ///
+ [Route("api/[controller]")]
+ [Authorize]
+ [ApiController]
+ public class MenusController : ControllerBase
+ {
+ ///
+ /// 获得所有菜单列表调用
+ ///
+ ///
+ ///
+ [HttpGet]
+ public QueryData