123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using GxPress.Repository.Interface.Navigation;
- using GxPress.Request.Navigation;
- using GxPress.Result.Navigation;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- namespace GxPress.Api.AdminControllers
- {
- /// <summary>
- /// 导航
- /// </summary>
- [Route("api/admin/navigation")]
- [ApiController]
- [Authorize]
- public class AdminNavigationController : ControllerBase
- {
- private readonly INavigationRepository navigationRepository;
- public AdminNavigationController(INavigationRepository navigationRepository)
- {
- this.navigationRepository = navigationRepository;
- }
- /// <summary>
- /// 列表 pc 1 移动 2
- /// </summary>
- /// <returns></returns>
- [HttpGet("{terminal}")]
- public async Task<IEnumerable<NavigationResult>> GetList(int terminal)
- {
- return await navigationRepository.GetAllAsync(terminal);
- }
- /// <summary>
- /// 添加导航
- /// </summary>
- /// /// <param name="note"></param>
- /// <returns></returns>
- [HttpPost]
- public async Task<int> Insert(Entity.Navigations.Navigation note)
- {
- return await navigationRepository.InsertAsync(note);
- }
- /// <summary>
- /// 修改导航
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [HttpPut]
- public async Task<bool> Update(NavigationUpRequest request)
- {
- return await navigationRepository.UpdateAsync(request);
- }
- }
- }
|