修复设备WiFi上游请求参数
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m40s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m40s
This commit is contained in:
@@ -237,17 +237,13 @@ func (s *Service) SetDeviceSpeed(ctx context.Context, imei string, uploadKBps, d
|
||||
#### 设置设备 WiFi
|
||||
|
||||
```go
|
||||
func (s *Service) ConfigureWiFi(ctx context.Context, imei, ssid, password string, enabled bool) error {
|
||||
enabledInt := 0
|
||||
if enabled {
|
||||
enabledInt = 1
|
||||
}
|
||||
|
||||
func (s *Service) ConfigureWiFi(ctx context.Context, imei, ssid, password string) error {
|
||||
err := s.gatewayClient.SetWiFi(ctx, &gateway.WiFiReq{
|
||||
DeviceID: imei,
|
||||
SSID: ssid,
|
||||
Password: password,
|
||||
Enabled: enabledInt,
|
||||
CardNo: imei,
|
||||
Params: gateway.WiFiParams{
|
||||
SSIDName: ssid,
|
||||
SSIDPassword: password,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return errors.Wrap(errors.CodeGatewayError, err, "设置WiFi失败")
|
||||
|
||||
Reference in New Issue
Block a user