调整项目结构
This commit is contained in:
@@ -2,8 +2,6 @@ package com.njcn.access.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.access.pojo.po.CsGatewayDevice;
|
||||
import com.njcn.access.pojo.vo.CsGatewayVo;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentAlarmPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.njcn.access.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.access.pojo.po.CsGatewayDevice;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentAlarmPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.njcn.access.param.DevAccessParam;
|
||||
import com.njcn.access.pojo.dto.AccessDto;
|
||||
import com.njcn.access.pojo.dto.ReqAndResDto;
|
||||
import com.njcn.access.service.ICsDeviceService;
|
||||
import com.njcn.access.service.ICsGatewayService;
|
||||
import com.njcn.access.utils.MqttUtil;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -22,7 +21,6 @@ import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.access.mapper.CsGatewayDeviceMapper;
|
||||
import com.njcn.access.pojo.po.CsGatewayDevice;
|
||||
import com.njcn.access.service.ICsGatewayDeviceService;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentAlarmPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ microservice:
|
||||
sentinel:
|
||||
url: @sentinel.url@
|
||||
gateway:
|
||||
url: @gateway.url@
|
||||
url: @gateway.url@
|
||||
server:
|
||||
port: 10301
|
||||
#feign接口开启服务熔断降级处理
|
||||
@@ -52,4 +52,4 @@ mybatis-plus:
|
||||
|
||||
|
||||
mqtt:
|
||||
client-id: access-boot${random.value}
|
||||
client-id: access-boot123456
|
||||
@@ -2,12 +2,31 @@ package com.njcn;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.common.reflect.TypeToken;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.graphbuilder.math.func.EFunction;
|
||||
import com.njcn.access.pojo.dto.mqtt.MqttClientDto;
|
||||
import io.lettuce.core.protocol.CompleteableCommand;
|
||||
import okhttp3.Credentials;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
public class AppTest
|
||||
{
|
||||
/**
|
||||
* Rigorous Test :-)
|
||||
@@ -17,4 +36,31 @@ public class AppTest
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
String username = "ac760c62395cecec";
|
||||
String password = "k0vGfe5xOE2Bl4DCF73uahcknvcwoKOEDPnOkMvuSBB";
|
||||
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url("http://192.168.1.18:18083/api/v5/clients/access-boot123456")
|
||||
.header("Content-Type", "application/json")
|
||||
.header("Authorization", Credentials.basic(username, password))
|
||||
.build();
|
||||
|
||||
Response response = client.newCall(request).execute();
|
||||
response.body();
|
||||
String res = Objects.requireNonNull(response.body()).string();
|
||||
|
||||
Gson gson = new Gson();
|
||||
MqttClientDto mqttClientDto = gson.fromJson(res, new TypeToken<MqttClientDto>(){}.getType());
|
||||
System.out.println("mqttClientDto==:" + mqttClientDto.isConnected());
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user