-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7ee607
commit ab23e03
Showing
7 changed files
with
219 additions
and
2 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...tarter/src/main/java/com/jmsoftware/maf/springcloudstarter/function/BooleanCheckUtil.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,44 @@ | ||
package com.jmsoftware.maf.springcloudstarter.function; | ||
|
||
import cn.hutool.core.util.BooleanUtil; | ||
|
||
import java.util.function.Consumer; | ||
import java.util.function.Supplier; | ||
|
||
import static java.util.Objects.nonNull; | ||
|
||
/** | ||
* Description: BooleanCheckUtil, change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, date: 9/27/2021 12:03 PM | ||
**/ | ||
public class BooleanCheckUtil { | ||
/** | ||
* Require true or else throw exception. | ||
* | ||
* @param aBoolean the aBoolean | ||
* @param after the after | ||
* @return the throw exception function | ||
*/ | ||
public static ThrowExceptionFunction requireTrue(Boolean aBoolean, Consumer<Boolean> after) { | ||
if (nonNull(after)) { | ||
after.accept(aBoolean); | ||
} | ||
return exceptionSupplier -> { | ||
if (BooleanUtil.isFalse(aBoolean)) { | ||
throw exceptionSupplier.get(); | ||
} | ||
}; | ||
} | ||
|
||
@FunctionalInterface | ||
public interface ThrowExceptionFunction { | ||
/** | ||
* Or else throw. | ||
* | ||
* @param exceptionSupplier the exception supplier | ||
* @throws Throwable the throwable | ||
*/ | ||
void orElseThrow(Supplier<? extends Throwable> exceptionSupplier) throws Throwable; | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
...java/com/jmsoftware/maf/springcloudstarter/quartz/entity/QuartzJobConfigurationExcel.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,32 @@ | ||
package com.jmsoftware.maf.springcloudstarter.quartz.entity; | ||
|
||
import lombok.Data; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* Description: QuartzJobConfigurationExcel, change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, date: 9/27/2021 11:26 AM | ||
**/ | ||
@Data | ||
public class QuartzJobConfigurationExcel { | ||
@NotBlank | ||
private String name; | ||
private String group; | ||
private String serviceName; | ||
@NotBlank | ||
private String invokeTarget; | ||
@NotBlank | ||
private String cronExpression; | ||
private Byte misfirePolicy; | ||
private Byte concurrent; | ||
@NotBlank | ||
private String description; | ||
private Byte status; | ||
private String createdBy; | ||
private LocalDateTime createdTime; | ||
private String modifiedBy; | ||
private LocalDateTime modifiedTime; | ||
} |
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
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