__init__.py
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# 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 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