package com.live.xmutils;

import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.utils.XMBaseTest;


/**
 * Created by zhangying on  2020/11/20
 */

public class GetCustomerLiveXMToken extends XMBaseTest {

    public void getMsgAuthCode(){
        dataApi.setApiModule(ApiModele.CloudClass_customerLive) // API 所属模块  必传 读取配置文件config.properties配置的api地址
                .setApiName("api_login");
        super.beforeTest();

    JSONObject jsonObject = new JSONObject();

//        {
//            "accountNo": "15068165765",
//                "certificate": "0000",
//                "loginType": "PHONE_AUTH_CODE",
//                "appTerm": "IOS",
//                "userType": "C"
//        }

    jsonObject.put("accountNo","15068165765");
    jsonObject.put("certificate", "0000");
    jsonObject.put("loginType", "PHONE_AUTH_CODE");
    jsonObject.put("appTerm", "IOS");
    jsonObject.put("userType", "C");

    System.out.println("jsonObject= " + jsonObject);

    okHttpClient.doPostRequest(dataApi.getUrl(),jsonObject.toJSONString(),headers);

//    xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
//    //
    JSONObject responseRes = xmAppApi.getBodyInJSON();
    System.out.println("responseRes= " + responseRes);

    }
}
