#
luxiaotao1123
2024-10-02 72df8e8ae96a4a3199332a10e5c104c6a603aa39
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
41
42
43
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;
    }
 
 
}