using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using XYY.Core.Standard.Mvc;
using XYY.Service.Standard.Trans;

namespace XYY.Api.Unit.Controllers
{
    [ApiController]
    [Route("/api/[controller]")]
    public class TransController : ApiControllerBase
    {
        private readonly IDistributedCache _distributedCache;

        public TransController(IDistributedCache distributedCache)
        {
            _distributedCache = distributedCache;
        }

        [HttpGet]
        public async Task<IActionResult> Get(string from, string to, string ori)
        {
            BaiDuTrans baiDuTrans = new BaiDuTrans(_distributedCache);
            return Ok(await baiDuTrans.GetZHAsCache(ori, from, to));
        }
    }
}
