using RFrameGenerate.Common;
using RFramework;
using RFramework.SQLQuery.SQLExpands;
using RFramework.SQLServer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RFrameGenerate.Model;
using RFrameGenerate.DAL;

namespace RFrameGenerate.BLL
{
    public abstract class APIVerify
    {
        /// <summary>
        /// 获取api密码的md5值
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static string GetPassword(string userID)
        {
            if (userID != "mfkuyg61")
                return "";
            else
                return MD5Crypto.MD5("123456");
        }

        public static void Test(int count)
        {
            return;
            for (int i = 1; i <= count; i++)
            {
                System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback((obj) =>
                {
                    using (var tran = new SqlRTransaction())
                    {
                        tran.BeginTransaction();

                        var query = new SqlModel<T_BAS_Member>(tran);
                        var sql = query.SqlUpdate(a => new object[] { a.MemberName ==  obj.ToString() }, b => b.MemberOpenID == "oH0wywgpfx_kROVlulGTDNnxMz9A");
                        System.Threading.Thread.Sleep(100 * 60 * 1000);
                    }
                }),i);
            }
        }
    }
}
