|
@@ -0,0 +1,39 @@
|
|
|
+from flask import request, jsonify
|
|
|
+from flask_restx import Resource, Namespace, reqparse
|
|
|
+
|
|
|
+from app.defines import StatesCode
|
|
|
+
|
|
|
+ns = Namespace('log', description='日志管理接口')
|
|
|
+
|
|
|
+log_list = reqparse.RequestParser(bundle_errors=True)
|
|
|
+log_list.add_argument(name='page_size', type=int, location='args', required=False, help='每页记录数量,默认:20')
|
|
|
+log_list.add_argument(name='page', type=int, location='args', required=False, help='第几页')
|
|
|
+
|
|
|
+
|
|
|
+@ns.route('/log_list')
|
|
|
+class LogList(Resource):
|
|
|
+ def get(self):
|
|
|
+ """获取日志列表"""
|
|
|
+ data = [
|
|
|
+ {'id': 1, 'module': '系统模块', 'methods': 'post', 'people': '张三', 'ip': '127.0.0.1', 'place': '内网',
|
|
|
+ 'status': 'ok', 'time': '2020-10-10'}
|
|
|
+ ]
|
|
|
+ return jsonify(code=StatesCode.SUCCESS, message='成功', data=data)
|
|
|
+
|
|
|
+
|
|
|
+@ns.route('/log_search')
|
|
|
+class LogSearchApi(Resource):
|
|
|
+ def get(self):
|
|
|
+ """查询日志"""
|
|
|
+ data = [
|
|
|
+ {'id': 2, 'module': '系统模块', 'methods': 'post', 'people': '张三', 'ip': '127.0.0.1', 'place': '内网',
|
|
|
+ 'status': 'ok', 'time': '2020-10-10'}
|
|
|
+ ]
|
|
|
+ return jsonify(code=StatesCode.SUCCESS, message='成功', data=data)
|
|
|
+
|
|
|
+
|
|
|
+@ns.route('/log_export')
|
|
|
+class LogExportApi(Resource):
|
|
|
+ def get(self):
|
|
|
+ """日志导出"""
|
|
|
+ return 'logfile'
|