-
Notifications
You must be signed in to change notification settings - Fork 0
/
rest_api.py
74 lines (52 loc) · 1.28 KB
/
rest_api.py
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
67
68
69
70
71
72
73
74
from flask_restful_swagger_2 import Resource
from libs.flask_get import *
from Model.db_manager import *
from utli.mytool import *
# from libs.flask_get import *
"""
class SampleREST(Resource):
def get(self):
pass
def put(self):
pass
def delete(self):
pass
def post(self):
pass
"""
class TableREST(Resource):
def get(self):
pass
def put(self):
pass
def delete(self):
pass
@return_transform()
def post(self):
table_data = json_get("table_data")
return TableManager.add_table(table_data)
class TopicREST(Resource):
def get(self):
pass
def put(self):
pass
def delete(self):
pass
@return_transform("topic")
def post(self):
topic_data = json_get("topic_data")
return TopicManager.add_topic(topic_data)
class TopicIdREST(Resource):
def get(self, TopicId):
return api_return.success({
"data": TopicManager.view_single(TopicId)
})
@return_transform("topic")
def put(self,TopicId):
topic_data = json_get("topic_data")
return TopicManager.update_single(topic_data,TopicId)
def delete(self):
pass
@return_transform("topic")
def post(self):
pass