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
ins_ipc.py 1.04 KB
Copy Edit Web IDE Raw Blame History
Mendalas authored 2019-06-15 16:07 . modify some api
#coding=utf-8
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
import time
import collections
db = SQLAlchemy(app)
class InsIpc(db.Model):
__tablename__ = 'ins_ipc'
cid = db.Column(db.Integer, primary_key=True)
des = db.Column(db.String(255))
position = db.Column(db.Integer)
redrtsp = db.Column(db.String(255))
rtsp = db.Column(db.String(255))
beltid = db.Column(db.Integer)
def to_json(self):
return {
"cid":self.cid,
"des":self.des,
"position":self.position,
"redrtsp":self.redrtsp,
"rtsp":self.rtsp,
"beltid":self.beltid,
}
class getInsIpc(Resource):
def post(self):
# beltid = request.form['beltId']
result = db.session.query(InsIpc).all()
v = []
for r in result:
v.append(r.to_json())
app.logger.info(v)
return v

Comment ( 0 )

Sign in for post a comment