CronJobBaseInfo.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * <<
  3. * Davinci
  4. * ==
  5. * Copyright (C) 2016 - 2019 EDP
  6. * ==
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. * >>
  17. *
  18. */
  19. package edp.davinci.dto.cronJobDto;
  20. import edp.core.utils.DateUtils;
  21. import lombok.Data;
  22. import javax.validation.constraints.Min;
  23. import javax.validation.constraints.NotBlank;
  24. import javax.validation.constraints.NotNull;
  25. import javax.validation.constraints.Pattern;
  26. @Data
  27. @NotNull(message = "Cron job info cannot be null")
  28. public class CronJobBaseInfo {
  29. @NotBlank(message = "任务名称不能为空")
  30. private String name;
  31. @Min(value = 1L, message = "项目id 无效")
  32. private Long projectId;
  33. @NotBlank(message = "任务id不能为空")
  34. private String jobType;
  35. @NotBlank(message = "任务配置不能为空")
  36. private String config;
  37. @NotBlank(message = "任务表达式不能为空")
  38. private String cronExpression;
  39. @NotBlank(message = "开始日期不能为空")
  40. @Pattern(regexp = DateUtils.DATE_HMS_REGEX, message = "开始日期格式转换错误")
  41. private String startDate;
  42. @NotBlank(message = "结束日期不能为空")
  43. @Pattern(regexp = DateUtils.DATE_HMS_REGEX, message = "结束日期格式转换错误")
  44. private String endDate;
  45. private String description;
  46. }