package com.xiaomai.cases.polar.admin;

import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.LoginAccount;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.TimeUtils;
import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class TestSwitchStudio extends XMBaseTest {
    @BeforeMethod
    public void beforeTest(){
        xmAppApi.setApiModule(ApiModule.Polar_Admin)
                .setApiName("API_switchStudio")
                .setLoginUser(LoginAccount.GYM_PROD)
                .setTerminal(Terminal.B);
        dal.setCase_owner("yj")
                .setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
        super.beforeTest();
    }
    //@Test(description = "切换场馆")
    public void testSwitchStudio() {

        AdminTools tools =new AdminTools();
        tools.pagelistAdmins("");
        String studioId = XMJSONPath.readPath(dataApi.getApi_response(), "$.result[0].defaultStudioId");//获取场馆ID




        JSONObject jsonObject = new JSONObject();
        jsonObject.put("adminId",xmAppApi.getLoginInfo().getAdminId());

        jsonObject.put("studioId",studioId);



        xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
    }
}
