我要中文註釋!!!問題思路,簡單的配置了suppressAllComments = false之後,一些小夥伴十分懵逼,出來一堆英文註釋,根本不是自己需要的。然後各種拼命往上找辦法,找資源,一頓亂搞,沒搞定。要麼是操作繁瑣,要麼是配置困難。
本人對那些胡亂發帖子卻搞不定問題的行爲深惡痛絕。
下面是解決辦法。
先把我的資源裏面(我傳到csdn的文件)
MyCommentGenerator.java下載後放在本地
然後在
generatorConfig.xml的下邊代碼區域
<commentGenerator> <property name="suppressDate" value="true"/> <!-- 是否去除自動生成的註釋 true:是 : false:否 --> <property name="suppressAllComments" value="false"/> </commentGenerator>
替換成
<commentGenerator type="org.spring.springboot.dao.MyCommentGenerator"> </commentGenerator>
問題直接搞定,自願打賞謝謝。
上述文章參照了改文章,但是做了些許改動方便了大家的使用配置:https://blog.csdn.net/qq_21251983/article/details/50731368