package com.njzscloud.common.localizer.jt808.message;

import cn.hutool.core.util.CharsetUtil;
import io.netty.buffer.ByteBuf;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

@Getter
@Setter
@ToString
@Accessors(chain = true)
public class TerminalAuthMessage {
    /**
     * 认证码
     */
    private String authCode;

    public TerminalAuthMessage(ByteBuf body) {
        byte[] authCodeBytes = new byte[body.readableBytes()];
        body.readBytes(authCodeBytes);
        this.authCode = new String(authCodeBytes, CharsetUtil.CHARSET_GBK);
    }
}
