增加几个大类

This commit is contained in:
suguo.yao 2023-11-21 08:41:52 +08:00
parent 7c2375cff6
commit c93370eacd
11 changed files with 24 additions and 14 deletions

5
ai/readme.md Normal file
View File

@ -0,0 +1,5 @@
海康威视AI开放平台
===
https://ai.hikvision.com/

1
cloud/readme.md Normal file
View File

@ -0,0 +1 @@
海康云眸平台

2
go.mod
View File

@ -1,3 +1,3 @@
module myschools.me/suguo/hikvision
go 1.17
go 1.20

View File

View File

@ -1,5 +1,5 @@
//Package 海康
package hikvision
// Package 海康
package isc
import (
"crypto/hmac"
@ -9,7 +9,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
"time"
@ -22,7 +22,7 @@ func artemisHmacSha256(message string, secret string) string {
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
//海康post请求不做错误记录
// 海康post请求不做错误记录
func artemisPOST(uri string, body interface{}) (*[]byte, error) {
url := fmt.Sprintf(`%s/artemis%s`, conf.Host, uri)
reqbody, _ := json.Marshal(body)
@ -56,7 +56,7 @@ func artemisPOST(uri string, body interface{}) (*[]byte, error) {
}
defer resp.Body.Close()
respBody, err := ioutil.ReadAll(resp.Body)
respBody, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}

View File

@ -1,6 +1,6 @@
package hikvision
package isc
//海康配置
// 海康配置
type Config struct {
Host string
AppKey string

View File

@ -1,4 +1,4 @@
package hikvision
package isc
import (
"encoding/json"
@ -6,7 +6,7 @@ import (
"myschools.me/suguo/hikvision/model"
)
//人员头像
// 人员头像
func HikvisionFace(params *model.HikvisionCertificateNum) (*[]byte, error) {
resp, err := artemisPOST("/api/frs/v1/face", params)
if err != nil {

View File

@ -1,4 +1,4 @@
package hikvision
package isc
import (
"encoding/json"
@ -6,7 +6,7 @@ import (
"myschools.me/suguo/hikvision/model"
)
//人员数据获取
// 人员数据获取
func HikvisionPersonPage(params *model.HikvisionPage) (*model.PersonList, error) {
resp, err := artemisPOST("/api/resource/v2/person/personList", params)
if err != nil {

4
isc/readme.md Normal file
View File

@ -0,0 +1,4 @@
ISC(ISecure Center)综合安防管理平台
======================================
https://open.hikvision.com/osp#%E7%BB%BC%E5%90%88%E5%AE%89%E9%98%B2%E7%AE%A1%E7%90%86%E5%B9%B3%E5%8F%B0

View File

@ -1,4 +1,4 @@
package hikvision
package isc
import (
"encoding/json"
@ -6,7 +6,7 @@ import (
"myschools.me/suguo/hikvision/model"
)
//设备资源
// 设备资源
func HikvisionResources(params interface{}) (*model.HikResources, error) {
resp, err := artemisPOST("/api/irds/v2/deviceResource/resources", params)
if err != nil {