|
@@ -73,6 +73,7 @@ void TEST_InertKeys()
|
|
|
for ( int i = 0; i < 50000; i++ )
|
|
|
{
|
|
|
_itoa_s(i, szdata, 10);
|
|
|
+ keys.pid = "102";
|
|
|
keys.sn = szdata;
|
|
|
keys.keys = "{\"did\":\"did\",\"mac\":\"mac\",\"cikey\":\"cikey\",\"hdcp\":\"hdcp\",\"hdcp22\":\"hdcp22\",\"widi\":\"widi\",\"esn\":\"esn\",\"widevine\":\"widevine\"}";
|
|
|
db.InsertKeyInfo(keys);
|
|
@@ -87,8 +88,7 @@ void TEST_InertKeys2()
|
|
|
if ( db.Open() )
|
|
|
{
|
|
|
char szdata[10] = {0};
|
|
|
- OutputDebugString("批量插入数据\n");
|
|
|
- OutputDebugString(CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S\n"));
|
|
|
+ printf("批量插入数据:%s\n",CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S\n").GetString());
|
|
|
|
|
|
std::vector<STKeys> vtKeys;
|
|
|
vtKeys.resize(200);
|
|
@@ -96,16 +96,14 @@ void TEST_InertKeys2()
|
|
|
for ( int i = 0; it != vtKeys.end(); it++, i++ )
|
|
|
{
|
|
|
_itoa_s(i, szdata, 10);
|
|
|
- it->pid = "1";
|
|
|
+ it->pid = "102";
|
|
|
it->sn = szdata;
|
|
|
it->keys = "{\"did\":\"did\",\"mac\":\"mac\",\"cikey\":\"cikey\",\"hdcp\":\"hdcp\",\"hdcp22\":\"hdcp22\",\"widi\":\"widi\",\"esn\":\"esn\",\"widevine\":\"widevine\"}";
|
|
|
}
|
|
|
|
|
|
- OutputDebugString("开始批量插入数据\n");
|
|
|
- OutputDebugString(CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S\n"));
|
|
|
+ printf("开始批量插入数据:%s\n",CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S\n").GetString());
|
|
|
db.BatchInsertKeyInfo(vtKeys);
|
|
|
- OutputDebugString("完成批量插入数据\n");
|
|
|
- OutputDebugString(CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S\n"));
|
|
|
+ printf("完成批量插入数据:%s\n",CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S\n").GetString());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -145,6 +143,9 @@ void TEST_QueryMidInfo()
|
|
|
{
|
|
|
STMid mid;
|
|
|
db.QueryMidInfo("1", mid);
|
|
|
+
|
|
|
+ printf("查询MID=>order=%s,ctype=%s,ver=%s, pid=%s, psize=%s, purl=%s, pmd5=%s \n",
|
|
|
+ mid.order.c_str(), mid.ctype.c_str(), mid.version.c_str(), mid.pid.c_str(), mid.psize.c_str(), mid.purl.c_str(), mid.pmd5.c_str());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -158,25 +159,13 @@ void TEST_QueryUnReportKey()
|
|
|
std::vector<STKeys>::iterator it = vtKeys.begin();
|
|
|
for (; it != vtKeys.end(); it++ )
|
|
|
{
|
|
|
- OutputDebugString("SN:");
|
|
|
- OutputDebugString(it->sn.c_str());
|
|
|
- OutputDebugString("\t");
|
|
|
-
|
|
|
- OutputDebugString("copy_date:");
|
|
|
- OutputDebugString(it->copy_date.c_str());
|
|
|
- OutputDebugString("\t");
|
|
|
-
|
|
|
- OutputDebugString("copy_status:");
|
|
|
- OutputDebugString(it->copy_status.c_str());
|
|
|
- OutputDebugString("\t");
|
|
|
-
|
|
|
- OutputDebugString("report_date:");
|
|
|
- OutputDebugString(it->report_date.c_str());
|
|
|
- OutputDebugString("\t");
|
|
|
-
|
|
|
- OutputDebugString("report_status:");
|
|
|
- OutputDebugString(it->report_status.c_str());
|
|
|
- OutputDebugString("\n");
|
|
|
+ printf("sn:%s\n", it->sn.c_str());
|
|
|
+
|
|
|
+
|
|
|
+ printf("copy_date:%s\n", it->copy_date.c_str());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -188,6 +177,8 @@ void TEST_QueryKeyInfo()
|
|
|
{
|
|
|
STKeys key;
|
|
|
db.QueryKeyInfo("1", key);
|
|
|
+ printf("查询SNKey=>sn=%s,pid=%s,keys=%s, copy_date=%s, report_date=%s \n",
|
|
|
+ key.sn.c_str(), key.pid.c_str(), key.keys.c_str(), key.copy_date.c_str(), key.report_date.c_str());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -196,8 +187,11 @@ void TEST_QueryLogInfo()
|
|
|
CDataImpl db;
|
|
|
if ( db.Open() )
|
|
|
{
|
|
|
- STKeys log;
|
|
|
- db.QueryKeyInfo("1", log);
|
|
|
+ STLog log;
|
|
|
+ db.QueryLogInfo("1", log);
|
|
|
+ printf("查询Log=>sn=%s,type=%s, content=%s, gdate=%s, report_date=%s \n",
|
|
|
+ log.sn.c_str(), log.type.c_str(), log.content.c_str(), log.gdate.c_str(), log.report_date.c_str());
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -208,6 +202,12 @@ void TEST_QueryUnReportLogInfo()
|
|
|
{
|
|
|
std::vector<STLog> vtlog;
|
|
|
db.QueryUnReportLogInfo(vtlog);
|
|
|
+ std::vector<STLog>::iterator it = vtlog.begin();
|
|
|
+ for (; it != vtlog.end(); it++)
|
|
|
+ {
|
|
|
+ printf("查询Log=>sn=%s,type=%s, content=%s, gdate=%s, report_date=%s \n",
|
|
|
+ it->sn.c_str(), it->type.c_str(), it->content.c_str(), it->gdate.c_str(), it->report_date.c_str());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -227,11 +227,20 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
|
|
|
{
|
|
|
std::string md5 = GetFileMD5("D:\\bin\\scbc.tools\\scbc.tools.pdb");
|
|
|
|
|
|
- TEST_GetMidInfo();
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ TEST_InsertMidInfo();
|
|
|
+ TEST_QueryMidInfo();
|
|
|
+ TEST_InertKeys();
|
|
|
+ TEST_InertKeys2();
|
|
|
+ TEST_InertLog();
|
|
|
+ TEST_QueryKeyInfo();
|
|
|
+ TEST_QueryUnReportKey();
|
|
|
+ TEST_QueryLogInfo();
|
|
|
+ TEST_QueryUnReportLogInfo();
|
|
|
}
|
|
|
|
|
|
+ system("pause");
|
|
|
+
|
|
|
return nRetCode;
|
|
|
}
|
|
|
|