package com.zy.acs.gateway.process;
|
|
import com.zy.acs.gateway.constant.ProtocolType;
|
import com.zy.acs.gateway.domain.AgvPackage;
|
import com.zy.acs.gateway.utils.ProtocolUtils;
|
import io.netty.buffer.ByteBuf;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
|
/**
|
* 应答报文建造者
|
* Created by vincent on 2019-04-04
|
*/
|
public class AckMsgBuilder {
|
|
private static final Logger log = LoggerFactory.getLogger(AckMsgBuilder.class);
|
|
/**
|
* 成功应答
|
* @return ByteBuf
|
*/
|
public static AgvPackage ofSuccess(AgvPackage original, ProtocolType ackType) {
|
|
|
return ProtocolUtils.installDownProtocol(
|
|
original.getHeader().getUniqueNo()
|
|
, ackType
|
);
|
|
}
|
|
/**
|
* 失败应答
|
* @return ByteBuf
|
*/
|
public static ByteBuf ofFail(ByteBuf sourceBuff) {
|
return sourceBuff;
|
}
|
|
|
}
|