Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wangquyuan
/
ygydserver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 87e93f98
authored
Mar 05, 2025
by
wangquyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change port to 8088
1 parent
28bedfc1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
13 deletions
api.txt
build/config.json
src/CMakeLists.txt
src/src/do_request.cpp
test/test.go
api.txt
View file @
87e93f9
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
method:post
method:post
url: /query/feature
url: /query/feature
url: /resources/query/feature
Content-Type:"application/x-www-form-urlencoded"
Content-Type:"application/x-www-form-urlencoded"
参数:
参数:
...
@@ -26,7 +27,7 @@ Content-Type:"application/x-www-form-urlencoded"
...
@@ -26,7 +27,7 @@ Content-Type:"application/x-www-form-urlencoded"
2: 获取情绪
2: 获取情绪
method:post
method:post
url: /query/emotion
url: /
resources/
query/emotion
Content-Type:"application/x-www-form-urlencoded"
Content-Type:"application/x-www-form-urlencoded"
...
@@ -51,7 +52,7 @@ Content-Type:"application/x-www-form-urlencoded"
...
@@ -51,7 +52,7 @@ Content-Type:"application/x-www-form-urlencoded"
3: 获取微表情
3: 获取微表情
method:post
method:post
url: /query/action
url: /
resources/
query/action
Content-Type:"application/x-www-form-urlencoded"
Content-Type:"application/x-www-form-urlencoded"
...
@@ -78,7 +79,7 @@ Content-Type:"application/x-www-form-urlencoded"
...
@@ -78,7 +79,7 @@ Content-Type:"application/x-www-form-urlencoded"
因为视频文件可能比较大,所以采用文件上传的方式来上传视频文件,所以Content-Type采用"multipart/form-data"
因为视频文件可能比较大,所以采用文件上传的方式来上传视频文件,所以Content-Type采用"multipart/form-data"
method:post
method:post
url: /query/video
url: /
resources/
query/video
Content-Type:"multipart/form-data"
Content-Type:"multipart/form-data"
...
...
build/config.json
View file @
87e93f9
{
{
"bindip"
:
""
,
"bindip"
:
""
,
"http_port"
:
4000
,
"http_port"
:
8088
,
"http_work_threads"
:
5
,
"http_work_threads"
:
5
,
"work_timeout"
:
10
,
"work_timeout"
:
10
,
"logpath"
:
"/tmp"
,
"logpath"
:
"/tmp"
,
"datapath"
:
"/tmp"
,
"datapath"
:
"/tmp"
,
"savevideo"
:
1
,
"savevideo"
:
0
,
"device"
:
"
g
pu"
,
"device"
:
"
c
pu"
,
"models"
:
{
"models"
:
{
"face_detector"
:
"SeetaFaceDetector6.0.IPC.sta"
,
"face_detector"
:
"SeetaFaceDetector6.0.IPC.sta"
,
...
...
src/CMakeLists.txt
View file @
87e93f9
...
@@ -111,7 +111,7 @@ include_directories(/usr/local/include)
...
@@ -111,7 +111,7 @@ include_directories(/usr/local/include)
#target_link_libraries(${PROJECT_NAME} -L/wqy/test/test2/srpc/example -lsrpc -lworkflow -lprotobuf)
#target_link_libraries(${PROJECT_NAME} -L/wqy/test/test2/srpc/example -lsrpc -lworkflow -lprotobuf)
target_link_libraries
(
${
PROJECT_NAME
}
-L/usr/local/lib -lORZ_static
)
target_link_libraries
(
${
PROJECT_NAME
}
-L/usr/local/lib
64
-lORZ_static
)
#include_directories(/usr/local/include)
#include_directories(/usr/local/include)
#target_link_libraries(${PROJECT_NAME} -L/usr/local/lib -lmysqlcppconn)
#target_link_libraries(${PROJECT_NAME} -L/usr/local/lib -lmysqlcppconn)
...
...
src/src/do_request.cpp
View file @
87e93f9
...
@@ -1784,7 +1784,7 @@ void on_http( httpserver *s, websocketpp::connection_hdl hdl )
...
@@ -1784,7 +1784,7 @@ void on_http( httpserver *s, websocketpp::connection_hdl hdl )
//std::cout << "post:body:" << strBody << std::endl;
//std::cout << "post:body:" << strBody << std::endl;
string
strContentType
=
rt
.
get_header
(
"Content-Type"
);
string
strContentType
=
rt
.
get_header
(
"Content-Type"
);
std
::
cout
<<
"----ContentType:"
<<
strContentType
<<
std
::
endl
;
std
::
cout
<<
"----ContentType:"
<<
strContentType
<<
std
::
endl
;
if
(
strUri
==
"/query/video"
)
if
(
strUri
==
"/
resources/
query/video"
)
{
{
string
sformdata
=
"multipart/form-data"
;
string
sformdata
=
"multipart/form-data"
;
string
stype
=
strContentType
.
substr
(
0
,
sformdata
.
length
()
);
string
stype
=
strContentType
.
substr
(
0
,
sformdata
.
length
()
);
...
@@ -2016,23 +2016,23 @@ void on_http( httpserver *s, websocketpp::connection_hdl hdl )
...
@@ -2016,23 +2016,23 @@ void on_http( httpserver *s, websocketpp::connection_hdl hdl )
return
;
return
;
}
}
if
(
strUri
==
"/query/feature"
)
if
(
strUri
==
"/
resources/
query/feature"
)
{
{
strresponse
=
do_query_face_feature
(
strBody
);
strresponse
=
do_query_face_feature
(
strBody
);
create_http_response
(
con
,
strresponse
,
200
);
create_http_response
(
con
,
strresponse
,
200
);
}
}
else
if
(
strUri
==
"/query/action"
)
else
if
(
strUri
==
"/
resources/
query/action"
)
{
{
strresponse
=
do_query_face_action
(
strBody
);
strresponse
=
do_query_face_action
(
strBody
);
create_http_response
(
con
,
strresponse
,
200
);
create_http_response
(
con
,
strresponse
,
200
);
}
}
else
if
(
strUri
==
"/query/emotion"
)
else
if
(
strUri
==
"/
resources/
query/emotion"
)
{
{
strresponse
=
do_query_face_emotion
(
strBody
);
strresponse
=
do_query_face_emotion
(
strBody
);
create_http_response
(
con
,
strresponse
,
200
);
create_http_response
(
con
,
strresponse
,
200
);
}
}
/*
/*
else if( strUri == "/query/pose" )
else if( strUri == "/
resources/
query/pose" )
{
{
strresponse = do_query_face_pose( strBody );
strresponse = do_query_face_pose( strBody );
create_http_response( con, strresponse, 200 );
create_http_response( con, strresponse, 200 );
...
@@ -2068,7 +2068,7 @@ void on_http( httpserver *s, websocketpp::connection_hdl hdl )
...
@@ -2068,7 +2068,7 @@ void on_http( httpserver *s, websocketpp::connection_hdl hdl )
std
::
map
<
std
::
string
,
std
::
string
>
params
;
std
::
map
<
std
::
string
,
std
::
string
>
params
;
geturlparameters
(
parameters
,
params
);
geturlparameters
(
parameters
,
params
);
if
(
method
==
"/query/pots"
)
if
(
method
==
"/
resources/
query/pots"
)
{
{
//strresponse = do_query_pots( strBody );
//strresponse = do_query_pots( strBody );
create_http_response
(
con
,
strresponse
,
200
);
create_http_response
(
con
,
strresponse
,
200
);
...
...
test/test.go
View file @
87e93f9
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment