七月迭代短暂完结,还有很多后端的关键东西没有弄,这是一版赶时间做的东西
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s

This commit is contained in:
2026-07-25 17:06:58 +08:00
parent ad9f613dd6
commit 73f5125d3d
249 changed files with 17137 additions and 877 deletions

View File

@@ -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