using ASHermed.SinoInterface.Api.ContractModel.Framework.Login;
using ASHermed.SinoInterface.Api.IService.Login;
using ASHermed.SinoInterface.ContractModel;
using ASHermed.SinoInterface.IFramework.SingleSignOn;
using PoJun.Util.Maps;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ASHermed.SinoInterface.Api.Service.Login
{
    /// <summary>
	/// SingleSignOnService
	/// 创建人：杨江军
	/// 创建时间：2020/4/15 14:18:56
	/// </summary>
	public class SingleSignOnService : ISingleSignOnService
    {
        #region 初始化

        /// <summary>
        /// 用户登录服务
        /// </summary>
        private readonly ILoginService loginService;

        /// <summary>
        /// 单点登录服务
        /// </summary>
        /// <param name="_loginService"></param>
        public SingleSignOnService(ILoginService _loginService)
        {
            loginService = _loginService;
        }

        #endregion

        /// <summary>
        /// 发送短信验证码
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public Task<BaseResponse> SendSMSVerifyCode(SendSMSVerifyCodeParam param)
        {
            return loginService.SendSMSVerifyCode(param);
        }

        /// <summary>
        /// 通过手机号码和验证码进行单点登录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public Task<BaseResponse<SingleSignOnModel>> SingleSignOnByPhones(SingleSignOnByPhonesParam param)
        {
            return loginService.SingleSignOnByPhones(param);
        }

        /// <summary>
        /// 通过登录名和密码进行单点登录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public Task<BaseResponse<SingleSignOnModel>> SingleSignOnByLoginId(SingleSignOnByLoginIdParam param)
        {
            return loginService.SingleSignOnByLoginId(param);
        }

        /// <summary>
        /// 退出登录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public Task<BaseResponse> SignOut(SignOutParam param)
        {
            return loginService.SignOut(param);
        }
    }
}
