52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#include <iostream>
|
|
#include "sfilterprocess.h"
|
|
#include <QCoreApplication>
|
|
#include <QLocale>
|
|
#include <QDate>
|
|
#include "shttpsender.h"
|
|
using namespace std;
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QCoreApplication a(argc, argv);
|
|
cout << "build date : ";
|
|
cout << QLocale("en_US").toDate(QString(__DATE__).simplified(), "MMM d yyyy").toString("yyyy-MM-dd").toStdString();
|
|
cout << " ";
|
|
cout << QString(__TIME__).toStdString() << endl;
|
|
SFilterProcess filter;
|
|
|
|
cout << "execute arguments: ";
|
|
for(int i=0; i<argc; i++)
|
|
cout << argv[i] << " ";
|
|
cout << endl;
|
|
|
|
if (argc != 4)
|
|
{
|
|
cout << "check argument " << endl;
|
|
return -1;
|
|
}
|
|
|
|
QString strFilterProcessGroupID = argv[1];
|
|
QString strFilterProcessGroupName = argv[2];
|
|
QString strInfluencerLimit = argv[3];
|
|
|
|
a.processEvents();
|
|
|
|
|
|
if (!filter.init(strFilterProcessGroupID, strFilterProcessGroupName, strInfluencerLimit))
|
|
{
|
|
cout << "filter init error" << endl;
|
|
exit(1);
|
|
}
|
|
|
|
if (!filter.run())
|
|
{
|
|
cout << "filter run error" << endl;
|
|
exit(1);
|
|
}
|
|
|
|
SHttpSender httpSender;
|
|
httpSender.SendData(filter.getCompanyNum());
|
|
|
|
return a.exec();
|
|
}
|