-
Notifications
You must be signed in to change notification settings - Fork 0
/
Aep_product_management.go
97 lines (72 loc) · 2.97 KB
/
Aep_product_management.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package aepapi
import (
aepsdkcore "github.com/LuoYaoSheng/runThingsServer/extend/aepApis/core"
"net/http"
)
//参数productId: 类型long, 参数不可以为空
// 描述:
func QueryProduct(appKey string, appSecret string, productId string) (*http.Response, error) {
path := "/aep_product_management/product"
var headers map[string]string = nil
var param map[string]string = make(map[string]string)
param["productId"] = productId
version := "20181031202055"
application := appKey
key := appSecret
return aepsdkcore.SendAepHttpRequest(path, headers, param, "", version, application, key, "GET")
}
//参数searchValue: 类型String, 参数可以为空
// 描述:产品id或者产品名称
//参数pageNow: 类型long, 参数可以为空
// 描述:当前页数
//参数pageSize: 类型long, 参数可以为空
// 描述:每页记录数
func QueryProductList(appKey string, appSecret string, searchValue string, pageNow string, pageSize string) (*http.Response, error) {
path := "/aep_product_management/products"
var headers map[string]string = nil
var param map[string]string = make(map[string]string)
param["searchValue"] = searchValue
param["pageNow"] = pageNow
param["pageSize"] = pageSize
version := "20190507004824"
application := appKey
key := appSecret
return aepsdkcore.SendAepHttpRequest(path, headers, param, "", version, application, key, "GET")
}
//参数MasterKey: 类型String, 参数不可以为空
// 描述:MasterKey在该设备所属产品的概况中可以查看
//参数productId: 类型long, 参数不可以为空
// 描述:
func DeleteProduct(appKey string, appSecret string, MasterKey string, productId string) (*http.Response, error) {
path := "/aep_product_management/product"
var headers map[string]string = make(map[string]string)
headers["MasterKey"] = MasterKey
var param map[string]string = make(map[string]string)
param["productId"] = productId
version := "20181031202029"
application := appKey
key := appSecret
return aepsdkcore.SendAepHttpRequest(path, headers, param, "", version, application, key, "DELETE")
}
//参数body: 类型json, 参数不可以为空
// 描述:body,具体参考平台api说明
func CreateProduct(appKey string, appSecret string, body string) (*http.Response, error) {
path := "/aep_product_management/product"
var headers map[string]string = nil
var param map[string]string = nil
version := "20191018204154"
application := appKey
key := appSecret
return aepsdkcore.SendAepHttpRequest(path, headers, param, body, version, application, key, "POST")
}
//参数body: 类型json, 参数不可以为空
// 描述:body,具体参考平台api说明
func UpdateProduct(appKey string, appSecret string, body string) (*http.Response, error) {
path := "/aep_product_management/product"
var headers map[string]string = nil
var param map[string]string = nil
version := "20191018204806"
application := appKey
key := appSecret
return aepsdkcore.SendAepHttpRequest(path, headers, param, body, version, application, key, "PUT")
}