public static String buildMessage(BindingResult result) {
        List<ObjectError> errors = result.getAllErrors();
        if (CollectionUtils.isEmpty(errors)) {
            return null;
        }

        int index = 1;
        StringBuilder msg = new StringBuilder();
        msg.append(I18nUtils.getMessage("common.paramCheckError"));
        for (ObjectError e : errors) {
            msg.append(index++);
            // got error message
            msg.append(SymbolConstant.DOT);
            if (e instanceof FieldError fieldError) {
                msg.append(fieldError.getField());
                msg.append(" : ");
            }
            msg.append(e.getDefaultMessage());
            msg.append(SymbolConstant.SEMICOLON);
        }
        return msg.toString();
    }
Extract error message from BindingResult

@param result
@return
chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/exception/convertor/ExceptionConvertorUtils.java