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
{
///
/// 导航
///
[Route("api/admin/navigation")]
[ApiController]
[Authorize]
public class AdminNavigationController : ControllerBase
{
private readonly INavigationRepository navigationRepository;
public AdminNavigationController(INavigationRepository navigationRepository)
{
this.navigationRepository = navigationRepository;
}
///
/// 列表 pc 1 移动 2
///
///
[HttpGet("{terminal}")]
public async Task> GetList(int terminal)
{
return await navigationRepository.GetAllAsync(terminal);
}
///
/// 添加导航
///
/// ///
///
[HttpPost]
public async Task Insert(Entity.Navigations.Navigation note)
{
return await navigationRepository.InsertAsync(note);
}
///
/// 修改导航
///
///
///
[HttpPut]
public async Task Update(NavigationUpRequest request)
{
return await navigationRepository.UpdateAsync(request);
}
}
}