Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
    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)
Exemplo n.º 7
0
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)