在傳統(tǒng)的web項目中,防止重復(fù)提交,通常做法是:后端生成一個唯一的提交令牌(uuid),并存儲在服務(wù)端。頁面提交請求攜帶這個提交令牌,后端驗證并在第一次驗證后刪除該令牌,保證...
第一步:在Application中加入@EnableScheduling注解 @SpringBootApplication @EnableScheduling public ...
@RestController public class DemoController { public static void main(String[] args) { ...
第一步:引入相關(guān)jar包: <dependency> <groupId>io.springfox</groupId> springfox-swagger2 <version...
第一步:自定義一個注解 @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @int...
/** * 應(yīng)用反射(其實工具類底層一樣用的反射技術(shù)) * 手動寫一個 Bean covert to Map */ public static void autoBeanTo...
最近,在做JPA的項目。期間出現(xiàn)了查詢無數(shù)據(jù)的問題,項目sql打印在數(shù)據(jù)庫中查詢都沒與問題,參數(shù)傳遞也是OK的。經(jīng)過兩個同事的幫助,最后發(fā)現(xiàn)原來是配置文件中數(shù)據(jù)庫連接中,未設(shè)...