Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download 1.44 KB
Copy Edit Web IDE Raw Blame History
Mendalas authored 2019-06-14 17:01 . remove redis
from flask_restful import Resource
from auth import auth
from flask import Flask, abort, request, jsonify, g, url_for
from flask_sqlalchemy import SQLAlchemy
from api import app
import json
from sqlalchemy import and_,or_
import time
import collections
db = SQLAlchemy(app)
class RobotLog(db.Model):
__tablename__ = 'robot_log'
robot_id = db.Column(db.Integer, primary_key=True)
updatetime = db.Column(db.DateTime,primary_key=True)
desc = db.Column(db.String(255))
op_id = db.Column(db.String(255))
def to_json(self):
return {
class getRobotlogApi(Resource):
def post(self):
pageSize = int(request.form["pageSize"])
pageIndex = int(request.form["pageIndex"])
result = []
result = db.session.query(RobotLog).order_by(RobotLog.updatetime).\
msg = {}
v = []
size = 0
for r in result:
msg["data"] = v
if(size == 0):
msg["code"] = -1
msg["message"] = "已经是最后一页了"
msg["code"] = 1
msg["message"] = "ok"
return msg

Comment ( 0 )

Sign in for post a comment