当代数据库管理系统课程实验二
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
648 B

преди 2 години
преди 2 години
  1. from flask import Blueprint
  2. from flask import Flask, abort, request, jsonify
  3. import json
  4. from flask import jsonify
  5. from be.model import postgreSQLORM
  6. from be.model.postgreSQLORM import User,Store_Book,User_Store,New_Order,New_Order_Detail
  7. bp_testconn = Blueprint("testconn",__name__,url_prefix="/testconn")
  8. @bp_testconn.route("/test",methods=['GET'])
  9. def test():
  10. user_id: str = request.args.get("user_id")
  11. print(user_id)
  12. try:
  13. ss = postgreSQLORM.session.query(User).filter(User.user_id==user_id).all()
  14. for i in ss:
  15. print('user_id',i.user_id)
  16. except:
  17. print("error")
  18. return "connect success"