using Common.Constant;
using Microsoft.AspNetCore.Mvc;
using SicboSub.Api.Business;
using SicboSub.Api.DTO;

namespace SicboSub.Api.Controllers
{
    [ApiController]
    public class UserController : Controller
    {
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(UserController));

        IUserBusiness userBusiness;

        public UserController(IUserBusiness userBusiness)
        {
            this.userBusiness = userBusiness;
        }

        /// <summary>
        /// Get account information by msisdn
        /// POST /apis/user/info
        /// </summary>
        [HttpPost]
        [Route(ApiUrlConstant.UserInfoUrl)]
        public async Task<IActionResult> GetAccountInfo([FromBody] AccountInfoReq request)
        {
            return await userBusiness.GetAccountInfo(HttpContext.Request, request);
        }
    }
}
