def _is_post_exist(self, post_id) -> bool: send_message(PostTopicEnum.IS_POST_EXIST.value, post_id=post_id) return get_event_object(topic_name=PostTopicEnum.IS_POST_EXIST.value)
def _get_user(self, user_id: int) -> Optional[UserEntity]: send_message(UserTopicEnum.GET_USER, user_id=user_id) return get_event_object(UserTopicEnum.GET_USER)
def _get_region_group(self, id: int): send_message(topic_name=RegionTopicEnum.GET_REGION_GROUP, id=id) return get_event_object(topic_name=RegionTopicEnum.GET_REGION_GROUP)
def _get_target_user_for_notification(self): send_message(topic_name=NotificationTopicEnum.GET_KEYWORD_TARGET_USER) return get_event_object( topic_name=NotificationTopicEnum.GET_KEYWORD_TARGET_USER)
def _block_post(self, post_id: int): send_message(topic_name=PostTopicEnum.BLOCK.value, post_id=post_id) return get_event_object(topic_name=PostTopicEnum.BLOCK.value)
def _add_report_count(self, post_id: int) -> int: send_message(topic_name=PostTopicEnum.ADD_REPORT_COUNT.value, post_id=post_id) return get_event_object( topic_name=PostTopicEnum.ADD_REPORT_COUNT.value)
def _get_post(post_id: int) -> Optional[PostEntity]: send_message(topic_name=PostTopicEnum.GET_POST.value, post_id=post_id, is_blocked=True) return get_event_object(topic_name=PostTopicEnum.GET_POST.value)