using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Wex.Sdk; using Wex.Sdk.Tel; namespace Hotline.Api.Controllers { [AllowAnonymous] public class WexTestController: BaseController { private readonly IWexClient _wexClient; public WexTestController(IWexClient wexClient) { _wexClient = wexClient; } /// /// 获取分机 /// /// [HttpGet("gettel")] public async Task GetTel() { var rsp = await _wexClient.QueryTelsAsync(new QueryTelRequest { }, HttpContext.RequestAborted); return rsp; } /// /// 获取坐席组 /// /// [HttpGet("getgroup")] public async Task GetGroup() { var rsp = await _wexClient.QueryGroupAsync(new QueryGroupRequest { }, HttpContext.RequestAborted); return rsp; } } }