跳至主要內容

TerminalValidator

hylexus约 73 字小于 1 分钟

TerminalValidator

@Configuration
public class Jt808Configuration extends Jt808ServerConfigurationSupport {
    // [非必须配置] -- 可替换内置 TerminalValidator
    @Override
    public TerminalValidator terminalValidator() {
        return new TerminalValidator() {
            @Override
            public boolean validateTerminal(RequestMsgMetadata metadata) {
                return true;
            }

            @Override
            public boolean needValidate(RequestMsgMetadata metadata, Integer msgId) {
                return true;
            }
        };
    }
}