示例#1
0
 def get(self, aID):
     try:
         activity = activity_bl.get_activity_by_id(aID)
         return DateEncoderUtil().changeDate(activity), 200
     except NotFoundException:
         return {"error": "can not find the activity"}, 404
     except SystemErrorException:
         return {"error": "system is error"}, 500
示例#2
0
 def get(self, id):
     try:
         is_check = request.args['isChecked'] == 'True'
         result = userInfoBl.get_user_info(id, is_check)
         result1 = DateEncoderUtil().changeDate(result)
         return result1, 200
     except NotFoundException:
         return None, 404
示例#3
0
 def post(self):
     poolID = request.form['poolID']
     truth = request.form['truth'] == 'True'
     username = JwtUtil.JwtUtil.get_token_username(request.headers.get("token"))
     if not truth:
         result = poolBl.get_love(username, poolID)
     else:
         result = poolBl.get_true_love(username, poolID)
     return [DateEncoderUtil().changeDate(i) for i in result]
示例#4
0
 def patch(self):
     username = JwtUtil.JwtUtil.get_token_username(
         request.headers.get("token"))
     result = [
         DateEncoderUtil().changeDate(i)
         for i in poolBl.get_pool_by_user(username)
     ]
     print(result)
     return result
示例#5
0
 def patch(self):
     username = JwtUtil.get_token_username(
         flask.request.headers.get("token"))
     try:
         activity_list = activity_bl.get_activity_by_user(username)
         return [DateEncoderUtil().changeDate(i) for i in activity_list]
     except NotFoundException:
         return {"error": "can not find the page"}, 404
     except SystemErrorException:
         return {"error": "system is error"}, 500
示例#6
0
 def get(self):
     begin = request.args['begin']
     is_current = request.args['isCurrent']
     try:
         activity_list = activity_bl.get_activity(begin, not is_current)
         return [DateEncoderUtil().changeDate(i) for i in activity_list]
     except NotFoundException:
         return {"error": "can not find the page"}, 404
     except SystemErrorException:
         return {"error": "system is error"}, 500
示例#7
0
 def get(self):
     username = JwtUtil.JwtUtil.get_token_username(
         request.headers.get("token"))
     type = request.args['type']
     if type == 'all':
         id = request.args['id']
         return [
             DateEncoderUtil().changeDate(i) for i in postsBl.get_all()
         ], 200
     elif type == 'myPost':
         id = request.args['id']
         return [
             DateEncoderUtil().changeDate(i)
             for i in postsBl.get_my_posts(username)
         ], 200
     elif type == 'postMy':
         id = request.args['id']
         return [
             DateEncoderUtil().changeDate(i)
             for i in postsBl.get_my(username)
         ], 200
示例#8
0
    def patch(self, id):

        # username = JwtUtil.JwtUtil.get_token_username(request.headers.get("token"))
        # user = userDao.get_user_by_username(username)
        # result = poolJoinDao.getPoolJoin(user.id, id)
        # if result:
        #     return None, 200
        # else:
        #     return None, 404
        return [
            DateEncoderUtil().changeDate(i)
            for i in poolBl.get_people_in_pool(id)
        ]
示例#9
0
 def get(self):
     begin = request.args['begin']
     result = [
         DateEncoderUtil().changeDate(i) for i in poolBl.get_pool(begin)
     ]
     return result, 200
示例#10
0
 def get(self, id):
     try:
         return DateEncoderUtil().changeDate(poolBl.get_pool_by_id(id)), 200
     except NotFoundException:
         return None, 404