Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jinan
traffic-signal-platform
Commits
d829cd7a
Commit
d829cd7a
authored
Mar 22, 2025
by
fengyasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
海康历史视频接口
parent
f397516b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
0 deletions
+79
-0
GetCameraPreviewURL.java
.../wanji/opt/controllerv2/hikvideo/GetCameraPreviewURL.java
+66
-0
HikVideoController.java
...t/wanji/opt/controllerv2/hikvideo/HikVideoController.java
+13
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controllerv2/hikvideo/GetCameraPreviewURL.java
0 → 100644
View file @
d829cd7a
package
net
.
wanji
.
opt
.
controllerv2
.
hikvideo
;
import
com.alibaba.fastjson.JSONObject
;
import
com.hikvision.artemis.sdk.ArtemisHttpUtil
;
import
com.hikvision.artemis.sdk.config.ArtemisConfig
;
import
java.util.*
;
public
class
GetCameraPreviewURL
{
public
static
String
GetCameraPreviewURL
(
String
cameraIndexCode
,
String
beginTime
,
String
endTime
,
String
recordLocation
)
{
/**
* STEP1:设置平台参数,根据实际情况,设置host appkey appsecret 三个参数.
*/
ArtemisConfig
.
host
=
"37.10.253.17:443"
;
// 平台的ip端口
ArtemisConfig
.
appKey
=
"26868396"
;
// 密钥appkey
ArtemisConfig
.
appSecret
=
"HYD9kdmg8pxy96xfZB7T"
;
// 密钥appSecret
/**
* STEP2:设置OpenAPI接口的上下文
*/
final
String
ARTEMIS_PATH
=
"/artemis"
;
/**
* STEP3:设置接口的URI地址
*/
final
String
previewURLsApi
=
ARTEMIS_PATH
+
"/api/video/v1/cameras/playbackURLs"
;
Map
<
String
,
String
>
path
=
new
HashMap
<
String
,
String
>(
2
)
{
{
put
(
"https://"
,
previewURLsApi
);
//根据现场环境部署确认是http还是https
}
};
/**
* STEP4:设置参数提交方式
*/
String
contentType
=
"application/json"
;
/**
* STEP5:组装请求参数
*/
JSONObject
jsonBody
=
new
JSONObject
();
jsonBody
.
put
(
"cameraIndexCode"
,
cameraIndexCode
);
jsonBody
.
put
(
"beginTime"
,
beginTime
);
jsonBody
.
put
(
"endTime"
,
endTime
);
jsonBody
.
put
(
"recordLocation"
,
recordLocation
);
jsonBody
.
put
(
"protocol"
,
"rtsp"
);
jsonBody
.
put
(
"needReturnClipInfo"
,
true
);
jsonBody
.
put
(
"uuid"
,
""
);
jsonBody
.
put
(
"expand"
,
"transCode=0"
);
String
body
=
jsonBody
.
toJSONString
();
/**
* STEP6:调用接口
*/
String
result
=
ArtemisHttpUtil
.
doPostStringArtemis
(
path
,
body
,
null
,
null
,
contentType
,
null
);
// post请求application/json类型参数
return
result
;
}
public
static
void
main
(
String
[]
args
)
{
String
result
=
GetCameraPreviewURL
(
"3ceaf62b4bfc471da75c9c18efaec009"
,
"2025-03-20T00:00:00.000+08:00"
,
"2025-03-20T00:00:05.000+08:00"
,
"0"
);
System
.
out
.
println
(
"result结果示例: "
+
result
);
}
}
signal-optimize-service/src/main/java/net/wanji/opt/controllerv2/hikvideo/HikVideoController.java
0 → 100644
View file @
d829cd7a
package
net
.
wanji
.
opt
.
controllerv2
.
hikvideo
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
HikVideoController
{
@RequestMapping
(
"/test"
)
public
void
getHikVideo
(
String
crossId
){
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment