package com.zy.core.network.fake;
|
|
import com.alibaba.fastjson.JSON;
|
import com.zy.asrs.entity.DeviceConfig;
|
import com.zy.core.model.CommandResponse;
|
import com.zy.core.model.command.CrnCommand;
|
import com.zy.core.network.api.ZyCrnConnectApi;
|
import com.zy.core.network.entity.ZyCrnStatusEntity;
|
|
public class ZyCrnFakeConnect implements ZyCrnConnectApi {
|
|
private ZyCrnStatusEntity crnStatus;
|
private DeviceConfig deviceConfig;
|
|
public ZyCrnFakeConnect(DeviceConfig deviceConfig) {
|
this.deviceConfig = deviceConfig;
|
this.crnStatus = JSON.parseObject(deviceConfig.getFakeInitStatus(), ZyCrnStatusEntity.class);
|
}
|
|
@Override
|
public boolean connect() {
|
return true;
|
}
|
|
@Override
|
public boolean disconnect() {
|
return true;
|
}
|
|
@Override
|
public ZyCrnStatusEntity getStatus() {
|
return this.crnStatus;
|
}
|
|
@Override
|
public CommandResponse sendCommand(CrnCommand command) {
|
CommandResponse response = new CommandResponse(false);
|
return response;
|
}
|
}
|