forked from openGemini/opengemini-client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: modify annotation name (openGemini#100)
Signed-off-by: weiping-code <[email protected]>
- Loading branch information
1 parent
5cdb384
commit e4ece2e
Showing
15 changed files
with
103 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../spring/data/TestReactiveApplication.java → .../data/sample/TestReactiveApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/test/java/io/opengemini/client/spring/data/config/OpenGeminiAutoConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...i/client/spring/data/TestApplication.java → ...t/spring/data/sample/TestApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...test/java/io/opengemini/client/spring/data/sample/measurement/WeatherFixNameNoCreate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.opengemini.client.spring.data.sample.measurement; | ||
|
||
|
||
import io.opengemini.client.api.Precision; | ||
import io.opengemini.client.spring.data.annotation.Database; | ||
import io.opengemini.client.spring.data.annotation.Field; | ||
import io.opengemini.client.spring.data.annotation.Measurement; | ||
import io.opengemini.client.spring.data.annotation.RetentionPolicy; | ||
import io.opengemini.client.spring.data.annotation.Tag; | ||
import io.opengemini.client.spring.data.annotation.Time; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Database(name = "testdb", create = false) | ||
@RetentionPolicy(name = "testrp", create = false) | ||
@Measurement(name = "testms") | ||
@Getter | ||
@Setter | ||
public class WeatherFixNameNoCreate { | ||
|
||
@Tag(name = "Location") | ||
private String location; | ||
|
||
@Field(name = "Temperature") | ||
private Double temperature; | ||
|
||
@Time(precision = Precision.PRECISIONMILLISECOND) | ||
private Long time; | ||
|
||
} |
5 changes: 4 additions & 1 deletion
5
...ent/spring/data/annotations/Database.java → ...ient/spring/data/annotation/Database.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ini-spring/src/main/java/io/opengemini/client/spring/data/annotation/MeasurementScan.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.opengemini.client.spring.data.annotation; | ||
|
||
import org.springframework.core.annotation.AliasFor; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface MeasurementScan { | ||
|
||
/** | ||
* Alias for {@link #basePackages}. | ||
* <p>Allows for more concise annotation declarations if no other attributes | ||
* are needed — for example, {@code @MeasurementScan("org.my.pkg")} | ||
* instead of {@code @MeasurementScan(basePackages = "org.my.pkg")}. | ||
*/ | ||
@AliasFor("basePackages") | ||
String[] value() default {}; | ||
|
||
/** | ||
* Base packages to scan for annotated measurements. | ||
* <p>{@link #value} is an alias for this attribute. | ||
*/ | ||
@AliasFor("value") | ||
String[] basePackages() default {}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
spring/opengemini-spring/src/main/java/io/opengemini/client/spring/data/annotation/Tag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.opengemini.client.spring.data.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.FIELD) | ||
public @interface Tag { | ||
|
||
/** | ||
* If unset, the annotated field's name will be used as the tag name. | ||
*/ | ||
String name(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...gemini-spring/src/main/java/io/opengemini/client/spring/data/annotation/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package io.opengemini.client.spring.data.annotation; |
1 change: 0 additions & 1 deletion
1
...emini-spring/src/main/java/io/opengemini/client/spring/data/annotations/package-info.java
This file was deleted.
Oops, something went wrong.