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

from app.util import BlueprintApi
from flasgger import swag_from
from flask import Blueprint
from . import task_list
from . import task_detail
from . import task_delete
from . import task_count
from . import task_kill
from . import task_update
from app.decorators.token_decorator import token_decorator


class DataManager(BlueprintApi):

    bp = Blueprint("Task", __name__, url_prefix="/API/Task")

    @staticmethod
    @bp.route('/List', methods=['POST'])
    @swag_from(task_list.Api.api_doc)
    def api_task_list():
        """
        任务列表
        """
        return task_list.Api().result

    @staticmethod
    @bp.route('/Detail', methods=['POST'])
    @swag_from(task_detail.Api.api_doc)
    def api_task_detail():
        """
        任务详情
        """
        return task_detail.Api().result

    @staticmethod
    @bp.route('/Delete', methods=['POST'])
    @swag_from(task_delete.Api.api_doc)
    @token_decorator("profile")
    def task_delete():
        """
        删除任务
        """
        return task_delete.Api().result

    @staticmethod
    @bp.route('/Kill', methods=['POST'])
    @swag_from(task_kill.Api.api_doc)
    @token_decorator("profile")
    def task_kill():
        """
        Kill任务
        """
        return task_kill.Api().result

    @staticmethod
    @bp.route('/Count', methods=['POST'])
    @swag_from(task_count.Api.api_doc)
    def task_count():
        """
        任务统计
        """
        return task_count.Api().result


    @staticmethod
    @bp.route('/Update', methods=['POST'])
    @swag_from(task_update.Api.api_doc)
    def task_update():
        """
        任务信息更新
        """
        return task_update.Api().result