#include <iostream>
#include <libpq-fe.h>
#include "CivHydrFuncInter.h"

#include "iostream"
#include "time.h"
#include "string.h"


using namespace std;
int main(int argc, char* argv[])
{

    const char* uri = "host=192.168.19.100 port=5432 dbname=JinXian user=postgres password=admin";
    char* findUri = const_cast<char*>(uri);
    char* result = (char*)malloc(2048);

    char sn[32];
    strcpy_s(sn, "JD00000680");
    int succ = trackingSimulation(findUri, sn,2, result);
    std::cout << succ << std::endl;
    free(result);

   /*const char* date = "2020-07-02";
    char* dates = const_cast<char*>(date);

    const char* interval = "4";
    char* intervals = const_cast<char*>(interval);
    bool isSucces = getDataByInterval(findUri, dates, intervals);
    std::cout << isSucces << std::endl;*/
    getchar();

    return 0;
}