コード例 #1
0
def montharea(ns):
    r=redis.Redis(host='127.0.0.1',port=6379,decode_responses=True)
    #print(value)
    name="montharea"+ns
    value=datavbizdb.montharea(ns)
    value=str(value)
    listredis(name,value,86400)
    data=r.lrange("montharea{}".format(ns),0,-1)[0]
    #time.sleep(82800)
    return data
コード例 #2
0
    def montharea():

        ns =request.values.get("ns")
        try:
            if ns in ("999969","999955","999946"):
               montharea=staticdata.montharea(ns)
               montharea=montharea
            else:
               montharea=datavbizdb.montharea(ns)

            dict={"errorCode": "200","errorDescription": "OK","response": montharea}
            #年租金
            dict=json.dumps(dict,ensure_ascii=False)
            return dict
        except Exception:
           dict={"Exception": Exception}
           return dict