def getUser(userId): user = Users.get(Users, userId) if user is None: return jsonify(Common.falseReturn(Common, None, '找不到数据')) else: return jsonify(Common.trueReturn(Common, Users.output(Users, user)))
def getUsers(): users = Users.getAll(Users) output = [] for user in users: output.append(Users.output(Users, user)) return jsonify(Common.trueReturn(Common, output))