Halo學習筆記9

2021-10-01 22:14:14 字數 1038 閱讀 7500

@configurationproperties

("halo"

)public

class

haloproperties

類裡面有各種屬性,通過@configurationproperties與yml繫結

通過@enableconfigurationproperties使haloproperties生效

此配置類共配置了8個bean,各有各的作用

resttemplate

更方便的傳送request請求

stringcachestore

halo內部的快取類

logfilter

日誌過濾器,記錄每一次請求

contentfilter

這個只能連蒙帶猜了,估計是從請求中獲取token,如果沒有獲得到,則通過自定義或者預設的failurehandler處理

與一次登入建立會話不同,每次請求都攜帶token更為安全

adminauthenticationfilter

功能沒看懂,等變強了,日後再說吧

apiauthenticationfilter

同上

@slf4j

@configuration

@enablewebmvc

@componentscan

(basepackages =

)@propertysource

(value =

, ignoreresourcenotfound =

true

, encoding =

"utf-8"

)public

class

webmvcautoconfiguration

implements

webmvcconfigurer

@enablewebmvc關於這個註解,個人理解是springmvc.xml的class版

其他的註解都見名知意

通過@bean的方式替代了xml配置

Halo學習筆記6

apioperation lists posts public page pageby integer page,integer size,sortdefault sortdefaults sort sort,postquery postquery 其中較為關鍵的 就是postservice.pag...

學習開源專案Halo(三)

研究完halo的國際化是怎麼實現的,接下來就是研究halo的其他功能是怎麼實現的。對於沒有研究過專案的人來說第一步上手是不太容易,但是,經歷過前兩篇的研究,現在研究起來應該就很容易了。首先,還是先看一下它的第乙個小小的功能,當我們第一次開啟它的首頁http localhost 8090的時候,它會自...

學習筆記9

函式 函式以def開頭,後面接函式名和括號,然後接冒號 函式的最後接return結束函式,並返回乙個值,可以沒有,就相當於返回none 函式呼叫時直接用函式名加括號 括號內為需要傳入的引數。傳入函式的引數是實參 在函式內使用的大多都為形參 形參只能在函式內使用,函式結束後就自動釋放記憶體了。函式中的...