| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using molilian.core;
- using dodohold.core;
- using Microsoft.AspNetCore.Mvc;
- using Org.BouncyCastle.Ocsp;
- using System.Text.Json;
- using System.Runtime.InteropServices;
- using System.Net;
- using System.Security.Cryptography;
- using Microsoft.AspNetCore.Authentication;
- using TencentCloud.Ecm.V20190719.Models;
- using COSXML.Network;
- using System.Linq;
- using static dodohold.core.ZTOExpress.CreateOrderArgs;
- using TencentCloud.Lighthouse.V20200324.Models;
- using TencentCloud.Ame.V20190916.Models;
- using TencentCloud.Omics.V20221128.Models;
- using System.Threading.Channels;
- namespace molilian.api.Controllers
- {
- [ApiController]
- [Route("api/[controller]/[action]")]
- public class TkEndpointController : ControllerBase
- {
- protected IHttpContextAccessor _accessor;
- TaokeOpenCore core;
- public TkEndpointController(IHttpContextAccessor accessor)
- {
- _accessor = accessor;
- core = new TaokeOpenCore();
- }
- [HttpPost]
- public async Task<ActionResult> ChangeSuspend([FromForm] JsonElement body)
- {
- int accountId = body.Read<int>("accountId");
- string endpoint = body.Read<string>("accountId");
- bool release = body.Read<bool>("release");
- if (release)
- {
- TkEndpointManager.ReleaseSuspend(accountId, endpoint);
- }
- else
- {
- await TkEndpointManager.SuspendAsync(accountId, endpoint, TkEndpointManager.SuspendReason.Active);
- }
- return new APIResult(new
- {
- success = true,
- action = release ? "ReleaseSuspend" : "Suspend",
- });
- }
- [HttpPost]
- public ActionResult GetStatus([FromForm] JsonElement body)
- {
- var ids = body.PathReadArray<int>("accountId[]");
- var result = TkEndpointManager.GetStatus(ids);
- return new APIResult(new
- {
- success = true,
- data = result
- });
- }
- }
- }
|