1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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;
- }
- /// <summary>
- /// 获取分机
- /// </summary>
- /// <returns></returns>
- [HttpGet("gettel")]
- public async Task<object> GetTel()
- {
- var rsp = await _wexClient.QueryTelsAsync(new QueryTelRequest { }, HttpContext.RequestAborted);
- return rsp;
- }
- /// <summary>
- /// 获取坐席组
- /// </summary>
- /// <returns></returns>
- [HttpGet("getgroup")]
- public async Task<object> GetGroup()
- {
- var rsp = await _wexClient.QueryGroupAsync(new QueryGroupRequest { }, HttpContext.RequestAborted);
- return rsp;
- }
-
- }
- }
|