import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.TransferActiveCodeDTO;
import com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.hm.HmPageApiService;
import com.gic.haoban.manage.service.service.WxEnterpriseActiveDataService;
import com.google.gson.JsonObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @Author: wenhua
 * @Date: 2023/2/2 14:12
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-conf.xml"})
public class WxEnterpriseActiveDataServiceTest {

    @Autowired
    private WxEnterpriseActiveDataService wxEnterpriseActiveDataService;

    @Autowired
    private StaffApiService staffApiService;
    @Test
    public void test(){
        Integer integer = wxEnterpriseActiveDataService.saveOrUpdate("ca66a01b79474c40b3e7c7f93daf1a3b");
        System.out.println(integer);
    }
    @Test
    public void test1(){
        List<TransferActiveCodeQDTO> transferActiveCodeQOList = new ArrayList<>();
        TransferActiveCodeQDTO transferActiveCodeQDTO = new TransferActiveCodeQDTO();
        transferActiveCodeQDTO.setHandoverStaffId("1fccf6ff6ecf434d9b00f31227b45d63");
        transferActiveCodeQDTO.setTakeoverStaffId("8a3a60a4e5b546b79087ee70f1844b25");
        transferActiveCodeQOList.add(transferActiveCodeQDTO);

//        TransferActiveCodeQDTO transferActiveCodeQDTO1 = new TransferActiveCodeQDTO();
//        transferActiveCodeQDTO1.setHandoverStaffId("wo59NLDQAAxWVUBU76zh3jRMXZ8TOxfw");
//        transferActiveCodeQDTO1.setTakeoverStaffId("wo59NLDQAArJKx2wWmQGWTOd36ueijwQ");
//        transferActiveCodeQOList.add(transferActiveCodeQDTO1);
        ServiceResponse<TransferActiveCodeDTO> transferLicense = staffApiService.batchTransferLicense(transferActiveCodeQOList, "ca66a01b79474c40b3e7c7f93daf1a3b");
        System.out.println("222222222222"+ JSONObject.toJSONString(transferLicense));


    }
}
