暂降模块代码合并
终端运行管理接口调整
This commit is contained in:
@@ -88,7 +88,11 @@ public enum CommonResponseEnum {
|
||||
|
||||
DEPT_BINDED("A0099", "部门id已绑定"),
|
||||
|
||||
ID_NOT_EXIST("A0099", "id不存在"),
|
||||
ID_NOT_EXIST("A0100", "id不存在"),
|
||||
|
||||
TIME_ERROR("A0101","时间格式有误"),
|
||||
|
||||
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -178,6 +178,26 @@ public class PubUtils {
|
||||
return LocalDateTime.parse(time, dateTimeFormatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验时间格式
|
||||
*/
|
||||
public static boolean checkDateTime(String time) {
|
||||
if(StrUtil.isBlank(time)){
|
||||
throw new BusinessException(CommonResponseEnum.TIME_ERROR);
|
||||
}
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME);
|
||||
|
||||
try {
|
||||
simpleDateFormat.parse(time);
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(CommonResponseEnum.TIME_ERROR);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 用于获取对象中,前缀一样,后缀为2~50的属性值
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user