七月迭代短暂完结,还有很多后端的关键东西没有弄,这是一版赶时间做的东西
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s
This commit is contained in:
@@ -212,28 +212,28 @@ func (s *Service) GetDeviceSlots(ctx context.Context, imei string) ([]gateway.Sl
|
||||
}
|
||||
```
|
||||
|
||||
#### 设置设备限速
|
||||
#### 设置流量卡固定限速档位
|
||||
|
||||
```go
|
||||
func (s *Service) SetDeviceSpeed(ctx context.Context, imei string, uploadKBps, downloadKBps int) error {
|
||||
err := s.gatewayClient.SetSpeedLimit(ctx, &gateway.SpeedLimitReq{
|
||||
DeviceID: imei,
|
||||
UploadSpeed: uploadKBps,
|
||||
DownloadSpeed: downloadKBps,
|
||||
func (s *Service) SetCardSpeedTier(ctx context.Context, iccid string, code int) error {
|
||||
err := s.gatewayClient.SetCardSpeedTier(ctx, &gateway.CardSpeedTierReq{
|
||||
CardNo: iccid,
|
||||
Code: strconv.Itoa(code),
|
||||
})
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.CodeGatewayError, err, "设置限速失败")
|
||||
return errors.Wrap(errors.CodeGatewayError, err, "设置流量卡固定限速档位失败")
|
||||
}
|
||||
|
||||
s.logger.Info("设置限速成功",
|
||||
zap.String("imei", imei),
|
||||
zap.Int("upload", uploadKBps),
|
||||
zap.Int("download", downloadKBps),
|
||||
s.logger.Info("设置流量卡固定限速档位成功",
|
||||
zap.String("iccid", iccid),
|
||||
zap.Int("code", code),
|
||||
)
|
||||
return nil
|
||||
}
|
||||
```
|
||||
|
||||
Gateway 限速对象只有流量卡 ICCID。设备没有限速接口,业务代码不得传入设备 ID、IMEI,也不得先解析设备当前绑定卡再间接限速。
|
||||
|
||||
#### 设置设备 WiFi
|
||||
|
||||
```go
|
||||
|
||||
Reference in New Issue
Block a user