package com.zd.laboratory.service.impl;

import com.zd.common.core.constant.Constants;
import com.zd.common.redis.service.RedisService;
import com.zd.laboratory.base.BaseControllerTest;
import com.zd.laboratory.domain.SubDiyVO;
import com.zd.system.api.domain.SubQueryConfig;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @Author: zhoupan
 * @Date: 2021/11/12/12:22
 * @Description:
 */
@DisplayName("实验室查询测试")
class SubQueryManagerTest extends BaseControllerTest {

    @Autowired
    SubQueryManager subQueryManager;


    @Autowired
    RedisService redisService;

    @Test
    @DisplayName("查询实验室信息-根据ID")
    public void querySubs()
    {
        SubQueryConfig subQueryConfig = new SubQueryConfig();
//        subQueryConfig.setDangerLevel(true);
        subQueryConfig.setBaseInfo(false);
        subQueryConfig.setSensorFunction(true);
        subQueryConfig.setInitSensorFunctionValue(true);
        subQueryConfig.setInitWarnSensorFunction(true);
        List<SubDiyVO> subDiyVOList = subQueryManager.querySubs(subQueryConfig, 10L);

    }


    @Test
    @DisplayName("redis set 重复add操作")
    public void redisSet()
    {
        Set<String> aa = new HashSet<>();
        aa.add("wendu");
        aa.add("shidu");
        redisService.setCacheSetV2(Constants.WRAN_KEY+10,aa);

    }
}