package com.xiaomai.cases.polar.admin;

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

public class TestEditCurrentAdmin extends XMBaseTest {
    @BeforeMethod
    public void beforeTest(){
        xmAppApi.setApiModule(ApiModule.Polar_Admin)
                .setApiName("API_editCurrentAdmin")
                .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 testEditCurrentAdmin() {

        Long birthDate = TimeUtils.getBeforeDayDate(7305);
        JSONObject Object = new JSONObject();
        Object.put("content", "自动化账户");
        Object.put("imageId", "1761941332668588033");

        JSONObject Object1 = new JSONObject();
        Object1.put("intro", "自动化个人简介-个人资料编辑");



        JSONObject jsonObject = new JSONObject();
        jsonObject.put("coachInfo",Object1);
        jsonObject.put("nickName","自动化昵称");
        jsonObject.put("birthDate",birthDate);
        jsonObject.put("gender","MAN");
        jsonObject.put("id",xmAppApi.getLoginInfo().getAdminId());
        jsonObject.put("avatar",Object);


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