aa
This commit is contained in:
@@ -147,7 +147,14 @@ func (a *API) BatchQueryCardInfo(pageNum int) (batchQueryCardInfoResult *BatchQu
|
||||
return batchQueryCardInfoResult, err
|
||||
}
|
||||
|
||||
func (a *API) IotData(iccid, queryTime string) (getCardInfoResult *GetCardInfoResult, err error) {
|
||||
type IotDataResult struct {
|
||||
SyncStatus string `json:"sync_status"`
|
||||
CardFlow string `json:"card_flow"`
|
||||
CreateTime string `json:"create_time"`
|
||||
SyncTime string `json:"sync_time"`
|
||||
}
|
||||
|
||||
func (a *API) IotData(iccid, queryTime string) (getCardInfoResult *IotDataResult, err error) {
|
||||
result, err := a.AccessAPI("card/iotData", map[string]interface{}{
|
||||
"iccid": iccid,
|
||||
"query_time": queryTime,
|
||||
@@ -158,6 +165,26 @@ func (a *API) IotData(iccid, queryTime string) (getCardInfoResult *GetCardInfoRe
|
||||
return getCardInfoResult, err
|
||||
}
|
||||
|
||||
type IotDataMonthResult struct {
|
||||
CardFlow string `json:"card_flow"`
|
||||
TotalFlow string `json:"total_flow"`
|
||||
LeftFlow string `json:"left_flow"`
|
||||
PackageName string `json:"package_name"`
|
||||
ActivateTime string `json:"activate_time"`
|
||||
PackageTime string `json:"package_time"`
|
||||
}
|
||||
|
||||
func (a *API) IotDataMonth(iccid string) (getCardInfoResult *IotDataMonthResult, err error) {
|
||||
result, err := a.AccessAPI("card/iotData", map[string]interface{}{
|
||||
"iccid": iccid,
|
||||
"card_type": 1,
|
||||
}, false)
|
||||
if err == nil && result != nil {
|
||||
utils.Map2StructByJson(result, &getCardInfoResult, false)
|
||||
}
|
||||
return getCardInfoResult, err
|
||||
}
|
||||
|
||||
func (a *API) CardActivation(iccid string) (getCardInfoResult *GetCardInfoResult, err error) {
|
||||
result, err := a.AccessAPI("card/cardActivation", map[string]interface{}{
|
||||
"iccid": iccid,
|
||||
|
||||
@@ -44,6 +44,14 @@ func TestIotData(t *testing.T) {
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestIotData2(t *testing.T) {
|
||||
result, err := api.IotDataMonth("89860490102070456598")
|
||||
if err != nil {
|
||||
t.Fatalf("PrintMsg return error:%v", err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestCardActivation(t *testing.T) {
|
||||
result, err := api.CardActivation("1")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user