using ASHermed.SinoInterface.Api.ContractModel.App;
using ASHermed.SinoInterface.Api.ContractModel.Framework.Login;
using ASHermed.SinoInterface.Api.IRepository;
using ASHermed.SinoInterface.Api.IService;
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
{
    /// <summary>
	/// 积分流水
	/// </summary>
	public class IntegralFlowService : BaseService, IIntegralFlowService
    {
        #region 初始化
        IIntegralFlowRepository integralFlowRepository;
        public IntegralFlowService(IIntegralFlowRepository _integralFlowRepository)
        {
            integralFlowRepository = _integralFlowRepository;
        }
        #endregion

        public Pub_Integral_Flow PerfectIntegral(string phone)
        {

            //int currentMonthIntegral = pubIntegralFlowMapper.selectTotalIntegralInMonth(phone);
            Pub_Integral_Flow pubIntegralFlow = new Pub_Integral_Flow();
            pubIntegralFlow.Changed_Integral = 10;
            pubIntegralFlow.Changed_Type = 3;
            pubIntegralFlow.Changed_Type_Str = "老用户注册送积分";
            pubIntegralFlow.Status = 0;
            pubIntegralFlow.Phone_NO = phone;
            pubIntegralFlow.Create_Time = DateTime.Now;
            integralFlowRepository.initLinq().Insert(pubIntegralFlow);
            //integralFlowRepository.InsertPubIntegralFlow(pubIntegralFlow);

            return pubIntegralFlow;
        }


    }
}
