原创 springboot定義一個打印入參日誌的註解 -- 記錄

1,定義註解 @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Inherited public @interface PrintLog { }

原创 不生成proto文件,像gson,fastjson 那樣優雅的使用protobuffer

一:導入依賴 <dependency> <groupId>com.dyuproject.protostuff</groupId> <artifactId>protostuff-runtime</artifactId>

原创 自定義註解,實現jpa查詢,使用起來很方便,記錄一下

自定義註解: @Query /** * @author Lee * @description * @date 2019/12/25 11:36 **/ @Target(ElementType.FIELD) @Retent

原创 自定義註解實現接口冪等性處理

新建註解 @Target(value = ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface ApiIdempotent { Str

原创 springboot socket

引入依賴 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-star

原创 自定義ip限流注解

一:定義註解 @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Limit { // 資源名稱,用於描述接

原创 java用戶行爲埋點-註解方式

1)定義註解 @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Log { String value() defa

原创 springboot rabbitmq的基本使用

1,引入依賴 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artif

原创 自定義註解 簡單demo

1,定義註解 @Target({ElementType.METHOD,ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Change

原创 簡單看看spring的IOC和DI

1,注入一個bean初始化設置的類到容器: @Component public class TestBean implements InitializingBean { private String name; private i

原创 spring 策略模式使用

1,定義策略接口: public interface DiscountStategy { public String type(); public double discount(double fee); } 2,實現接口: @

原创 spring 事件監聽機制的三種實現方式

spring 事件監聽機制的三種實現方式,無序監聽(實現事件方式) ,有序監聽(實現smart事件方式), 註解監聽 準備一個事件: @Slf4j public class OrderEvent extends Applicat

原创 pdf轉excel (可定製修改 比網上轉換準確)

引入依賴: <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.15</version>

原创 jdk8包介紹

Java平臺,標準版第八版 API規範 java.applet 提供了需要創建一個小程序和用來跟其他小程序交流上下文的類。 java.awt 包含了所有用於創建用戶界面和繪製圖形和圖像的類。 java.awt.color 提供了顏色空

原创 golang寫的一個抽獎系統 權限用的jwt 可以後臺配置 (供學習使用 windows , mac ,linux雙擊使用 自動創建數據庫)

1)目錄結構 2)配置文件 app.conf 支持多環境 配置 appname = draw httpport = 8080 runmode = local sessionon = true debug = true [loc