using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using XYY.Core.Standard.Data.Infrastructure;
using XYY.Model.Standard.OrderAddressCheck;
using XYY.Service.Standard.AddressCheck;
using XYY.Authentication.Standard;
using XYY.Core.Standard.Mvc;
namespace Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class OrderAddressCheck2Controller : ApiControllerBase
    {
        private readonly IAssistantAddressService _assistantAddressService;

        //private readonly IDbConnection _unitOfWork;
        public OrderAddressCheck2Controller(
            IAssistantAddressService assistantAddressService
            //IDbConnection unitOfWork
            )
        {
            //_unitOfWork = unitOfWork;
            _assistantAddressService = assistantAddressService;
        } 
        public async Task<IActionResult> GetRecommended(AssistantOrderAddress orderAddress)
        {
            if (User.GetUserContent().IsAuthorization)
            {
                string name = User.GetUserContent().NiceName;

            }
            return Ok(await _assistantAddressService.GetRecommendedAddresses(orderAddress));
        }
    }
}
