using Dlhis.External.OpenApi.Response; using Dlhis.External.OpenApi.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace Dlhis.External.OpenApi.Controllers; [Authorize] [Route("api/[controller]")] [ApiController] public class DepartmentsController : ControllerBase { private readonly IGainfoService _gainfoService; public DepartmentsController(IGainfoService gainfoService) { _gainfoService = gainfoService; } /// /// 获取所有部门信息 /// /// [HttpGet("all")] public async Task> GetDepartmentsAsync() { return await _gainfoService.GetDepartmentsAsync(); } }