Exemplo n.º 1
0
        static APIKeySecretConfig private_GetConfig(string id)
        {
            APIKeySecretConfig c = null;

            var     sql = $"select * from `web_apikeysecretconfig` where `ID` = '{id}' limit 1";
            DataSet ds;

            QLGameRESTAPI.Core.DBTools.Data.DbHelperSQL.Instance.RunSql(sql, out ds);

            foreach (System.Data.DataRow dr in ds.Tables[0].Rows)
            {
                c = InitAPIKeySecretConfig(dr);

                //Cache缓存
                _list[id] = c;

                return(c);
            }
            return(null);
        }
Exemplo n.º 2
0
        private static APIKeySecretConfig InitAPIKeySecretConfig(DataRow dr)
        {
            int SNSSetID;

            int.TryParse(dr["SNSSetID"].ToString(), out SNSSetID);

            var data = new APIKeySecretConfig()
            {
                AppId     = dr["APPID"].ToString(),
                AppSecret = dr["AppSecret"].ToString(),
                SNSSetID  = SNSSetID
            };

            var packageData = data.PackageData;

            foreach (DataColumn c in dr.Table.Columns)
            {
                packageData[c.ColumnName] = dr[c.ColumnName].ToString();
            }

            return(data);
        }