#
Junjie
2025-11-07 b890d1c574d3d8332def7f4590508a7918139ae0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;
    }
}