public Mono<MessageAndRecipientIds> authAndSaveMessage(
            boolean queryRecipientIds,
            @Nullable Boolean persist,
            @Nullable Long messageId,
            @NotNull Long senderId,
            @Nullable byte[] senderIp,
            @NotNull Long targetId,
            @NotNull Boolean isGroupMessage,
            @NotNull Boolean isSystemMessage,
            @Nullable String text,
            @Nullable List<byte[]> records,
            @Nullable @Min(0) Integer burnAfter,
            @Nullable @PastOrPresent Date deliveryDate,
            @Nullable Long referenceId,
            @Nullable Long preMessageId) {
        try {
            Validator.maxLength(text, "text", maxTextLimit);
            validRecordsLength(records);
            Validator.pastOrPresent(deliveryDate, "deliveryDate");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        return userService
                .isAllowedToSendMessageToTarget(isGroupMessage, isSystemMessage, senderId, targetId)
                .flatMap(permission -> {
                    ResponseStatusCode code = permission.code();
                    if (code != OK) {
                        return Mono.error(ResponseException.get(code, permission.reason()));
                    }
                    return saveMessage0(queryRecipientIds,
                            persist,
                            messageId,
                            senderId,
                            senderIp,
                            targetId,
                            isGroupMessage,
                            isSystemMessage,
                            text,
                            records,
                            burnAfter,
                            deliveryDate,
                            referenceId,
                            preMessageId);
                });
    }
@return {@link reactor.core.publisher.MonoEmpty} if {@link MessageProperties#persistMessage}
        is false and no recipient.
        <p>
        {@link MessageAndRecipientIds#message} is null if
        {@link MessageProperties#persistMessage} is false.
turms-service/src/main/java/im/turms/service/domain/message/service/MessageService.java