註解 獲取 存入redis

2021-08-13 01:21:51 字數 1673 閱讀 8373

//獲取快取註解資訊

creditsourcecache creditsourcecache = objmethod.getannotation(creditsourcecache.class);

if (creditsourcecache != null), fee:{}, cachetime:{}, cachekeyname:{}", spelexpress, fee, cachetime, keyname);

//從快取獲取值

string cachevalue = redisbusiness.getvalue(keyname);

if (stringutils.isnotblank(cachevalue)));

logger.debug("from cache, value = {}", cachevalue);

return oresult;}}

}try catch (throwable throwable)

if (creditsourcecache != null)

bigdata.setclactime(endtime - starttime);

bigdata.setinstr(jsonobject.tojsonstring(firstparamobj));

bigdata.setoutstr(returnvalue == null ? "null" : jsonobject.tojsonstring(returnvalue));

bigdata.setcreatetime(new date());

//todo 傳送到大資料

creditsendbigdatabusiness.sendbigdata(bigdata);

//todo 解析各徵信源返回報文,做快取資訊,剔除錯誤資訊,只快取正確的資訊

if (returnvalue != null)catch (exception e)

if(checkflag), value={}, cachetime={}", keyname, originalresult, cachetime);

redisbusiness.setvalue(keyname, jsonobject.tojsonstring(originalresult), cachetime);}}

}logger.debug("切點結束。。。");

return returnvalue;

}

從kafak獲取資料,處理後存入redis中。

1.題目要求 使用者id ip位址 商品分類 購買明細 商品金額 a 202.106.196.115 手機 iphone8 8000 問題1.計算出總的成交量總額 結果儲存到redis中 問題2.計算每個商品分類的成交量 結果儲存到redis中 問題3.計算每個省份的成交總額 結果儲存到redis ...

Redis快取註解

匯入依賴 com.fasterxml.jackson.coregroupid jackson databindartifactid 2.11.2version dependency org.springframework.bootgroupid spring boot starter data re...

python 爬蟲獲取json資料存入檔案時亂碼

解決python使用爬蟲獲取json格式的網頁,輸出以及寫入檔案亂碼的情況 import codecs resp requests.get url,headers headers result json.dumps resp.json ensure ascii false 若不指定ensure as...