refactor(sj_1.1.0-beta3): enum 统一使用lombok
This commit is contained in:
		
							parent
							
								
									a202e23b09
								
							
						
					
					
						commit
						e05b291556
					
				| @ -1,11 +1,16 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Getter; | ||||||
|  | 
 | ||||||
| /** | /** | ||||||
|  * 预警类型 |  * 预警类型 | ||||||
|  * |  * | ||||||
|  * @author: opensnail |  * @author: opensnail | ||||||
|  * @date : 2021-11-25 09:19 |  * @date : 2021-11-25 09:19 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
|  | @Getter | ||||||
| public enum AlarmTypeEnum { | public enum AlarmTypeEnum { | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -36,11 +41,4 @@ public enum AlarmTypeEnum { | |||||||
| 
 | 
 | ||||||
|     private final int value; |     private final int value; | ||||||
| 
 | 
 | ||||||
|     AlarmTypeEnum(int value) { |  | ||||||
|         this.value = value; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public int getValue() { |  | ||||||
|         return value; |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| import java.util.Objects; | import java.util.Objects; | ||||||
| @ -10,6 +11,7 @@ import java.util.Objects; | |||||||
|  * @since 2.6.0 |  * @since 2.6.0 | ||||||
|  */ |  */ | ||||||
| @Getter | @Getter | ||||||
|  | @AllArgsConstructor | ||||||
| public enum FailStrategyEnum { | public enum FailStrategyEnum { | ||||||
| 
 | 
 | ||||||
|     SKIP(1, "跳过"), |     SKIP(1, "跳过"), | ||||||
| @ -18,19 +20,6 @@ public enum FailStrategyEnum { | |||||||
|     private final Integer code; |     private final Integer code; | ||||||
|     private final String desc; |     private final String desc; | ||||||
| 
 | 
 | ||||||
|     FailStrategyEnum(Integer code, String desc) { |  | ||||||
|         this.code = code; |  | ||||||
|         this.desc = desc; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public Integer getCode() { |  | ||||||
|         return code; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public String getDesc() { |  | ||||||
|         return desc; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public static FailStrategyEnum valueOf(Integer code) { |     public static FailStrategyEnum valueOf(Integer code) { | ||||||
|         for (FailStrategyEnum failStrategyEnum : FailStrategyEnum.values()) { |         for (FailStrategyEnum failStrategyEnum : FailStrategyEnum.values()) { | ||||||
|             if (Objects.equals(failStrategyEnum.code, code)) { |             if (Objects.equals(failStrategyEnum.code, code)) { | ||||||
|  | |||||||
| @ -1,11 +1,13 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author: opensnail |  * @author: opensnail | ||||||
|  * @date : 2022-03-11 19:44 |  * @date : 2022-03-11 19:44 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
| @Getter | @Getter | ||||||
| public enum HeadersEnum { | public enum HeadersEnum { | ||||||
| 
 | 
 | ||||||
| @ -23,7 +25,4 @@ public enum HeadersEnum { | |||||||
| 
 | 
 | ||||||
|     private final String key; |     private final String key; | ||||||
| 
 | 
 | ||||||
|     HeadersEnum(String key) { |  | ||||||
|         this.key = key; |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -8,6 +9,7 @@ import lombok.Getter; | |||||||
|  * @author: zuoJunLin |  * @author: zuoJunLin | ||||||
|  * @date : 2023-12-02 18:18 |  * @date : 2023-12-02 18:18 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
| @Getter | @Getter | ||||||
| public enum JobNotifySceneEnum { | public enum JobNotifySceneEnum { | ||||||
| 
 | 
 | ||||||
| @ -23,21 +25,15 @@ public enum JobNotifySceneEnum { | |||||||
|      */ |      */ | ||||||
|     private final int notifyScene; |     private final int notifyScene; | ||||||
| 
 | 
 | ||||||
|     /** |  | ||||||
|      * 触发通知节点类型 |  | ||||||
|      */ |  | ||||||
|     private final NodeTypeEnum nodeType; |  | ||||||
| 
 |  | ||||||
|     /** |     /** | ||||||
|      * 描述 |      * 描述 | ||||||
|      */ |      */ | ||||||
|     private final String desc; |     private final String desc; | ||||||
| 
 | 
 | ||||||
|     JobNotifySceneEnum(int notifyScene, String desc, NodeTypeEnum nodeType) { |     /** | ||||||
|         this.notifyScene = notifyScene; |      * 触发通知节点类型 | ||||||
|         this.desc = desc; |      */ | ||||||
|         this.nodeType = nodeType; |     private final NodeTypeEnum nodeType; | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 获取通知场景 |      * 获取通知场景 | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -8,6 +9,7 @@ import lombok.Getter; | |||||||
|  * @author: opensnail |  * @author: opensnail | ||||||
|  * @date : 2021-11-26 18:01 |  * @date : 2021-11-26 18:01 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
| @Getter | @Getter | ||||||
| public enum NodeTypeEnum { | public enum NodeTypeEnum { | ||||||
| 
 | 
 | ||||||
| @ -24,8 +26,4 @@ public enum NodeTypeEnum { | |||||||
| 
 | 
 | ||||||
|     private final Integer type; |     private final Integer type; | ||||||
| 
 | 
 | ||||||
|     NodeTypeEnum(int type) { |  | ||||||
|         this.type = type; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -9,6 +10,7 @@ import lombok.Getter; | |||||||
|  * @date : 2021-11-24 18:18 |  * @date : 2021-11-24 18:18 | ||||||
|  * @since : 1.0.0 |  * @since : 1.0.0 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
| @Getter | @Getter | ||||||
| public enum RetryNotifySceneEnum { | public enum RetryNotifySceneEnum { | ||||||
| 
 | 
 | ||||||
| @ -30,21 +32,15 @@ public enum RetryNotifySceneEnum { | |||||||
|      */ |      */ | ||||||
|     private final int notifyScene; |     private final int notifyScene; | ||||||
| 
 | 
 | ||||||
|     /** |  | ||||||
|      * 触发通知节点类型 |  | ||||||
|      */ |  | ||||||
|     private final NodeTypeEnum nodeType; |  | ||||||
| 
 |  | ||||||
|     /** |     /** | ||||||
|      * 描述 |      * 描述 | ||||||
|      */ |      */ | ||||||
|     private final String desc; |     private final String desc; | ||||||
| 
 | 
 | ||||||
|     RetryNotifySceneEnum(int notifyScene, String desc, NodeTypeEnum nodeType) { |     /** | ||||||
|         this.notifyScene = notifyScene; |      * 触发通知节点类型 | ||||||
|         this.desc = desc; |      */ | ||||||
|         this.nodeType = nodeType; |     private final NodeTypeEnum nodeType; | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 获取通知场景 |      * 获取通知场景 | ||||||
| @ -63,5 +59,4 @@ public enum RetryNotifySceneEnum { | |||||||
|         return null; |         return null; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -8,6 +9,7 @@ import lombok.Getter; | |||||||
|  * @author: opensnail |  * @author: opensnail | ||||||
|  * @date : 2021-11-03 11:05 |  * @date : 2021-11-03 11:05 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
| @Getter | @Getter | ||||||
| public enum RetryResultStatusEnum { | public enum RetryResultStatusEnum { | ||||||
| 
 | 
 | ||||||
| @ -17,10 +19,6 @@ public enum RetryResultStatusEnum { | |||||||
| 
 | 
 | ||||||
|     private final Integer status; |     private final Integer status; | ||||||
| 
 | 
 | ||||||
|     RetryResultStatusEnum(int status) { |  | ||||||
|         this.status = status; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public static RetryResultStatusEnum getRetryResultStatusEnum(int status) { |     public static RetryResultStatusEnum getRetryResultStatusEnum(int status) { | ||||||
|         for (RetryResultStatusEnum value : RetryResultStatusEnum.values()) { |         for (RetryResultStatusEnum value : RetryResultStatusEnum.values()) { | ||||||
|             if (value.status == status) { |             if (value.status == status) { | ||||||
|  | |||||||
| @ -45,13 +45,11 @@ public enum RetryStatusEnum { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public static RetryStatusEnum getByStatus(@NonNull Integer status) { |     public static RetryStatusEnum getByStatus(@NonNull Integer status) { | ||||||
| 
 |  | ||||||
|         for (RetryStatusEnum value : RetryStatusEnum.values()) { |         for (RetryStatusEnum value : RetryStatusEnum.values()) { | ||||||
|             if (Objects.equals(value.status, status)) { |             if (Objects.equals(value.status, status)) { | ||||||
|                 return value; |                 return value; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 |  | ||||||
|         return null; |         return null; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -8,6 +9,7 @@ import lombok.Getter; | |||||||
|  * @author: opensnail |  * @author: opensnail | ||||||
|  * @date : 2021-11-26 17:58 |  * @date : 2021-11-26 17:58 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
| @Getter | @Getter | ||||||
| public enum StatusEnum { | public enum StatusEnum { | ||||||
| 
 | 
 | ||||||
| @ -16,9 +18,4 @@ public enum StatusEnum { | |||||||
| 
 | 
 | ||||||
|     private final Integer status; |     private final Integer status; | ||||||
| 
 | 
 | ||||||
|     StatusEnum(int status) { |  | ||||||
|         this.status = status; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package com.aizuda.snailjob.common.core.enums; | package com.aizuda.snailjob.common.core.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -9,6 +10,7 @@ import lombok.Getter; | |||||||
|  * @date 2023-12-24 08:13:43 |  * @date 2023-12-24 08:13:43 | ||||||
|  * @since 2.6.0 |  * @since 2.6.0 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
| @Getter | @Getter | ||||||
| public enum WorkflowNodeTypeEnum { | public enum WorkflowNodeTypeEnum { | ||||||
|     JOB_TASK(1, "JOB任务"), |     JOB_TASK(1, "JOB任务"), | ||||||
| @ -19,19 +21,6 @@ public enum WorkflowNodeTypeEnum { | |||||||
|     private final int type; |     private final int type; | ||||||
|     private final String desc; |     private final String desc; | ||||||
| 
 | 
 | ||||||
|     WorkflowNodeTypeEnum(int type, String desc) { |  | ||||||
|         this.type = type; |  | ||||||
|         this.desc = desc; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public int getType() { |  | ||||||
|         return type; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public String getDesc() { |  | ||||||
|         return desc; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public static WorkflowNodeTypeEnum valueOf(int type) { |     public static WorkflowNodeTypeEnum valueOf(int type) { | ||||||
|         for (WorkflowNodeTypeEnum workflowNodeTypeEnum : WorkflowNodeTypeEnum.values()) { |         for (WorkflowNodeTypeEnum workflowNodeTypeEnum : WorkflowNodeTypeEnum.values()) { | ||||||
|             if (workflowNodeTypeEnum.getType() == type) { |             if (workflowNodeTypeEnum.getType() == type) { | ||||||
|  | |||||||
| @ -2,6 +2,7 @@ package com.aizuda.snailjob.server.common.allocate.client; | |||||||
| 
 | 
 | ||||||
| import com.aizuda.snailjob.server.common.ClientLoadBalance; | import com.aizuda.snailjob.server.common.ClientLoadBalance; | ||||||
| import com.aizuda.snailjob.server.common.exception.SnailJobServerException; | import com.aizuda.snailjob.server.common.exception.SnailJobServerException; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -21,6 +22,7 @@ public class ClientLoadBalanceManager { | |||||||
|         throw new SnailJobServerException("routeType is not existed. routeType:[{}]", routeType); |         throw new SnailJobServerException("routeType is not existed. routeType:[{}]", routeType); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     @AllArgsConstructor | ||||||
|     @Getter |     @Getter | ||||||
|     public enum AllocationAlgorithmEnum { |     public enum AllocationAlgorithmEnum { | ||||||
| 
 | 
 | ||||||
| @ -32,10 +34,6 @@ public class ClientLoadBalanceManager { | |||||||
|         private final int type; |         private final int type; | ||||||
|         private final ClientLoadBalance clientLoadBalance; |         private final ClientLoadBalance clientLoadBalance; | ||||||
| 
 | 
 | ||||||
|         AllocationAlgorithmEnum(int type, ClientLoadBalance clientLoadBalance) { |  | ||||||
|             this.type = type; |  | ||||||
|             this.clientLoadBalance = clientLoadBalance; |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| package com.aizuda.snailjob.server.common.enums; | package com.aizuda.snailjob.server.common.enums; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| import java.time.temporal.ChronoUnit; | import java.time.temporal.ChronoUnit; | ||||||
| @ -10,6 +11,7 @@ import java.time.temporal.ChronoUnit; | |||||||
|  * @author: opensnail |  * @author: opensnail | ||||||
|  * @date : 2021-11-29 17:30 |  * @date : 2021-11-29 17:30 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
| @Getter | @Getter | ||||||
| public enum DelayLevelEnum { | public enum DelayLevelEnum { | ||||||
| 
 | 
 | ||||||
| @ -41,27 +43,22 @@ public enum DelayLevelEnum { | |||||||
|     _26(26, 12, ChronoUnit.HOURS), |     _26(26, 12, ChronoUnit.HOURS), | ||||||
|     ; |     ; | ||||||
| 
 | 
 | ||||||
|     /** |  | ||||||
|      * 时间 |  | ||||||
|      */ |  | ||||||
|     private final int time; |  | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 等级 |      * 等级 | ||||||
|      */ |      */ | ||||||
|     private final int level; |     private final int level; | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * 时间 | ||||||
|  |      */ | ||||||
|  |     private final int time; | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * 单位 |      * 单位 | ||||||
|      */ |      */ | ||||||
|     private final ChronoUnit unit; |     private final ChronoUnit unit; | ||||||
| 
 | 
 | ||||||
|     DelayLevelEnum(int level, int time, ChronoUnit unit) { |  | ||||||
|         this.time = time; |  | ||||||
|         this.unit = unit; |  | ||||||
|         this.level = level; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |     /** | ||||||
|      * 根据等级获取延迟等级枚举 |      * 根据等级获取延迟等级枚举 | ||||||
|      * |      * | ||||||
|  | |||||||
| @ -7,6 +7,7 @@ import com.aizuda.snailjob.server.common.enums.DelayLevelEnum; | |||||||
| import com.aizuda.snailjob.server.common.exception.SnailJobServerException; | import com.aizuda.snailjob.server.common.exception.SnailJobServerException; | ||||||
| import com.aizuda.snailjob.server.common.util.DateUtils; | import com.aizuda.snailjob.server.common.util.DateUtils; | ||||||
| import com.google.common.base.Preconditions; | import com.google.common.base.Preconditions; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| import lombok.Getter; | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| @ -57,6 +58,7 @@ public class WaitStrategies { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     @AllArgsConstructor | ||||||
|     @Getter |     @Getter | ||||||
|     public enum WaitStrategyEnum { |     public enum WaitStrategyEnum { | ||||||
|         DELAY_LEVEL(1, delayLevelWait()), |         DELAY_LEVEL(1, delayLevelWait()), | ||||||
| @ -67,11 +69,6 @@ public class WaitStrategies { | |||||||
|         private final int type; |         private final int type; | ||||||
|         private final WaitStrategy waitStrategy; |         private final WaitStrategy waitStrategy; | ||||||
| 
 | 
 | ||||||
|         WaitStrategyEnum(int type, WaitStrategy waitStrategy) { |  | ||||||
|             this.type = type; |  | ||||||
|             this.waitStrategy = waitStrategy; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         /** |         /** | ||||||
|          * 获取退避策略 |          * 获取退避策略 | ||||||
|          * |          * | ||||||
|  | |||||||
| @ -1,5 +1,8 @@ | |||||||
| package com.aizuda.snailjob.server.web.annotation; | package com.aizuda.snailjob.server.web.annotation; | ||||||
| 
 | 
 | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Getter; | ||||||
|  | 
 | ||||||
| import java.util.HashMap; | import java.util.HashMap; | ||||||
| import java.util.Map; | import java.util.Map; | ||||||
| 
 | 
 | ||||||
| @ -7,6 +10,8 @@ import java.util.Map; | |||||||
|  * @author: byteblogs |  * @author: byteblogs | ||||||
|  * @date: 2019/09/02 16:35 |  * @date: 2019/09/02 16:35 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
|  | @Getter | ||||||
| public enum RoleEnum { | public enum RoleEnum { | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -31,11 +36,6 @@ public enum RoleEnum { | |||||||
| 
 | 
 | ||||||
|     private final String roleName; |     private final String roleName; | ||||||
| 
 | 
 | ||||||
|     RoleEnum(Integer roleId, String roleName) { |  | ||||||
|         this.roleId = roleId; |  | ||||||
|         this.roleName = roleName; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public static Map<Integer, RoleEnum> getEnumTypeMap() { |     public static Map<Integer, RoleEnum> getEnumTypeMap() { | ||||||
|         return enumTypeMap; |         return enumTypeMap; | ||||||
|     } |     } | ||||||
| @ -48,12 +48,4 @@ public enum RoleEnum { | |||||||
|         return USER.getRoleId().equals(roleId); |         return USER.getRoleId().equals(roleId); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public Integer getRoleId() { |  | ||||||
|         return roleId; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public String getRoleName() { |  | ||||||
|         return roleName; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -3,6 +3,8 @@ package com.aizuda.snailjob.server.web.model.enums; | |||||||
| import cn.hutool.core.date.LocalDateTimeUtil; | import cn.hutool.core.date.LocalDateTimeUtil; | ||||||
| import com.aizuda.snailjob.common.core.util.StreamUtils; | import com.aizuda.snailjob.common.core.util.StreamUtils; | ||||||
| import com.aizuda.snailjob.server.web.model.response.DashboardLineResponseVO; | import com.aizuda.snailjob.server.web.model.response.DashboardLineResponseVO; | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Getter; | ||||||
| 
 | 
 | ||||||
| import java.time.LocalDate; | import java.time.LocalDate; | ||||||
| import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||||
| @ -17,6 +19,8 @@ import java.util.function.Function; | |||||||
|  * @author: byteblogs |  * @author: byteblogs | ||||||
|  * @date: 2020/1/19 20:36 |  * @date: 2020/1/19 20:36 | ||||||
|  */ |  */ | ||||||
|  | @AllArgsConstructor | ||||||
|  | @Getter | ||||||
| public enum DateTypeEnum { | public enum DateTypeEnum { | ||||||
|     /** |     /** | ||||||
|      * 天(按小时) |      * 天(按小时) | ||||||
| @ -105,14 +109,6 @@ public enum DateTypeEnum { | |||||||
|     private Function<LocalDateTime, LocalDateTime> startTime; |     private Function<LocalDateTime, LocalDateTime> startTime; | ||||||
|     private Function<LocalDateTime, LocalDateTime> endTime; |     private Function<LocalDateTime, LocalDateTime> endTime; | ||||||
| 
 | 
 | ||||||
|     DateTypeEnum(Consumer<List<DashboardLineResponseVO>> consumer, |  | ||||||
|                  Function<LocalDateTime, LocalDateTime> startTime, |  | ||||||
|                  Function<LocalDateTime, LocalDateTime> endTime) { |  | ||||||
|         this.consumer = consumer; |  | ||||||
|         this.startTime = startTime; |  | ||||||
|         this.endTime = endTime; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     private static DashboardLineResponseVO buildZeroedVoWithCreateDt(String createDt) { |     private static DashboardLineResponseVO buildZeroedVoWithCreateDt(String createDt) { | ||||||
|         return new DashboardLineResponseVO() |         return new DashboardLineResponseVO() | ||||||
|                 .setTotal(0L) |                 .setTotal(0L) | ||||||
| @ -129,15 +125,4 @@ public enum DateTypeEnum { | |||||||
|                 .setCreateDt(createDt); |                 .setCreateDt(createDt); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public Function<LocalDateTime, LocalDateTime> getStartTime() { |  | ||||||
|         return startTime; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public Function<LocalDateTime, LocalDateTime> getEndTime() { |  | ||||||
|         return endTime; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public Consumer<List<DashboardLineResponseVO>> getConsumer() { |  | ||||||
|         return consumer; |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 dhb52
						dhb52