562935844@qq.com
2023-04-11 2574334327d47d5b0d62e1e9fe442a493bbcf2bd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.hdl.sdk.connect.cloud;
 
import com.hdl.hdlhttp.HxHttp;
 
import io.reactivex.rxjava3.disposables.Disposable;
 
/**
 * Created by panlili on 2023/1/30
 * description:
 */
public class HdlCloudController {
 
    public static Disposable applyDeviceSecret(String supplier, String mac, String spk, CallBackListener callBack) {
        return HxHttp.builder()
                .url(HdlCloudApi.BASE_CHINA_URL + HdlCloudApi.APPLY_DEVICE_SECRET)
                .params("supplier", supplier)
                .params("mac", mac)
                .params("spk", spk)
                .build()
                .post()
                .subscribeWith(new HDLResponse<String>() {
                    @Override
                    public void onResponse(String response) {
                        if (callBack != null) {
                            callBack.onSuccess(response);
                        }
                    }
 
                    @Override
                    public void onFailure(HDLException e) {
                        if (callBack != null) {
                            callBack.onError(e);
                        }
                    }
                });
    }
 
}