Skip to content

Commit e5a1bdc

Browse files
Merge pull request #175 from jdcloud-apigateway/master
2022-07-13
2 parents d9c0dbf + 0a5331d commit e5a1bdc

6 files changed

Lines changed: 350 additions & 1 deletion

File tree

services/iotlink/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ API版本:1.0.5
44

55
| 发布时间 | 版本号 | 更新 | 说明 |
66
| ---------- | ------ | -------- | ------------------------------------------------------------ |
7+
| 2022-06-08 | 1.0.6 | 接口完善 | 新增加实名认证状态查询接口及卡基本信息查询接口 |
78
| 2021-12-14 | 1.0.5 | 接口完善 | 新增通过IMSI参数进行流量查询、开关机查询、上网状态查询、生命周期查询接口 |
89
| 2020-03-18 | 1.0.4 | 接口完善 | 增加卡查询与卡操作通用接口,IMEI查询接口 |
910
| 2019-11-18 | 1.0.3 | 接口完善 | 开关机状态、生命周期、GPRS状态查询接口返回结果增加imsi字段 |

services/iotlink/apis/CardInfo.go

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// Copyright 2018 JDCLOUD.COM
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// NOTE: This class is auto generated by the jdcloud code generator program.
16+
17+
package apis
18+
19+
import (
20+
"github.com/jdcloud-api/jdcloud-sdk-go/core"
21+
iotlink "github.com/jdcloud-api/jdcloud-sdk-go/services/iotlink/models"
22+
)
23+
24+
type CardInfoRequest struct {
25+
26+
core.JDCloudRequest
27+
28+
/* Region ID */
29+
RegionId string `json:"regionId"`
30+
31+
/* 物联网卡iccid */
32+
Iccid string `json:"iccid"`
33+
}
34+
35+
/*
36+
* param regionId: Region ID (Required)
37+
* param iccid: 物联网卡iccid (Required)
38+
*
39+
* @Deprecated, not compatible when mandatory parameters changed
40+
*/
41+
func NewCardInfoRequest(
42+
regionId string,
43+
iccid string,
44+
) *CardInfoRequest {
45+
46+
return &CardInfoRequest{
47+
JDCloudRequest: core.JDCloudRequest{
48+
URL: "/regions/{regionId}/cardInfo",
49+
Method: "GET",
50+
Header: nil,
51+
Version: "v1",
52+
},
53+
RegionId: regionId,
54+
Iccid: iccid,
55+
}
56+
}
57+
58+
/*
59+
* param regionId: Region ID (Required)
60+
* param iccid: 物联网卡iccid (Required)
61+
*/
62+
func NewCardInfoRequestWithAllParams(
63+
regionId string,
64+
iccid string,
65+
) *CardInfoRequest {
66+
67+
return &CardInfoRequest{
68+
JDCloudRequest: core.JDCloudRequest{
69+
URL: "/regions/{regionId}/cardInfo",
70+
Method: "GET",
71+
Header: nil,
72+
Version: "v1",
73+
},
74+
RegionId: regionId,
75+
Iccid: iccid,
76+
}
77+
}
78+
79+
/* This constructor has better compatible ability when API parameters changed */
80+
func NewCardInfoRequestWithoutParam() *CardInfoRequest {
81+
82+
return &CardInfoRequest{
83+
JDCloudRequest: core.JDCloudRequest{
84+
URL: "/regions/{regionId}/cardInfo",
85+
Method: "GET",
86+
Header: nil,
87+
Version: "v1",
88+
},
89+
}
90+
}
91+
92+
/* param regionId: Region ID(Required) */
93+
func (r *CardInfoRequest) SetRegionId(regionId string) {
94+
r.RegionId = regionId
95+
}
96+
97+
/* param iccid: 物联网卡iccid(Required) */
98+
func (r *CardInfoRequest) SetIccid(iccid string) {
99+
r.Iccid = iccid
100+
}
101+
102+
// GetRegionId returns path parameter 'regionId' if exist,
103+
// otherwise return empty string
104+
func (r CardInfoRequest) GetRegionId() string {
105+
return r.RegionId
106+
}
107+
108+
type CardInfoResponse struct {
109+
RequestID string `json:"requestId"`
110+
Error core.ErrorResponse `json:"error"`
111+
Result CardInfoResult `json:"result"`
112+
}
113+
114+
type CardInfoResult struct {
115+
Status string `json:"status"`
116+
Message string `json:"message"`
117+
Result iotlink.CardInfoResp `json:"result"`
118+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// Copyright 2018 JDCLOUD.COM
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// NOTE: This class is auto generated by the jdcloud code generator program.
16+
17+
package apis
18+
19+
import (
20+
"github.com/jdcloud-api/jdcloud-sdk-go/core"
21+
iotlink "github.com/jdcloud-api/jdcloud-sdk-go/services/iotlink/models"
22+
)
23+
24+
type RealNameQueryIotRequest struct {
25+
26+
core.JDCloudRequest
27+
28+
/* Region ID */
29+
RegionId string `json:"regionId"`
30+
31+
/* 物联网卡iccid */
32+
Iccid string `json:"iccid"`
33+
}
34+
35+
/*
36+
* param regionId: Region ID (Required)
37+
* param iccid: 物联网卡iccid (Required)
38+
*
39+
* @Deprecated, not compatible when mandatory parameters changed
40+
*/
41+
func NewRealNameQueryIotRequest(
42+
regionId string,
43+
iccid string,
44+
) *RealNameQueryIotRequest {
45+
46+
return &RealNameQueryIotRequest{
47+
JDCloudRequest: core.JDCloudRequest{
48+
URL: "/regions/{regionId}/realNameQueryIot",
49+
Method: "GET",
50+
Header: nil,
51+
Version: "v1",
52+
},
53+
RegionId: regionId,
54+
Iccid: iccid,
55+
}
56+
}
57+
58+
/*
59+
* param regionId: Region ID (Required)
60+
* param iccid: 物联网卡iccid (Required)
61+
*/
62+
func NewRealNameQueryIotRequestWithAllParams(
63+
regionId string,
64+
iccid string,
65+
) *RealNameQueryIotRequest {
66+
67+
return &RealNameQueryIotRequest{
68+
JDCloudRequest: core.JDCloudRequest{
69+
URL: "/regions/{regionId}/realNameQueryIot",
70+
Method: "GET",
71+
Header: nil,
72+
Version: "v1",
73+
},
74+
RegionId: regionId,
75+
Iccid: iccid,
76+
}
77+
}
78+
79+
/* This constructor has better compatible ability when API parameters changed */
80+
func NewRealNameQueryIotRequestWithoutParam() *RealNameQueryIotRequest {
81+
82+
return &RealNameQueryIotRequest{
83+
JDCloudRequest: core.JDCloudRequest{
84+
URL: "/regions/{regionId}/realNameQueryIot",
85+
Method: "GET",
86+
Header: nil,
87+
Version: "v1",
88+
},
89+
}
90+
}
91+
92+
/* param regionId: Region ID(Required) */
93+
func (r *RealNameQueryIotRequest) SetRegionId(regionId string) {
94+
r.RegionId = regionId
95+
}
96+
97+
/* param iccid: 物联网卡iccid(Required) */
98+
func (r *RealNameQueryIotRequest) SetIccid(iccid string) {
99+
r.Iccid = iccid
100+
}
101+
102+
// GetRegionId returns path parameter 'regionId' if exist,
103+
// otherwise return empty string
104+
func (r RealNameQueryIotRequest) GetRegionId() string {
105+
return r.RegionId
106+
}
107+
108+
type RealNameQueryIotResponse struct {
109+
RequestID string `json:"requestId"`
110+
Error core.ErrorResponse `json:"error"`
111+
Result RealNameQueryIotResult `json:"result"`
112+
}
113+
114+
type RealNameQueryIotResult struct {
115+
Status string `json:"status"`
116+
Message string `json:"message"`
117+
Result iotlink.RealNameQueryIotResp `json:"result"`
118+
}

services/iotlink/client/IotlinkClient.go

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NewIotlinkClient(credential *core.Credential) *IotlinkClient {
4040
Credential: *credential,
4141
Config: *config,
4242
ServiceName: "iotlink",
43-
Revision: "1.0.5",
43+
Revision: "1.0.6",
4444
Logger: core.NewDefaultLogger(core.LogInfo),
4545
}}
4646
}
@@ -337,3 +337,43 @@ func (c *IotlinkClient) GprsRealtimeInfoByIMSI(request *iotlink.GprsRealtimeInfo
337337
return jdResp, err
338338
}
339339

340+
/* 根据物联网卡iccid查询该卡的实名认证信息 */
341+
func (c *IotlinkClient) RealNameQueryIot(request *iotlink.RealNameQueryIotRequest) (*iotlink.RealNameQueryIotResponse, error) {
342+
if request == nil {
343+
return nil, errors.New("Request object is nil. ")
344+
}
345+
resp, err := c.Send(request, c.ServiceName)
346+
if err != nil {
347+
return nil, err
348+
}
349+
350+
jdResp := &iotlink.RealNameQueryIotResponse{}
351+
err = json.Unmarshal(resp, jdResp)
352+
if err != nil {
353+
c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
354+
return nil, err
355+
}
356+
357+
return jdResp, err
358+
}
359+
360+
/* 根据物联网卡iccid查询该卡的基本信息 */
361+
func (c *IotlinkClient) CardInfo(request *iotlink.CardInfoRequest) (*iotlink.CardInfoResponse, error) {
362+
if request == nil {
363+
return nil, errors.New("Request object is nil. ")
364+
}
365+
resp, err := c.Send(request, c.ServiceName)
366+
if err != nil {
367+
return nil, err
368+
}
369+
370+
jdResp := &iotlink.CardInfoResponse{}
371+
err = json.Unmarshal(resp, jdResp)
372+
if err != nil {
373+
c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
374+
return nil, err
375+
}
376+
377+
return jdResp, err
378+
}
379+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2018 JDCLOUD.COM
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// NOTE: This class is auto generated by the jdcloud code generator program.
16+
17+
package models
18+
19+
20+
type CardInfoResp struct {
21+
22+
/* 物联网卡iccid (Optional) */
23+
Iccid string `json:"iccid"`
24+
25+
/* 物联网卡套餐名称 (Optional) */
26+
PackageName string `json:"packageName"`
27+
28+
/* 物联网卡激活时间 (Optional) */
29+
ActiveTm string `json:"activeTm"`
30+
31+
/* 套餐到期时间 (Optional) */
32+
PackageExpiredTm string `json:"packageExpiredTm"`
33+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2018 JDCLOUD.COM
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// NOTE: This class is auto generated by the jdcloud code generator program.
16+
17+
package models
18+
19+
20+
type RealNameQueryIotResp struct {
21+
22+
/* 激活时间 (Optional) */
23+
ActiveTime string `json:"activeTime"`
24+
25+
/* 产品状态 (Optional) */
26+
ProdStatusName string `json:"prodStatusName"`
27+
28+
/* 使用人身份证号码 (Optional) */
29+
CertNumber string `json:"certNumber"`
30+
31+
/* 查询号码 (Optional) */
32+
Number string `json:"number"`
33+
34+
/* 返回状态标识码(0 表示成功,1 表示失败,-1 表示异常,-2 表示该卡尚未进行实名认证) (Optional) */
35+
AuthRespCode string `json:"authRespCode"`
36+
37+
/* 返回标识说明 (Optional) */
38+
AuthRespMsg string `json:"authRespMsg"`
39+
}

0 commit comments

Comments
 (0)