From c25cc7a29626931228b2d2d651d526b6fa2d143e Mon Sep 17 00:00:00 2001 From: wyh Date: Wed, 22 Nov 2023 15:26:03 +0800 Subject: [PATCH] fixed --- iot/card-model.go | 14 +++++++------- iot/device-iot.go | 8 ++++---- iot/group-iot.go | 4 ++-- iot/person-iot.go | 8 ++++---- iot/plan-iot.go | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/iot/card-model.go b/iot/card-model.go index 484c83e..74ea0b8 100644 --- a/iot/card-model.go +++ b/iot/card-model.go @@ -7,10 +7,10 @@ import ( ) const ( - CARD_BASE = "https://api2.hik-cloud.com/api/v1/open/basic/cards" - CARD_CREATE = CARD_BASE + "/batchCreate" - CARD_DELETE = CARD_BASE + "/batchDelete" - CARD_DELETE_CARDS = CARD_BASE + "/deletePersonCards" + card_base = "/api/v1/open/basic/cards" + card_create = card_base + "/batchCreate" + card_delete = card_base + "/batchDelete" + card_delete_cards = card_base + "/deletePersonCards" ) // 新增卡片 @@ -21,7 +21,7 @@ func CardCreate(cards []model.CardCreateReq) (*model.Hikvision, error) { Cards: cards, } - resp, err := hikvisionRequest("POST", CARD_CREATE, req) + resp, err := hikvisionRequest("POST", card_create, req) if err != nil { return nil, err } @@ -40,7 +40,7 @@ func CardDelete(cardNos []string) (*model.Hikvision, error) { CardNos: cardNos, } - resp, err := hikvisionRequest("POST", CARD_DELETE, req) + resp, err := hikvisionRequest("POST", card_delete, req) if err != nil { return nil, err } @@ -62,7 +62,7 @@ func CardDeleteByEmployeeNo(employeeNo string, cardNos []string) (*model.Hikvisi CardNos: cardNos, } - resp, err := hikvisionRequest("POST", CARD_DELETE_CARDS, req) + resp, err := hikvisionRequest("POST", card_delete_cards, req) if err != nil { return nil, err } diff --git a/iot/device-iot.go b/iot/device-iot.go index 228fc47..5bd665f 100644 --- a/iot/device-iot.go +++ b/iot/device-iot.go @@ -11,16 +11,16 @@ import ( 基础服务能力 > 设备管理 > 设备接入管理 */ -var ( - access_base = "https://api2.hik-cloud.com/api/v1/open/basic/devices" +const ( + access_base = "/api/v1/open/basic/devices" access_detail = access_base + "/get" access_list = access_base + "/list" access_account = access_base + "/actions/deviceCount" - access_status = access_base + "https://api2.hik-cloud.com/api/v1/ezviz/devices/queryDeviceStatus" + access_status = access_base + "/api/v1/ezviz/devices/queryDeviceStatus" access_reboot = access_base + "/actions/system/reboot" // 设备校时配置 - time_base = "https://api2.hik-cloud.com/api/v1/device/isapi/system/time" + time_base = "/api/v1/device/isapi/system/time" time_ntpcfg = time_base + "/ntpServers" time_ntpserver_cfg = time_base + "/ntpServers/config" ) diff --git a/iot/group-iot.go b/iot/group-iot.go index 6c99ebd..c364789 100644 --- a/iot/group-iot.go +++ b/iot/group-iot.go @@ -11,9 +11,9 @@ import ( 基础服务能力 > 设备管理 > 设备分组管理 */ -var ( +const ( /*设备分组管理*/ - group_base = "https://api2.hik-cloud.com/api/v1/open/basic/groups" + group_base = "/api/v1/open/basic/groups" group_create = group_base + "/create" group_remove = group_base + "/delete" group_update = group_base + "/update" diff --git a/iot/person-iot.go b/iot/person-iot.go index 3ae7cee..5597c2a 100644 --- a/iot/person-iot.go +++ b/iot/person-iot.go @@ -7,16 +7,16 @@ import ( "myschools.me/suguo/hikvision/iot/model" ) -var ( - person_base = "https://api2.hik-cloud.com/api/v1/open/basic/persons" +const ( + person_base = "/api/v1/open/basic/persons" person_create = person_base + "/create" person_update = person_base + "/update" person_delete = person_base + "/delete" person_detail = person_base + "/get" - person_face_setcfg = "https://api2.hik-cloud.com/api/v1/open/basic/tenantConfigs/actions/updateTenantConfig" + person_face_setcfg = "/api/v1/open/basic/tenantConfigs/actions/updateTenantConfig" - face_base = "https://api2.hik-cloud.com/api/v1/open/basic/faces" + face_base = "/api/v1/open/basic/faces" person_face_update = face_base + "/update" person_face_delete = face_base + "/delete" ) diff --git a/iot/plan-iot.go b/iot/plan-iot.go index 08f0a6a..de3faae 100644 --- a/iot/plan-iot.go +++ b/iot/plan-iot.go @@ -7,8 +7,8 @@ import ( "myschools.me/suguo/hikvision/iot/model" ) -var ( - plan_base = "https://api2.hik-cloud.com/api/v1/open/access/plans" +const ( + plan_base = "/api/v1/open/access/plans" plan_week = plan_base + "/weeks" plan_week_cfg = plan_week + "/config"