__init__.py 4.9 KB
# coding=utf-8
#author:        4N
#createtime:    2021/3/1
#email:         nheweijun@sina.com


from flasgger import swag_from
from flask import Blueprint
from app.util import BlueprintApi

from . import field_edit

from . import table_list
from . import field_list
from . import table_edit
from . import table_info
from . import table_refresh
from . import table_delete
from . import table_view
from . import table_vacuate
from . import table_vacuate_one
from . import table_vacuate_info
from . import table_vacuate_detail
from . import table_vacuate_ref
from . import table_vacuate_delete
from . import field_value
from . import table_check
import configure
from app.decorators.auth_decorator  import auth_decorator


class DataManager(BlueprintApi):

    bp = Blueprint("DataManager", __name__, url_prefix="/API/Manager")

    @staticmethod
    @bp.route('/FieldEdit', methods=['POST'])
    @swag_from(field_edit.Api.api_doc)
    @auth_decorator(configure.DataPermission)
    def field_edit():
        """
        修改属性别名
        """
        return field_edit.Api().result

    @staticmethod
    @bp.route('/FieldList', methods=['POST'])
    @swag_from(field_list.Api.api_doc)
    def field_list():
        """
        属性列表
        """
        return field_list.Api().result

    @staticmethod
    @bp.route('/FieldValue', methods=['POST'])
    @swag_from(field_value.Api.api_doc)
    @auth_decorator(configure.DataPermission)
    def field_value():
        """
        属性值
        """
        return field_value.Api().result

    @staticmethod
    @bp.route('/TableList', methods=['POST'])
    @swag_from(table_list.Api.api_doc)
    def table_list():
        """
        数据列表
        """
        return table_list.Api().result


    @staticmethod
    @bp.route('/TableEdit', methods=['POST'])
    @swag_from(table_edit.Api.api_doc)
    @auth_decorator(configure.DataPermission)
    def table_edit():
        """
        修改数据
        """
        return table_edit.Api().result


    @staticmethod
    @bp.route('/TableDelete', methods=['POST'])
    @swag_from(table_delete.Api.api_doc)
    @auth_decorator(configure.DataPermission)
    def table_delete():
        """
        删除数据
        """
        return table_delete.Api().result


    @staticmethod
    @bp.route('/TableInfo', methods=['POST'])
    @swag_from(table_info.Api.api_doc)
    def table_info():
        """
        数据信息
        """
        return table_info.Api().result

    @staticmethod
    @bp.route('/TableCheck', methods=['POST'])
    @swag_from(table_check.Api.api_doc)
    def table_check():
        """
        检查表是否存在
        """
        return table_check.Api().result


    @staticmethod
    @bp.route('/TableRefresh', methods=['POST'])
    @swag_from(table_refresh.Api.api_doc)
    @auth_decorator(configure.DataPermission)
    def table_refresh():
        """
        刷新数据
        """
        return table_refresh.Api().result

    @staticmethod
    @bp.route('/TableView', methods=['POST'])
    @swag_from(table_view.Api.api_doc)
    def table_view():
        """
        数据浏览
        """
        return table_view.Api().result


    @staticmethod
    @bp.route('/TableVacuate', methods=['POST'])
    @swag_from(table_vacuate.Api.api_doc)
    @auth_decorator(configure.DataPermission)
    def table_vacuate():
        """
        数据抽稀
        """
        return table_vacuate.Api().result

    @staticmethod
    @bp.route('/TableVacuateOne', methods=['POST'])
    @swag_from(table_vacuate_one.Api.api_doc)
    @auth_decorator(configure.DataPermission)
    def api_table_vacuate_one():
        """
        单独数据抽稀
        """
        return table_vacuate_one.Api().result


    @staticmethod
    @bp.route('/TableVacuateInfo', methods=['POST'])
    @swag_from(table_vacuate_info.Api.api_doc)
    def api_table_vacuate_info():
        """
        数据抽稀情况
        """
        return table_vacuate_info.Api().result

    @staticmethod
    @bp.route('/TableVacuateDetail', methods=['GET'])
    @swag_from(table_vacuate_detail.Api.api_doc)
    def api_table_vacuate_detail():
        """
        数据抽稀详情
        """
        return table_vacuate_detail.Api().result

    @staticmethod
    @bp.route('/TableVacuateRef', methods=['POST'])
    @swag_from(table_vacuate_ref.Api.api_doc)
    def api_table_vacuate_ref():
        """
        数据抽稀参考
        """
        return table_vacuate_ref.Api().result

    @staticmethod
    @bp.route('/TableVacuateDelete', methods=['POST'])
    @swag_from(table_vacuate_delete.Api.api_doc)
    @auth_decorator(configure.DataPermission)
    def api_table_vacuate_delete():
        """
        数据抽稀删除
        """
        return table_vacuate_delete.Api().result