43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using Dlhis.Basic.Organization.Response;
|
|
using Dlhis.Basic.Organization.Services;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Dlhis.Basic.Organization.Controllers;
|
|
|
|
/// <summary>
|
|
/// sap部门
|
|
/// </summary>
|
|
[Authorize]
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class DepartmentsController : ControllerBase
|
|
{
|
|
private readonly IDepartmentService _departmentService;
|
|
|
|
public DepartmentsController(IDepartmentService departmentService)
|
|
{
|
|
_departmentService = departmentService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取部门树
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet("tree")]
|
|
public async Task<List<DepartmentTreeResponse>> GetTreeAsync()
|
|
{
|
|
return await _departmentService.GetTreeAsync();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取下一级
|
|
/// </summary>
|
|
/// <param name="nextNo"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("next")]
|
|
public async Task<List<DepartmentTreeResponse>> GetNextListAsync(string nextNo)
|
|
{
|
|
return await _departmentService.GetNextListAsync(nextNo);
|
|
}
|
|
} |