def Execute(self, request):
        new_user = AddUserFactory.Map_to_Entity(request)

        UserRepository.add(new_user)

        UserRepository.commit()

        return new_user
示例#2
0
    def Execute(self, request):
        current_user = UserRepository.get_by_id(request.id)

        # for address in request.addresses:
        #     userRepository.add_address(address)

        edit_user = EditUserFactory.Map_to_Entity(request, current_user)

        UserRepository.commit()

        return edit_user
    def Execute(self, request):
        user = UserRepository.get_by_mobile(request.mobile)

        # TODO: Check User Has Value Before Mapping
        result = GetUserByMobileFactory.Map_to_Response(user)

        return result
    def Execute(self, request):
        user = UserRepository.get_by_id_with_query(request.user_id)

        # TODO: Check User Has Value Before Mapping
        result = GetUserByIdWithQueryFactory.Map_to_Response(user)

        # if len(response) > 0:
        #     result = UserMapper.create(response)

        return result
示例#5
0
    def Execute(self, request):
        user = UserRepository.get_by_id(request.user_id)

        UserRepository.delete(user)

        UserRepository.commit()
示例#6
0
    def Execute(self):
        users = UserRepository.get_all()

        result = GetAllUserFactory.Map_to_Response(users)

        return result