Commit 39527c30 authored by 郝文豪's avatar 郝文豪

修改init接口,init初始化传入路径,改变数据库存放位置,新增一次上传3张图片的接口,50版本

parent 3604182b
No preview for this file type
No preview for this file type
......@@ -138,6 +138,41 @@ int CommonTools::upload_file(const char* url, const char* fileName, string& resp
//return 0;
}
int CommonTools::upload_file1(const char* url, const char* fileName1, const char* fileName2, const char* fileName3,vector<string>&res, string& response) {
CURL* curl;
CURLcode ret;
curl = curl_easy_init();
struct curl_httppost* post = NULL;
struct curl_httppost* last = NULL;
if (curl)
{
curl_easy_setopt(curl, CURLOPT_URL, url); //指定url
curl_formadd(&post, &last, CURLFORM_PTRNAME, "path", CURLFORM_PTRCONTENTS, "device_cover", CURLFORM_END);//form-data key(path) 和 value(device_cover)
curl_formadd(&post, &last, CURLFORM_PTRNAME, "file", CURLFORM_FILE, fileName1, CURLFORM_FILENAME,res[0].c_str(), CURLFORM_END);// form-data key(file) "./test.jpg"为文件路径 "hello.jpg" 为文件上传时文件名
curl_formadd(&post, &last, CURLFORM_PTRNAME, "file2", CURLFORM_FILE, fileName2, CURLFORM_FILENAME, res[1].c_str(), CURLFORM_END);
curl_formadd(&post, &last, CURLFORM_PTRNAME, "file3", CURLFORM_FILE, fileName3, CURLFORM_FILENAME, res[2].c_str(), CURLFORM_END);
curl_formadd(&post, &last, CURLFORM_PTRNAME,"type", CURLFORM_PTRCONTENTS, res[3].c_str(), CURLFORM_END);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, post); //构造post参数
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 3);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); //绑定相应
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&response); //绑定响应内容的地址
ret = curl_easy_perform(curl); //执行请求
if (ret == 0) {
curl_easy_cleanup(curl);
return 0;
}
else {
return ret;
}
}
else {
return -1;
}
}
int CommonTools::download_file(const char* url, const char outfilename[FILENAME_MAX]) {
CURL* curl;
FILE* fp;
......
......@@ -25,6 +25,7 @@ public:
static int download_file(const char* url, const char outfilename[FILENAME_MAX]);
// 文件上传
static int upload_file(const char* url, const char* fileName, string& response);
static int upload_file1(const char* url, const char* fileName1, const char* fileName2, const char* fileName3, vector<string>& res, string& response);
// http get 请求
static CURLcode HttpGet(const std::string& strUrl, std::string& strResponse, int nTimeout);
// htpp post 请求
......
No preview for this file type
No preview for this file type
No preview for this file type
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\vc142.pdb
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmacekg-x86.obj
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\dllmain.obj
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\cppsqlite3.obj
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\commontools.obj
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\characterconversion.obj
c:\users\zhxx\desktop\work\fresh-plug-ins\bin\x86\wmacekg-x86.dll
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmacekg-x86.ipdb
c:\users\zhxx\desktop\work\fresh-plug-ins\bin\x86\wmacekg-x86.pdb
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmacekg-x86.iobj
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll-x86.res
c:\users\zhxx\desktop\work\fresh-plug-ins\bin\x86\wmacekg-x86.lib
c:\users\zhxx\desktop\work\fresh-plug-ins\bin\x86\wmacekg-x86.exp
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\cl.command.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\cl.read.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\cl.write.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\link.command.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\link.read.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\link.write.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\rc.command.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\rc.read.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\rc.write.1.tlog
c:\users\zhxx\desktop\work\fresh-plug-ins\release\x86\wmai-dll.tlog\wmai-dll.write.1u.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\vc142.pdb
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmacekg-x86.obj
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\dllmain.obj
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\cppsqlite3.obj
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\commontools.obj
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\characterconversion.obj
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll-x86.res
c:\users\1\documents\fresh-plug-ins-dll-new\bin\x86\wmacekg-x86.dll
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\cl.command.1.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\cl.read.1.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\cl.write.1.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\link.command.1.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\link.read.1.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\link.write.1.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\rc.command.1.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\rc.read.1.tlog
c:\users\1\documents\fresh-plug-ins-dll-new\release\x86\wmai-dll.tlog\rc.write.1.tlog
......@@ -2,7 +2,7 @@
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\zhxx\Desktop\work\fresh-plug-ins\bin\x86\WmAceKG-x86.dll</FullPath>
<FullPath>C:\Users\1\Documents\fresh-plug-ins-dll-new\bin\x86\WmAceKG-x86.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed.
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\CHARACTERCONVERSION.CPP
......
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\CHARACTERCONVERSION.CPP
......
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\CHARACTERCONVERSION.CPP|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\COMMONTOOLS.CPP|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\CPPSQLITE3.CPP|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\DLLMAIN.CPP|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\WMACEKG-X86.CPP
......
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\CHARACTERCONVERSION.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\COMMONTOOLS.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\CPPSQLITE3.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\DLLMAIN.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\WMACEKG-X86.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\WMAI-DLL-X86.RES
......
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\CHARACTERCONVERSION.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\COMMONTOOLS.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\CPPSQLITE3.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\DLLMAIN.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\WMACEKG-X86.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\WMAI-DLL-X86.RES
......
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\CHARACTERCONVERSION.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\COMMONTOOLS.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\CPPSQLITE3.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\DLLMAIN.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\WMACEKG-X86.OBJ|C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\RELEASE\X86\WMAI-DLL-X86.RES
......
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\WMAI-DLL-X86.RC
......
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\WMAI-DLL-X86.RC
......
B^C:\USERS\1\DOCUMENTS\FRESH-PLUG-INS-DLL-NEW\WMAI-DLL-X86.RC
......
PlatformToolSet=v142:VCToolArchitecture=Native64Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0:
Release|Win32|C:\Users\zhxx\Desktop\work\fresh-plug-ins\|
Release|Win32|C:\Users\1\Documents\fresh-plug-ins-dll-new\|
B^C:\Users\1\Documents\fresh-plug-ins-dll-new\wmai-dll-x86.vcxproj
......
This diff is collapsed.
......@@ -126,7 +126,8 @@ extern "C" {
#endif
extern WMAI_EXPORT int WMAI_API Init();
extern WMAI_EXPORT int WMAI_API Init(char* path);
extern WMAI_EXPORT int WMAI_API RealTimeDetect(char* code , char* sessionId, bool &state );
......@@ -170,7 +171,7 @@ extern "C" {
/// 解绑pos机
/// </summary>
/// <returns>0:正常,非0:异常</returns>
extern WMAI_EXPORT int WMAI_API UnBindPos(char* tenant, char* snNo);
extern WMAI_EXPORT int WMAI_API UnbindPos(char* tenant, char* snNo);
/// <summary>
/// 设置开启摄像头序号
......@@ -245,7 +246,7 @@ extern "C" {
/// 视频流识别
/// </summary>
/// <returns>0:正常,非0:异常</returns>
extern WMAI_EXPORT int WMAI_API VideoPipeDetect();
extern WMAI_EXPORT int WMAI_API VideopipeDetect();
/// <summary>
/// 改变对比底图
......@@ -278,11 +279,13 @@ extern "C" {
extern WMAI_EXPORT bool WMAI_API judgeScanTheCode();
extern WMAI_EXPORT bool WMAI_API getVideopipeInit();
extern WMAI_EXPORT bool WMAI_API getInitResults();
extern WMAI_EXPORT bool WMAI_API returnCameraState();
extern WMAI_EXPORT bool WMAI_API ReturnCameraState();
extern WMAI_EXPORT int WMAI_API freshChangeError(const char* code);
extern WMAI_EXPORT int WMAI_API FreshChangeError(const char* code);
extern WMAI_EXPORT int WMAI_API setVideoDetect(int ch);
#ifdef __cplusplus
}
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -17,9 +17,9 @@ EXPORTS
Close @12
Test50000 @13
WMrelease @15
UnBindPos @17
UnbindPos @17
ClearTrainedData @18
VideoPipeDetect @19
VideopipeDetect @19
ChangeBackPicture @20
GetQueueSize @21
SelectByName @22
......@@ -31,6 +31,7 @@ EXPORTS
inputPluToDetect @28
getDetectImage @29
judgeScanTheCode @30
getVideopipeInit @31
ReturnCameraState @32
FreshChangeError @33
\ No newline at end of file
getInitResults @31
returnCameraState @32
freshChangeError @33
setVideoDetect @34
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment