from flask_restplus.namespace import Namespace from restplus.api.v1.auth.login import Login, user_login_model from restplus.api.v1.auth.logout import Logout from restplus.api.v1.auth.register import Register, user_register_model auth_ns = Namespace('auth', description='Operations related to authentication') auth_ns.add_resource(Register, '/register', endpoint='auth_register') auth_ns.add_model('user_register', user_register_model) auth_ns.add_resource(Login, '/login') auth_ns.add_model('user_login', user_login_model) auth_ns.add_resource(Logout, '/logout')
from flask_restplus.namespace import Namespace from davepostAPI.api.v1.users.all_users import AllUsers from davepostAPI.api.v1.users.single_user import SingleUser from davepostAPI.api.v1.users.single_user_all_posts import SingleUserAllPosts, post_model from davepostAPI.api.v1.users.single_user_single_post import SingleUserSinglePost users_ns = Namespace('users', description='Operations related to users') users_ns.add_resource(AllUsers, '/') users_ns.add_resource(SingleUser, '/<int:user_id>') users_ns.add_resource(SingleUserAllPosts, '/<int:user_id>/posts') users_ns.add_model('post_model', post_model) users_ns.add_resource(SingleUserSinglePost, '/<int:user_id>/posts/<int:post_id>')
from flask_restplus.namespace import Namespace from davepostAPI.api.v1.posts.all_posts import AllPosts from davepostAPI.api.v1.posts.single_post import SinglePost posts_ns = Namespace('posts', description='Operations on posts only') posts_ns.add_resource(AllPosts, '/') posts_ns.add_resource(SinglePost, '/<int:post_id>')