import org.jeecg.pm.hikvision.sdk.client.HikvisionBaseClient;
import org.jeecg.pm.hikvision.sdk.client.HikvisionClient;
import org.jeecg.pm.hikvision.sdk.entity.body.eps.HikvisionSubscribeEventsFromMQEx;
import org.jeecg.pm.hikvision.sdk.entity.body.vss.res.HikvisionGetCamerasEx;
import org.jeecg.pm.hikvision.sdk.entity.body.vss.res.HikvisionGetEncoders;
import org.jeecg.pm.hikvision.sdk.request.base.user.HikvisionGetDefaultUserUuidRequest;
import org.jeecg.pm.hikvision.sdk.request.eps.HikvisionSubscribeEventsFromMQExRequest;
import org.jeecg.pm.hikvision.sdk.request.vss.res.HikvisionGetCamerasExRequest;
import org.jeecg.pm.hikvision.sdk.request.vss.res.HikvisionGetEncodersRequest;
import org.jeecg.pm.hikvision.sdk.response.base.user.HikvisionGetDefaultUserUuidResponse;
import org.jeecg.pm.hikvision.sdk.response.eps.HikvisionSubscribeEventsFromMQExResponse;
import org.jeecg.pm.hikvision.sdk.response.vss.res.HikvisionGetCamerasExResponse;
import org.jeecg.pm.hikvision.sdk.response.vss.res.HikvisionGetEncodersResponse;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

/**
 * <p>
 *
 * </p>
 *
 * @author 陈俊雄
 * @since 2022/3/22
 */
public class HikvisionSdkTest {

    private static final String APP_KEY = "f9c1514b";
    private static final String SECRET = "13bd31dbd3fe449e9e13f7ce6693677a";

    private static final HikvisionClient CLIENT = new HikvisionBaseClient(APP_KEY, SECRET);

    @Test
    void getDefaultUserUuidTest() {
        final HikvisionGetDefaultUserUuidResponse response = CLIENT.execute(new HikvisionGetDefaultUserUuidRequest());
        System.out.println(response);
    }

    @Test
    void getEncoders() {
        final HikvisionGetEncoders encoders = new HikvisionGetEncoders(1, 10);
        final HikvisionGetEncodersResponse response = CLIENT.execute(new HikvisionGetEncodersRequest(encoders));
        System.out.println(response);
    }

    @Test
    void getCamerasEx() {
        final HikvisionGetCamerasEx camerasEx = new HikvisionGetCamerasEx(1, 10);
        final HikvisionGetCamerasExResponse response = CLIENT.execute(new HikvisionGetCamerasExRequest(camerasEx));
        System.out.println(response);
    }

    @Test
    void subscribeEventsFromMQEx(){
        HikvisionSubscribeEventsFromMQEx hikvisionSubscribeEventsFromMQEx = new HikvisionSubscribeEventsFromMQEx().setEventTypes(Arrays.asList("131331"));
        final HikvisionSubscribeEventsFromMQExResponse response = CLIENT.execute(new HikvisionSubscribeEventsFromMQExRequest(hikvisionSubscribeEventsFromMQEx));
        System.out.println(response);
    }
}
