1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 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);
- }
- /// <summary>
- /// 删除导航
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpDelete("{id}")]
- public async Task<bool> DeleteAsync(int id)
- {
- return await navigationRepository.DeleteAsync(id);
- }
-
- }
- }
|