update
This commit is contained in:
parent
a706d0f52e
commit
3b1f5a5649
|
|
@ -1,4 +1,4 @@
|
|||
go.sum
|
||||
|
||||
|
||||
.vscode/*
|
||||
.vscode
|
||||
|
|
@ -11,21 +11,21 @@ import (
|
|||
基础服务能力 > 设备管理 > 设备接入管理
|
||||
*/
|
||||
|
||||
const (
|
||||
ACCESS_BASE = "https://api2.hik-cloud.com/api/v1/open/basic/devices"
|
||||
ACCESS_REGISTER = ACCESS_BASE + "/create"
|
||||
ACCESS_DELETE = ACCESS_BASE + "/delete"
|
||||
ACCESS_UPDATE = ACCESS_BASE + "/update"
|
||||
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_REBOOT = ACCESS_BASE + "/actions/system/reboot"
|
||||
var (
|
||||
access_base = "https://api2.hik-cloud.com/api/v1/open/basic/devices"
|
||||
access_register = access_base + "/create"
|
||||
access_delete = access_base + "/delete"
|
||||
access_update = access_base + "/update"
|
||||
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_reboot = access_base + "/actions/system/reboot"
|
||||
|
||||
// 设备校时配置
|
||||
TIME_BASE = "https://api2.hik-cloud.com/api/v1/device/isapi/system/time"
|
||||
TIME_NTPCFG = TIME_BASE + "/ntpServers"
|
||||
TIM_NTPSERVER_CFG = TIME_BASE + "/ntpServers/config"
|
||||
time_base = "https://api2.hik-cloud.com/api/v1/device/isapi/system/time"
|
||||
time_ntpcfg = time_base + "/ntpServers"
|
||||
time_ntpserver_cfg = time_base + "/ntpServers/config"
|
||||
)
|
||||
|
||||
// 注册设备到对应分组内。
|
||||
|
|
@ -44,7 +44,7 @@ func DeviceRegister(deviceserial, groupno, validatecode string) (*model.DeviceDa
|
|||
ValidateCode: validatecode,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", ACCESS_REGISTER, req)
|
||||
resp, err := hikvisionRequest("POST", access_register, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ func DeviceRegister(deviceserial, groupno, validatecode string) (*model.DeviceDa
|
|||
|
||||
// 从某一分组内删除设备
|
||||
func DeviceDelete(deviceSerial string) (*model.Hikvision, error) {
|
||||
resp, err := hikvisionRequest("POST", fmt.Sprintf("%s?deviceSerial=%s", ACCESS_DELETE, deviceSerial), nil)
|
||||
resp, err := hikvisionRequest("POST", fmt.Sprintf("%s?deviceSerial=%s", access_delete, deviceSerial), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ func DeviceUpdate(deviceserial, devicename string) (*model.Hikvision, error) {
|
|||
DeviceName: devicename,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", ACCESS_UPDATE, req)
|
||||
resp, err := hikvisionRequest("POST", access_update, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ func DeviceUpdate(deviceserial, devicename string) (*model.Hikvision, error) {
|
|||
|
||||
// 该接口用于根据设备序列号获取单个设备详细信息
|
||||
func DeviceDetail(deviceSerial string) (*model.DeviceData, error) {
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s", ACCESS_DETAIL, deviceSerial), nil)
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s", access_detail, deviceSerial), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ func DeviceDetail(deviceSerial string) (*model.DeviceData, error) {
|
|||
|
||||
// 该接口用于查询某组下设备列表信息 ,组编号,页数,页行数
|
||||
func DeviceList(groupno string, pageno, pagesize int) (*model.DeviceListData, error) {
|
||||
url := fmt.Sprintf("%s?groupNo=%s&pageNo=%d&pageSize=%d", ACCESS_LIST, groupno, pageno, pagesize)
|
||||
url := fmt.Sprintf("%s?groupNo=%s&pageNo=%d&pageSize=%d", access_list, groupno, pageno, pagesize)
|
||||
resp, err := hikvisionRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -149,7 +149,7 @@ func DeviceList(groupno string, pageno, pagesize int) (*model.DeviceListData, er
|
|||
// 该接口用于获取用户接入的设备总数
|
||||
func DeviceNum() (*int, error) {
|
||||
|
||||
resp, err := hikvisionRequest("GET", ACCESS_ACCOUNT, nil)
|
||||
resp, err := hikvisionRequest("GET", access_account, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -172,7 +172,7 @@ func DeviceNum() (*int, error) {
|
|||
// 该接口用于查询设备的状态信息,目前仅支持萤石设备 /*测试未通过*/
|
||||
func DeviceStatus(deviceserial string) (*model.DeviceStatusData, error) {
|
||||
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s", ACCESS_STATUS, deviceserial), nil)
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s", access_status, deviceserial), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -198,7 +198,7 @@ func DeviceReboot(deviceserial string) (*model.Hikvision, error) {
|
|||
DeviceSerial: deviceserial,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", ACCESS_REBOOT, params)
|
||||
resp, err := hikvisionRequest("POST", access_reboot, params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -261,7 +261,7 @@ func DeviceOnline(deviceserial string) (*model.Hikvision, error) {
|
|||
|
||||
// 该接口用于获取设备当前校时配置
|
||||
func DeviceGetTimeMode(deviceserial string) (*string, error) {
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s", TIME_BASE, deviceserial), nil)
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s", time_base, deviceserial), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -292,7 +292,7 @@ func DeviceSetTimeMode(deviceSerial, timeMode string) (*model.Hikvision, error)
|
|||
TimeMode: timeMode,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", TIME_BASE, req)
|
||||
resp, err := hikvisionRequest("POST", time_base, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -309,7 +309,7 @@ func DeviceSetTimeMode(deviceSerial, timeMode string) (*model.Hikvision, error)
|
|||
|
||||
// 该接口用于获取设备当前NTP服务器配置
|
||||
func DeviceGetNTPCfg(deviceserial string) (*model.DeviceSetNTPCfgServer, error) {
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s", TIME_NTPCFG, deviceserial), nil)
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s", time_ntpcfg, deviceserial), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -338,7 +338,7 @@ func DeviceSetNTPCfg(deviceSerial string, ntpserver *model.DeviceSetNTPCfgServer
|
|||
NtpServer: *ntpserver,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", TIME_NTPCFG, req)
|
||||
resp, err := hikvisionRequest("POST", time_ntpcfg, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -355,7 +355,7 @@ func DeviceSetNTPCfg(deviceSerial string, ntpserver *model.DeviceSetNTPCfgServer
|
|||
|
||||
// 该接口用于获取设备指定NTP服务器配置
|
||||
func DeviceGetNTPServerCfg(deviceserial string, ntpserverid int) (*model.DeviceSetNTPCfgServer, error) {
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s&ntpServerId=%d", TIM_NTPSERVER_CFG, deviceserial, ntpserverid), nil)
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?deviceSerial=%s&ntpServerId=%d", time_ntpserver_cfg, deviceserial, ntpserverid), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -375,7 +375,7 @@ func DeviceGetNTPServerCfg(deviceserial string, ntpserverid int) (*model.DeviceS
|
|||
|
||||
// 该接口用于配置设备指定NTP服务器参数
|
||||
func DeviceSetNTPServerCfg(req *model.DeviceSetNTPServerCfgReq) (*model.Hikvision, error) {
|
||||
resp, err := hikvisionRequest("POST", TIM_NTPSERVER_CFG, req)
|
||||
resp, err := hikvisionRequest("POST", time_ntpserver_cfg, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,15 +11,15 @@ import (
|
|||
基础服务能力 > 设备管理 > 设备分组管理
|
||||
*/
|
||||
|
||||
const (
|
||||
var (
|
||||
/*设备分组管理*/
|
||||
GROUP_BASE = "https://api2.hik-cloud.com/api/v1/open/basic/groups"
|
||||
GROUP_CREATE = GROUP_BASE + "/create"
|
||||
GROUP_REMOVE = GROUP_BASE + "/delete"
|
||||
GROUP_UPDATE = GROUP_BASE + "/update"
|
||||
GROUP_DETAIL = GROUP_BASE + "/get"
|
||||
GROUP_LISTALL = GROUP_BASE + "/actions/listAll"
|
||||
GROUP_CHILD_LIST = GROUP_BASE + "/actions/childrenList"
|
||||
group_base = "https://api2.hik-cloud.com/api/v1/open/basic/groups"
|
||||
group_create = group_base + "/create"
|
||||
group_remove = group_base + "/delete"
|
||||
group_update = group_base + "/update"
|
||||
group_detail = group_base + "/get"
|
||||
group_listall = group_base + "/actions/listAll"
|
||||
group_child_list = group_base + "/actions/childrenList"
|
||||
)
|
||||
|
||||
// 该接口用于通过编号来新增组。最多支持3000个组,最多支持5层嵌套。
|
||||
|
|
@ -35,7 +35,7 @@ func GroupCreate(groupname, groupno, parentno string) (*model.Hikvision, error)
|
|||
ParentNo: parentno,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", GROUP_CREATE, req)
|
||||
resp, err := hikvisionRequest("POST", group_create, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ func GroupUpdate(groupname, groupno string) (*model.Hikvision, error) {
|
|||
GroupNo: groupno,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", GROUP_UPDATE, req)
|
||||
resp, err := hikvisionRequest("POST", group_update, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ func GroupUpdate(groupname, groupno string) (*model.Hikvision, error) {
|
|||
// 该接口用于通过组编号来删除组。组下面挂有下级节点或者设备的不可以删除,需清空后进行删除。
|
||||
func GroupRemove(groupNo string) (*model.Hikvision, error) {
|
||||
|
||||
resp, err := hikvisionRequest("POST", fmt.Sprintf("%s?groupNo=%s", GROUP_REMOVE, groupNo), nil)
|
||||
resp, err := hikvisionRequest("POST", fmt.Sprintf("%s?groupNo=%s", group_remove, groupNo), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -95,7 +95,7 @@ func GroupRemove(groupNo string) (*model.Hikvision, error) {
|
|||
// 该接口用于通过组编号获取组的详细信息
|
||||
func GroupDetail(groupNo string) (*model.Group, error) {
|
||||
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?groupNo=%s", GROUP_DETAIL, groupNo), nil)
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?groupNo=%s", group_detail, groupNo), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ func GroupDetail(groupNo string) (*model.Group, error) {
|
|||
// 该接口用于获取所有组。
|
||||
func GroupGetAll() ([]model.Group, error) {
|
||||
|
||||
resp, err := hikvisionRequest("GET", GROUP_LISTALL, nil)
|
||||
resp, err := hikvisionRequest("GET", group_listall, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ func GroupGetAll() ([]model.Group, error) {
|
|||
// 该接口用于通过组编号查找某组的下级节点。如果父节点为空,则查询根节点。
|
||||
func GroupChildList(groupNo string) ([]model.Group, error) {
|
||||
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?parentNo=%s", GROUP_CHILD_LIST, groupNo), nil)
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?parentNo=%s", group_child_list, groupNo), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,18 +7,18 @@ import (
|
|||
"myschools.me/suguo/hikvision/iot/model"
|
||||
)
|
||||
|
||||
const (
|
||||
PERSON_BASE = "https://api2.hik-cloud.com/api/v1/open/basic/persons"
|
||||
PERSON_CREATE = PERSON_BASE + "/create"
|
||||
PERSON_UPDARE = PERSON_BASE + "/update"
|
||||
PERSON_DELETE = PERSON_BASE + "/delete"
|
||||
PERSON_DETAIL = PERSON_BASE + "/get"
|
||||
var (
|
||||
person_base = "https://api2.hik-cloud.com/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 = "https://api2.hik-cloud.com/api/v1/open/basic/tenantConfigs/actions/updateTenantConfig"
|
||||
|
||||
FACE_BASE = "https://api2.hik-cloud.com/api/v1/open/basic/faces"
|
||||
PERSON_FACE_UPDATE = FACE_BASE + "/update"
|
||||
PERSON_FACE_DELETE = FACE_BASE + "/delete"
|
||||
face_base = "https://api2.hik-cloud.com/api/v1/open/basic/faces"
|
||||
person_face_update = face_base + "/update"
|
||||
person_face_delete = face_base + "/delete"
|
||||
)
|
||||
|
||||
// 添加人员
|
||||
|
|
@ -31,7 +31,7 @@ func PersonCreate(employeeNo, personName, personPhone, faceImageBase64 string, v
|
|||
VerifyImage: verifyImage,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PERSON_CREATE, req)
|
||||
resp, err := hikvisionRequest("POST", person_create, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ func PersonUpdate(employeeNo, personName, personPhone, faceImageBase64 string, v
|
|||
VerifyImage: verifyImage,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PERSON_UPDARE, req)
|
||||
resp, err := hikvisionRequest("POST", person_update, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ func PersonUpdate(employeeNo, personName, personPhone, faceImageBase64 string, v
|
|||
// 删除人员信息
|
||||
func PersonDelete(employeeNo string) (*model.PersonOperation, error) {
|
||||
|
||||
resp, err := hikvisionRequest("POST", fmt.Sprintf("%s?employeeNo=%s", PERSON_DELETE, employeeNo), nil)
|
||||
resp, err := hikvisionRequest("POST", fmt.Sprintf("%s?employeeNo=%s", person_delete, employeeNo), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ func PersonDelete(employeeNo string) (*model.PersonOperation, error) {
|
|||
// 获得单个人员详情
|
||||
func PersonDetail(employeeNo string) (*model.Person, error) {
|
||||
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?employeeNo=%s", PERSON_DETAIL, employeeNo), nil)
|
||||
resp, err := hikvisionRequest("GET", fmt.Sprintf("%s?employeeNo=%s", person_detail, employeeNo), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -144,7 +144,7 @@ func PersonUpdateTenantConfig(pointsQuality float64, eyeDistance, clearity, pose
|
|||
TotalQuality: totalQuality,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PERSON_FACE_SETCFG, req)
|
||||
resp, err := hikvisionRequest("POST", person_face_setcfg, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -171,7 +171,7 @@ func PersonFaceUpdate(employeeNo, faceImageBase64 string, verifyImage bool) (*mo
|
|||
FaceImageBase64: faceImageBase64,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PERSON_FACE_UPDATE, req)
|
||||
resp, err := hikvisionRequest("POST", person_face_update, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ func PersonFaceUpdate(employeeNo, faceImageBase64 string, verifyImage bool) (*mo
|
|||
// 人员人脸删除
|
||||
func PersonFaceDelete(employeeNo string) (*model.Hikvision, error) {
|
||||
|
||||
resp, err := hikvisionRequest("POST", fmt.Sprintf("%s?employeeNo=%s", PERSON_FACE_DELETE, employeeNo), nil)
|
||||
resp, err := hikvisionRequest("POST", fmt.Sprintf("%s?employeeNo=%s", person_face_delete, employeeNo), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,18 +7,18 @@ import (
|
|||
"myschools.me/suguo/hikvision/iot/model"
|
||||
)
|
||||
|
||||
const (
|
||||
PLAN_BASE = "https://api2.hik-cloud.com/api/v1/open/access/plans"
|
||||
PLAN_WEEK = PLAN_BASE + "/weeks"
|
||||
PLAN_WEEK_CFG = PLAN_WEEK + "/config"
|
||||
var (
|
||||
plan_base = "https://api2.hik-cloud.com/api/v1/open/access/plans"
|
||||
plan_week = plan_base + "/weeks"
|
||||
plan_week_cfg = plan_week + "/config"
|
||||
|
||||
PLAN_HOLIDAY = PLAN_BASE + "/holidays"
|
||||
PLAN_HOLIDAY_CFG = PLAN_HOLIDAY + "/config"
|
||||
PLAN_HOLIDAY_GROUPCFG = PLAN_HOLIDAY + "/groups/config"
|
||||
plan_holiday = plan_base + "/holidays"
|
||||
plan_holiday_cfg = plan_holiday + "/config"
|
||||
plan_holiday_groupcfg = plan_holiday + "/groups/config"
|
||||
|
||||
PLAN_TEMPLATE = PLAN_BASE + "/templates"
|
||||
PLAN_TEMPLATE_CFG = PLAN_TEMPLATE + "/config"
|
||||
PLAN_TEMPLATE_CFGPOL = PLAN_TEMPLATE + "/config/polymerization"
|
||||
plan_template = plan_base + "/templates"
|
||||
plan_template_cfg = plan_template + "/config"
|
||||
plan_template_cfgpol = plan_template + "/config/polymerization"
|
||||
)
|
||||
|
||||
// 周计划模板添加/更新 customPlanId不存在 新增,存在更新
|
||||
|
|
@ -29,7 +29,7 @@ func PLANWEEKTempleteCreateOrUpdate(customplanid string, enable bool, weekplan [
|
|||
WeekPlan: weekplan,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PLAN_WEEK, req)
|
||||
resp, err := hikvisionRequest("POST", plan_week, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ func PLANWEEKTempleteCreateOrUpdate(customplanid string, enable bool, weekplan [
|
|||
|
||||
// 获取所有周计划模板
|
||||
func PLANWEEKTempleteGetAll(pageNo, pageSize int) (*model.PlanWeekDetail, error) {
|
||||
url := fmt.Sprintf("%s?pageNo=%d&pageSize=%d", PLAN_WEEK, pageNo, pageSize)
|
||||
url := fmt.Sprintf("%s?pageNo=%d&pageSize=%d", plan_week, pageNo, pageSize)
|
||||
resp, err := hikvisionRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -67,7 +67,7 @@ func PLANWEEKTempleteGetAll(pageNo, pageSize int) (*model.PlanWeekDetail, error)
|
|||
|
||||
// 周计划模板删除
|
||||
func PLANWEEKTempleteDelete(customplanid string) (*model.Hikvision, error) {
|
||||
url := fmt.Sprintf("%s?customPlanId=%s", PLAN_WEEK, customplanid)
|
||||
url := fmt.Sprintf("%s?customPlanId=%s", plan_week, customplanid)
|
||||
resp, err := hikvisionRequest("DELETE", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -93,7 +93,7 @@ func PLANHolidayTempleteCreateOrUpdate(customplanid string, enable bool, beginda
|
|||
HolidayPlan: plan,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PLAN_HOLIDAY, req)
|
||||
resp, err := hikvisionRequest("POST", plan_holiday, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ func PLANHolidayTempleteCreateOrUpdate(customplanid string, enable bool, beginda
|
|||
|
||||
// 假日计划模板获取
|
||||
func PLANHolidayTempleteGetAll(pageNo, pageSize int) (*model.PlanHolidayDetail, error) {
|
||||
url := fmt.Sprintf("%s?pageNo=%d&pageSize=%d", PLAN_HOLIDAY, pageNo, pageSize)
|
||||
url := fmt.Sprintf("%s?pageNo=%d&pageSize=%d", plan_holiday, pageNo, pageSize)
|
||||
resp, err := hikvisionRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -131,7 +131,7 @@ func PLANHolidayTempleteGetAll(pageNo, pageSize int) (*model.PlanHolidayDetail,
|
|||
|
||||
// 假日计划模板删除
|
||||
func PLANHolidayTempleteDelete(customplanid string) (*model.Hikvision, error) {
|
||||
url := fmt.Sprintf("%s?customPlanId=%s", PLAN_HOLIDAY, customplanid)
|
||||
url := fmt.Sprintf("%s?customPlanId=%s", plan_holiday, customplanid)
|
||||
resp, err := hikvisionRequest("DELETE", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -163,7 +163,7 @@ func PlanWeekConfigSet(configtype, deviceid string, planno int, customplanid str
|
|||
CustomPlanId: customplanid,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PLAN_WEEK_CFG, req)
|
||||
resp, err := hikvisionRequest("POST", plan_week_cfg, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ func PlanWeekConfigSet(configtype, deviceid string, planno int, customplanid str
|
|||
// 根据周计划编号获取设备上的周计划
|
||||
func PlanWeekConfigGet(configtype, deviceid string, planno int) (*model.PlanWeekRow, error) {
|
||||
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&planNo=%d", PLAN_WEEK_CFG, configtype, deviceid, planno)
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&planNo=%d", plan_week_cfg, configtype, deviceid, planno)
|
||||
resp, err := hikvisionRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -219,7 +219,7 @@ func PlanHolidayConfigSet(configtype, deviceid string, planno int, customplanid
|
|||
CustomPlanId: customplanid,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PLAN_HOLIDAY_CFG, req)
|
||||
resp, err := hikvisionRequest("POST", plan_holiday_cfg, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -239,7 +239,7 @@ func PlanHolidayConfigSet(configtype, deviceid string, planno int, customplanid
|
|||
// 根据假日计划编号获取设备上的假日计划
|
||||
func PlanHolidayConfigGet(configtype, deviceid string, planno int) (*model.PlanHolidayRow, error) {
|
||||
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&planNo=%d", PLAN_HOLIDAY_CFG, configtype, deviceid, planno)
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&planNo=%d", plan_holiday_cfg, configtype, deviceid, planno)
|
||||
resp, err := hikvisionRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -278,7 +278,7 @@ func PlanHolidayGroupConfigSet(configtype, deviceid string, groupno int, enable
|
|||
HolidayPlanNo: holidayplanno,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PLAN_HOLIDAY_GROUPCFG, req)
|
||||
resp, err := hikvisionRequest("POST", plan_holiday_groupcfg, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -298,7 +298,7 @@ func PlanHolidayGroupConfigSet(configtype, deviceid string, groupno int, enable
|
|||
// 根据假日组编号获取设备上的假日组计划,假日组计划即为多个假日计划的组合
|
||||
func PlanHolidayGroupConfigGet(configtype, deviceid string, groupno int) (*model.PlanGroupConfig, error) {
|
||||
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&groupNo=%d", PLAN_HOLIDAY_CFG, configtype, deviceid, groupno)
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&groupNo=%d", plan_holiday_cfg, configtype, deviceid, groupno)
|
||||
resp, err := hikvisionRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -339,7 +339,7 @@ func PlanGlobalConfig(configtype, deviceid string, templateno int, enable bool,
|
|||
HolidayGroupNo: holidayplanno,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PLAN_TEMPLATE_CFG, req)
|
||||
resp, err := hikvisionRequest("POST", plan_template_cfg, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -376,7 +376,7 @@ func PlanGlobalPolymerizationConfig(configtype, deviceid string, templateno int,
|
|||
HolidayPlanGroup: holidayplanno,
|
||||
}
|
||||
|
||||
resp, err := hikvisionRequest("POST", PLAN_TEMPLATE_CFGPOL, req)
|
||||
resp, err := hikvisionRequest("POST", plan_template_cfgpol, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -396,7 +396,7 @@ func PlanGlobalPolymerizationConfig(configtype, deviceid string, templateno int,
|
|||
// 获取设备上的门禁计划
|
||||
func PlanGlobalConfigGet(configtype, deviceid string, templateno int) (*model.PlanGlobalConfig, error) {
|
||||
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&templateNo=%d", PLAN_TEMPLATE_CFG, configtype, deviceid, templateno)
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&templateNo=%d", plan_template_cfg, configtype, deviceid, templateno)
|
||||
resp, err := hikvisionRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -420,7 +420,7 @@ func PlanGlobalConfigGet(configtype, deviceid string, templateno int) (*model.Pl
|
|||
// 清空设备上的门禁计划
|
||||
func PlanGlobalConfigDelete(configtype, deviceid string, templateno int) (*model.PlanGlobalConfig, error) {
|
||||
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&templateNo=%d", PLAN_TEMPLATE_CFG, configtype, deviceid, templateno)
|
||||
url := fmt.Sprintf("%s?configType=%s&deviceId=%s&templateNo=%d", plan_template_cfg, configtype, deviceid, templateno)
|
||||
resp, err := hikvisionRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Reference in New Issue