Skip to content

Commit 2ffeeaf

Browse files
committed
version 1.1.3
1 parent b5c422a commit 2ffeeaf

36 files changed

+1565
-1337
lines changed

pom.xml

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>io.github.hoangtien2k3</groupId>
1313
<artifactId>fw-commons</artifactId>
14-
<version>1.1.2</version>
14+
<version>1.1.3</version>
1515
<packaging>jar</packaging>
1616
<name>fw-commons</name>
1717
<description>a commons java tool lib with spring boot framework</description>
@@ -151,10 +151,10 @@
151151
</dependency>
152152

153153
<!-- redis -->
154-
<!-- <dependency>-->
155-
<!-- <groupId>org.springframework.boot</groupId>-->
156-
<!-- <artifactId>spring-boot-starter-data-redis</artifactId>-->
157-
<!-- </dependency>-->
154+
<dependency>
155+
<groupId>org.springframework.boot</groupId>
156+
<artifactId>spring-boot-starter-data-redis</artifactId>
157+
</dependency>
158158

159159
<dependency>
160160
<groupId>org.springframework.data</groupId>
@@ -276,23 +276,26 @@
276276
</dependency>
277277

278278
<!-- r2dbc depenedcies-->
279-
<!-- <dependency>-->
280-
<!-- <groupId>org.postgresql</groupId>-->
281-
<!-- <artifactId>r2dbc-postgresql</artifactId>-->
282-
<!-- <version>1.0.5.RELEASE</version>-->
283-
<!-- <scope>runtime</scope>-->
284-
<!-- </dependency>-->
285-
<!-- <dependency>-->
286-
<!-- <groupId>org.postgresql</groupId>-->
287-
<!-- <artifactId>postgresql</artifactId>-->
288-
<!-- <version>42.7.3</version>-->
289-
<!-- <scope>runtime</scope>-->
290-
<!-- </dependency>-->
291-
292-
<!-- <dependency>-->
293-
<!-- <groupId>io.r2dbc</groupId>-->
294-
<!-- <artifactId>r2dbc-pool</artifactId>-->
295-
<!-- </dependency>-->
279+
<dependency>
280+
<groupId>org.springframework.boot</groupId>
281+
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
282+
</dependency>
283+
<dependency>
284+
<groupId>io.r2dbc</groupId>
285+
<artifactId>r2dbc-pool</artifactId>
286+
</dependency>
287+
<dependency>
288+
<groupId>org.postgresql</groupId>
289+
<artifactId>r2dbc-postgresql</artifactId>
290+
<version>1.0.5.RELEASE</version>
291+
<scope>runtime</scope>
292+
</dependency>
293+
<dependency>
294+
<groupId>org.postgresql</groupId>
295+
<artifactId>postgresql</artifactId>
296+
<version>42.7.3</version>
297+
<scope>runtime</scope>
298+
</dependency>
296299

297300
<!--Bouncy Castle-->
298301
<dependency>
@@ -376,11 +379,6 @@
376379
<version>${mapstruct.processor.version}</version>
377380
<scope>provided</scope>
378381
</dependency>
379-
<!-- r2dbc depenedcies-->
380-
<!-- <dependency>-->
381-
<!-- <groupId>org.springframework.boot</groupId>-->
382-
<!-- <artifactId>spring-boot-starter-data-r2dbc</artifactId>-->
383-
<!-- </dependency>-->
384382

385383
<dependency>
386384
<groupId>org.springframework.boot</groupId>
@@ -507,9 +505,9 @@
507505
</indent>
508506
<removeUnusedImports/>
509507
<palantirJavaFormat/>
510-
<!-- <licenseHeader>-->
511-
<!-- <file>${basedir}/license.txt</file>-->
512-
<!-- </licenseHeader>-->
508+
<!-- <licenseHeader>-->
509+
<!-- <file>${basedir}/license.txt</file>-->
510+
<!-- </licenseHeader>-->
513511
</java>
514512
</configuration>
515513
<executions>

src/main/java/io/hoangtien2k3/commons/annotations/LocalCache.java

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -19,55 +19,14 @@
1919
import java.lang.annotation.RetentionPolicy;
2020
import java.lang.annotation.Target;
2121

22-
/**
23-
* Annotation for specifying caching behavior on methods.
24-
*
25-
* <p>
26-
* This annotation allows methods to utilize caching by specifying cache
27-
* parameters. The caching behavior is controlled by the
28-
* {@code durationInMinute}, {@code maxRecord}, and {@code autoCache}
29-
* attributes.
30-
* </p>
31-
*
32-
* <ul>
33-
* <li><b>durationInMinute:</b> Specifies the duration (in minutes) for which
34-
* the cache entries should be retained. The default value is 120 minutes.</li>
35-
* <li><b>maxRecord:</b> Defines the maximum number of cache records to store.
36-
* The default value is 1000 records.</li>
37-
* <li><b>autoCache:</b> Indicates whether caching should be automatically
38-
* applied. If {@code true}, caching is enabled without additional
39-
* configuration. The default value is {@code false}.</li>
40-
* </ul>
41-
*
42-
* <p>
43-
* This annotation should be applied to methods where caching is desired. The
44-
* cache implementation will use the specified parameters to manage caching
45-
* behavior, including cache expiration and size limits.
46-
* </p>
47-
*/
22+
/** @deprecated */
23+
@Deprecated
4824
@Target(ElementType.METHOD)
4925
@Retention(RetentionPolicy.RUNTIME)
5026
public @interface LocalCache {
51-
52-
/**
53-
* The duration (in minutes) for which cache entries should be retained.
54-
*
55-
* @return the cache duration in minutes
56-
*/
5727
int durationInMinute() default 120;
5828

59-
/**
60-
* The maximum number of cache records to store.
61-
*
62-
* @return the maximum number of cache records
63-
*/
6429
int maxRecord() default 1000;
6530

66-
/**
67-
* Whether caching should be automatically applied.
68-
*
69-
* @return {@code true} if caching should be automatically applied;
70-
* {@code false} otherwise
71-
*/
7231
boolean autoCache() default false;
7332
}

src/main/java/io/hoangtien2k3/commons/annotations/LogPerformance.java

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -59,68 +59,13 @@
5959
@Target({ElementType.METHOD, ElementType.TYPE})
6060
@Retention(RetentionPolicy.RUNTIME)
6161
public @interface LogPerformance {
62-
63-
/**
64-
* Specifies the type of log entry, such as "API_CALL", "DB_QUERY", etc.
65-
* <p>
66-
* This value helps categorize logs based on the type of operation being logged.
67-
* For instance, you might use different log types for API calls versus database
68-
* queries to differentiate them in your log analysis.
69-
* </p>
70-
*
71-
* @return the type of log entry
72-
*/
7362
String logType() default "";
7463

75-
/**
76-
* Specifies the type of action being performed, such as "CREATE", "UPDATE",
77-
* "DELETE", etc.
78-
* <p>
79-
* This value can be used to identify what kind of action is being logged,
80-
* providing more context for the log entry. For example, you might have actions
81-
* like "FETCH_DATA", "SAVE_ENTITY", etc.
82-
* </p>
83-
*
84-
* @return the type of action being logged
85-
*/
8664
String actionType() default "";
8765

88-
/**
89-
* Indicates whether the output (result) of the method should be logged.
90-
* <p>
91-
* When set to {@code true}, the output of the method will be logged, provided
92-
* it can be serialized. This is useful for tracing the results of method
93-
* executions, especially when debugging or monitoring system behavior.
94-
* </p>
95-
*
96-
* @return {@code true} if the output should be logged, {@code false} otherwise
97-
*/
9866
boolean logOutput() default true;
9967

100-
/**
101-
* Indicates whether the input arguments of the method should be logged.
102-
* <p>
103-
* When set to {@code true}, the input arguments to the method will be logged.
104-
* This is useful for capturing the state of the inputs when the method was
105-
* called, which can be important for understanding the context of the log
106-
* entry.
107-
* </p>
108-
*
109-
* @return {@code true} if the input arguments should be logged, {@code false}
110-
* otherwise
111-
*/
11268
boolean logInput() default true;
11369

114-
/**
115-
* Specifies a custom title for the log entry.
116-
* <p>
117-
* This title can be used to provide a brief description of the logged
118-
* operation, making it easier to identify and search for specific log entries
119-
* in your logging system. For example, the title might be something like "User
120-
* Login Attempt" or "Order Processing".
121-
* </p>
122-
*
123-
* @return the custom title for the log entry
124-
*/
12570
String title() default "";
12671
}

src/main/java/io/hoangtien2k3/commons/annotations/cache/CacheAspect.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
* @see CacheMono
5252
* @see Signal
5353
*/
54+
/** @deprecated */
55+
@Deprecated
5456
@Aspect
5557
@Configuration
5658
@Slf4j

src/main/java/io/hoangtien2k3/commons/annotations/cache/CacheStore.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
* @see Caffeine
6161
* @see Reflections
6262
*/
63+
/** @deprecated */
64+
@Deprecated
6365
@Slf4j
6466
@Component
6567
public class CacheStore {

src/main/java/io/hoangtien2k3/commons/annotations/cache/CacheUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
* methods dynamically and handling exceptions.
2929
* </p>
3030
*/
31+
/** @deprecated */
32+
@Deprecated
3133
@Slf4j
3234
@Component
3335
@RequiredArgsConstructor

src/main/java/io/hoangtien2k3/commons/annotations/cache/CustomizeRemovalListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
*
5454
* @author Your Name
5555
*/
56+
/** @deprecated */
57+
@Deprecated
5658
@Slf4j
5759
@AllArgsConstructor
5860
public class CustomizeRemovalListener implements RemovalListener {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package io.hoangtien2k3.commons.aop;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
@Retention(RetentionPolicy.RUNTIME)
9+
@Target(value = {ElementType.METHOD})
10+
public @interface LogPerf {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package io.hoangtien2k3.commons.aop.cache;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
@Target(ElementType.METHOD)
9+
@Retention(RetentionPolicy.RUNTIME)
10+
public @interface Cache2L {
11+
int durationInMinute() default 120;
12+
13+
int maxRecord() default 1000;
14+
15+
boolean autoCache() default false;
16+
17+
boolean useGlobalCache() default false;
18+
}

0 commit comments

Comments
 (0)