切卡模式更新
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m58s

This commit is contained in:
2026-04-29 10:18:15 +08:00
parent 37b4483183
commit 74c7b27327
6 changed files with 218 additions and 7 deletions

View File

@@ -70,9 +70,16 @@ func (c *Client) RebootDevice(ctx context.Context, req *DeviceOperationReq) erro
}
// SwitchMode 设置设备切卡模式
// Gateway 实际要求 cardNo 传设备 IMEIswitch_mode 传字符串,并且必须指定目标 ICCID
// 切换设备卡槽的自动/手动模式0=自动切卡1=手动切卡
// POST /device/SwitchMode
func (c *Client) SwitchMode(ctx context.Context, req *SwitchModeReq) error {
if req.CardNo == "" {
return errors.New(errors.CodeInvalidParam, "cardNo 不能为空")
}
if req.ICCID == "" {
return errors.New(errors.CodeInvalidParam, "iccid 不能为空")
}
_, err := c.doRequest(ctx, "/device/SwitchMode", req)
return err
}