diff --git a/lib-annotation/src/main/java/com/xiaojinzi/support/annotation/Models.kt b/lib-annotation/src/main/java/com/xiaojinzi/support/annotation/Models.kt index e0a2c7b..b9a7044 100644 --- a/lib-annotation/src/main/java/com/xiaojinzi/support/annotation/Models.kt +++ b/lib-annotation/src/main/java/com/xiaojinzi/support/annotation/Models.kt @@ -21,6 +21,11 @@ annotation class Model */ typealias ModelForNetwork = Model +/** + * 表示和 Json 之间序列化的模型 + */ +typealias ModelForJson = Model + /** * 用于逻辑处理 */ diff --git a/lib-annotation/src/main/java/com/xiaojinzi/support/annotation/Times.kt b/lib-annotation/src/main/java/com/xiaojinzi/support/annotation/Times.kt index 1e3bc4b..758a254 100644 --- a/lib-annotation/src/main/java/com/xiaojinzi/support/annotation/Times.kt +++ b/lib-annotation/src/main/java/com/xiaojinzi/support/annotation/Times.kt @@ -1,7 +1,24 @@ package com.xiaojinzi.support.annotation /** - * 表示毫秒 + * 表示毫秒的值 + */ +@Retention(value = AnnotationRetention.SOURCE) +@Target( + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.LOCAL_VARIABLE, + AnnotationTarget.TYPE, + AnnotationTarget.FUNCTION, +) +annotation class MillisecondValue + +/** + * 表示毫秒的时间 */ @Retention(value = AnnotationRetention.SOURCE) @Target( @@ -18,7 +35,24 @@ package com.xiaojinzi.support.annotation annotation class MillisecondTime /** - * 表示秒 + * 表示秒的值 + */ +@Retention(value = AnnotationRetention.SOURCE) +@Target( + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.LOCAL_VARIABLE, + AnnotationTarget.TYPE, + AnnotationTarget.FUNCTION, +) +annotation class SecondValue + +/** + * 表示秒的时间 */ @Retention(value = AnnotationRetention.SOURCE) @Target( @@ -35,7 +69,24 @@ annotation class MillisecondTime annotation class SecondTime /** - * 表示分钟 + * 表示分钟的值 + */ +@Retention(value = AnnotationRetention.SOURCE) +@Target( + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.LOCAL_VARIABLE, + AnnotationTarget.TYPE, + AnnotationTarget.FUNCTION, +) +annotation class MinuteValue + +/** + * 表示分钟的时间 */ @Retention(value = AnnotationRetention.SOURCE) @Target( @@ -52,7 +103,24 @@ annotation class SecondTime annotation class MinuteTime /** - * 表示小时 + * 表示小时的值 + */ +@Retention(value = AnnotationRetention.SOURCE) +@Target( + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.LOCAL_VARIABLE, + AnnotationTarget.TYPE, + AnnotationTarget.FUNCTION, +) +annotation class HourValue + +/** + * 表示小时的时间 */ @Retention(value = AnnotationRetention.SOURCE) @Target( @@ -69,7 +137,24 @@ annotation class MinuteTime annotation class HourTime /** - * 表示天 + * 表示天的值 + */ +@Retention(value = AnnotationRetention.SOURCE) +@Target( + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.LOCAL_VARIABLE, + AnnotationTarget.TYPE, + AnnotationTarget.FUNCTION, +) +annotation class DayValue + +/** + * 表示天的时间 */ @Retention(value = AnnotationRetention.SOURCE) @Target( @@ -86,7 +171,24 @@ annotation class HourTime annotation class DayTime /** - * 表示月 + * 表示月的值 + */ +@Retention(value = AnnotationRetention.SOURCE) +@Target( + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.LOCAL_VARIABLE, + AnnotationTarget.TYPE, + AnnotationTarget.FUNCTION, +) +annotation class MonthValue + +/** + * 表示月的时间 */ @Retention(value = AnnotationRetention.SOURCE) @Target( @@ -103,7 +205,24 @@ annotation class DayTime annotation class MonthTime /** - * 表示年 + * 表示年的值 + */ +@Retention(value = AnnotationRetention.SOURCE) +@Target( + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.LOCAL_VARIABLE, + AnnotationTarget.TYPE, + AnnotationTarget.FUNCTION, +) +annotation class YearValue + +/** + * 表示年的时间 */ @Retention(value = AnnotationRetention.SOURCE) @Target(