General.Web/Controllers/Admin/NavigationController.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using General.Entities.Models;
using General.Framework;
using General.Mvc.Filters;
using General.Services.Navigation;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace General.Mvc.Controllers.Admin
{
[Route("api/admin/[controller]/[action]")]
[ApiController]
[ServiceFilter(typeof(ResponseLogTimeFilter))]
public class NavigationController : ControllerBase
{
private readonly INavigationService navigationService;
public NavigationController(INavigationService navigationService)
{
this.navigationService = navigationService;
}
/// <summary>
/// 查询导航数据列表
/// </summary>
/// <returns></returns>
[HttpGet]
[ServiceFilter(typeof(AdminCheckFilter))]
public async Task<IActionResult> GetNavigationList(string name, string menuUrl)
{
var list = await navigationService.GetList(name, menuUrl);
return Content(JsonHelper.Serialize(list));
}
/// <summary>
/// 增加网站导航菜单
/// </summary>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(AdminCheckFilter))]
public async Task<IActionResult> AddNavigation([FromForm] tc_navigation model)
{
await navigationService.AddInfo(model);
return Content(JsonHelper.Serialize(new AjaxResult() { code = AjaxResultStateEnum.Ok, message = "增加成功!" }));
}
/// <summary>
/// 编辑网站导航菜单
/// </summary>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(AdminCheckFilter))]
public async Task<IActionResult> EditNavigation([FromForm] tc_navigation model)
后面还有 33 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
