57 lines
1.3 KiB
Go
57 lines
1.3 KiB
Go
package isc
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"myschools.me/suguo/hikvision/model"
|
|
)
|
|
|
|
// 人员头像
|
|
func HikvisionFace(params *model.HikvisionCertificateNum) (*[]byte, error) {
|
|
resp, err := artemisPOST("/api/frs/v1/face", params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
// 重点人员查询
|
|
func HikvisionImportantFace(params *model.PersonImportant) (*model.PersonImportantResponse, error) {
|
|
resp, err := artemisPOST("/api/frs/v1/event/black/search", params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
obj := &model.PersonImportantResponse{}
|
|
if err := json.Unmarshal(*resp, obj); err != nil {
|
|
return nil, err
|
|
}
|
|
return obj, nil
|
|
}
|
|
|
|
// 陌生人员查询
|
|
func HikvisionStrangerFace(params *model.FaceStranger) (*model.FaceStrangerResponse, error) {
|
|
resp, err := artemisPOST("/api/frs/v1/event/stranger/search", params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
obj := &model.FaceStrangerResponse{}
|
|
if err := json.Unmarshal(*resp, obj); err != nil {
|
|
return nil, err
|
|
}
|
|
return obj, nil
|
|
}
|
|
|
|
// 人脸捕获
|
|
func HikvisionFaceCapture(params *model.FaceCapture) (*model.FaceCaptureResponse, error) {
|
|
resp, err := artemisPOST("/api/frs/v1/event/face_capture/search", params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
obj := &model.FaceCaptureResponse{}
|
|
err = json.Unmarshal(*resp, obj)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return obj, nil
|
|
}
|