Esempio n. 1
0
    def post(self):
        params = utils.decode_params(self.request)
        resp = {}
        user_info = db.get_user_information(params)
        if user_info is None:
            resp[KEY.STATUS] = STATUS.ERROR
        else:
            user_info[KEY.SUPPORT_NUMBER] = len(
                db.get_join_event_list({KEY.ID: user_info[KEY.ID]}))
            user_info[KEY.LOVE_COIN] = db.get_user_loving_bank(
                {KEY.USER_ID: user_info[KEY.ID]})
            user_info[KEY.MEDICINE_TAKEN] = ""
            user_info[KEY.ANAPHYLAXIS] = ""
            user_info[KEY.MEDICAL_HISTORY] = ""
            health_record = db.get_health_record(user_info[KEY.ID])
            if health_record is not None:
                user_info[KEY.MEDICINE_TAKEN] = health_record[
                    KEY.MEDICINE_TAKEN]
                user_info[KEY.ANAPHYLAXIS] = health_record[KEY.ANAPHYLAXIS]
                user_info[KEY.MEDICAL_HISTORY] = health_record[
                    KEY.MEDICAL_HISTORY]
            resp.update(user_info)
            resp[KEY.STATUS] = STATUS.OK

        self.write(json_encode(resp))
    def post(self):
        params = utils.decode_params(self.request)

        resp = {}
        if KEY.ID in params:
            records = db.get_health_record(params[KEY.ID])
            resp[KEY.HEALTH_LIST] = records
            resp[KEY.STATUS] = STATUS.OK
        else:
            resp[KEY.STATUS] = STATUS.ERROR

        self.write(json_encode(resp))
 def post(self):
   params = utils.decode_params(self.request)
   
   resp = {}
   if KEY.ID in params:
     records = db.get_health_record(params[KEY.ID])
     resp[KEY.HEALTH_LIST] = records
     resp[KEY.STATUS] = STATUS.OK
   else:
     resp[KEY.STATUS] = STATUS.ERROR
   
   self.write(json_encode(resp))
Esempio n. 4
0
    def post(self):
        params = utils.decode_params(self.request)

        resp = {}
        if KEY.ID in params:
            if db.upload_health(params):
                res = db.get_health_record(params[KEY.ID])
                resp = res
                resp[KEY.STATUS] = STATUS.OK
        else:
            resp[KEY.STATUS] = STATUS.ERROR

        self.write(json_encode(resp))
 def post(self):
   params = utils.decode_params(self.request)
   
   resp = {}
   if KEY.ID in params:
     if db.upload_health(params):
       res = db.get_health_record(params[KEY.ID])
       resp = res
       resp[KEY.STATUS] = STATUS.OK
   else:
     resp[KEY.STATUS] = STATUS.ERROR
   
   self.write(json_encode(resp))
Esempio n. 6
0
 def post(self):
   params = utils.decode_params(self.request)
   
   resp = {}
   health_id = db.health_record(params)
   if health_id > 0:
     resp = db.get_health_record(health_id)
     if resp is None:
       resp = {}      
     resp[KEY.STATUS] = STATUS.OK
   else:
     resp[KEY.STATUS] = STATUS.ERROR
   
   self.write(json_encode(resp))
Esempio n. 7
0
    def post(self):
        params = utils.decode_params(self.request)

        resp = {}
        health_id = db.health_record(params)
        if health_id > 0:
            resp = db.get_health_record(health_id)
            if resp is None:
                resp = {}
            resp[KEY.STATUS] = STATUS.OK
        else:
            resp[KEY.STATUS] = STATUS.ERROR

        self.write(json_encode(resp))
	def post(self):
		params = utils.decode_params(self.request)
		resp = {}
		user_info = db.get_user_information(params)
		if user_info is None:
			resp[KEY.STATUS] = STATUS.ERROR
		else:
			user_info[KEY.SUPPORT_NUMBER] = len(db.get_join_event_list({KEY.ID: user_info[KEY.ID]}))
			user_info[KEY.LOVE_COIN] = db.get_user_loving_bank({KEY.USER_ID: user_info[KEY.ID]})
			user_info[KEY.MEDICINE_TAKEN] = ""
			user_info[KEY.ANAPHYLAXIS] = ""
			user_info[KEY.MEDICAL_HISTORY] = ""
			health_record = db.get_health_record(user_info[KEY.ID])
			if health_record is not None:
				user_info[KEY.MEDICINE_TAKEN] = health_record[KEY.MEDICINE_TAKEN]
				user_info[KEY.ANAPHYLAXIS] = health_record[KEY.ANAPHYLAXIS]
				user_info[KEY.MEDICAL_HISTORY] = health_record[KEY.MEDICAL_HISTORY]
			resp.update(user_info)
			resp[KEY.STATUS] = STATUS.OK
    
		self.write(json_encode(resp))