package com.xiaomai.cases.polar.studioConfig;

import com.alibaba.fastjson.JSONObject;
import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest;
import org.springframework.stereotype.Component;

@Component("merchantTools")
public class MerchantTools extends XMBaseTest {

    public JSONObject getApplyPage(){
        dataApi.setApiModule(ApiModule.Polar_Merchant)
                .setApiName("API_pageApply")
                .setTerminal(Terminal.B);
        super.beforeDataRequest();

        JSONObject object = new JSONObject();
        object.put("current",0);
        object.put("size",20);
        object.put("brandId",dataApi.getLoginInfo().getBrandId());
        object.put("studioId",dataApi.getLoginInfo().getStudioId());
        object.put("operatorId",dataApi.getLoginInfo().getAdminId());

        dataApi.doRequest(RequestType.JSON,dataparams,object.toJSONString(),dataheadrs).assetsSuccess(true);
        return dataApi.getBodyInJSON();
    }
}
