def get(self):
     #check param
     args = hobbyParser.parse_args()
     user = UsersBl()
     user.hobbyId = args['hobbyId']
     #do userObj
     ok, userObjList = user.getUserByHobbyId()
     return Utils.genResponse(ok, userObjList)
 def get(self):
     #check param
     args = infoParser.parse_args()
     user = UsersBl()
     user.userId = args['userId']
     #do userObj
     ok, userObj = user.getUserById()
     return Utils.genResponse(ok, userObj)
 def post(self):
     #check param
     args = regParser.parse_args()
     user = UsersBl()
     user.username = args['username']
     user.password = args['password']
     #do reg
     ok, userObj = user.regUser()
     return Utils.genResponse(ok, userObj)
 def put(self):
     #check param
     args = loginParser.parse_args()
     user = UsersBl()
     user.username = args['username']
     user.password = args['password']
     #do get info
     ok, userObj = user.getInfoByPwd()
     return Utils.genResponse(ok, userObj)
Ejemplo n.º 5
0
    def post(self):
        user_type = request.form.get('user_type')
        name = request.form.get('name')
        score = float(request.form.get('score'))
        print(g.userId)

        data = {
            'user_type':user_type,
            'name':name,
            'score':score,
        }
        blIns = UserBl()
        return Utils.genResponse(*blIns.addUer(data))
Ejemplo n.º 6
0
 def get(self):
     userid = request.args.get('id')
     blIns = UserBl(userid)
     print(g.userId)
     return Utils.genResponse(*blIns.getUser())
Ejemplo n.º 7
0
 def decorated_function(*args, **kwargs):
     pwd = request.args.get('pwd')
     if not pwd:
         return Utils.genResponse(False, '未传入pwd密码')
     g.userId = '-99'
     return f(*args, **kwargs)
Ejemplo n.º 8
0
 def get(self):
     return Utils.genResponse(True, 'welcome rest api')