XXLJobProperties.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. package top.lvzhiqiang.config;
  2. import org.springframework.boot.context.properties.ConfigurationProperties;
  3. import org.springframework.boot.context.properties.EnableConfigurationProperties;
  4. /**
  5. * XXL-JOB定时任务属性值
  6. *
  7. * @author shiyong
  8. * 2022/3/13 12:39
  9. */
  10. @EnableConfigurationProperties(XXLJobProperties.class)
  11. @ConfigurationProperties(prefix = XXLJobProperties.XXL_JOB_PREFIX)
  12. public class XXLJobProperties {
  13. public static final String XXL_JOB_PREFIX = "xxl.job";
  14. private String accessToken;
  15. private Admin admin = new Admin();
  16. private Executor executor = new Executor();
  17. public String getAccessToken() {
  18. return accessToken;
  19. }
  20. public void setAccessToken(String accessToken) {
  21. this.accessToken = accessToken;
  22. }
  23. public Admin getAdmin() {
  24. return admin;
  25. }
  26. public void setAdmin(Admin admin) {
  27. this.admin = admin;
  28. }
  29. public Executor getExecutor() {
  30. return executor;
  31. }
  32. public void setExecutor(Executor executor) {
  33. this.executor = executor;
  34. }
  35. public static class Admin {
  36. private String addresses;
  37. public String getAddresses() {
  38. return addresses;
  39. }
  40. public void setAddresses(String addresses) {
  41. this.addresses = addresses;
  42. }
  43. }
  44. public static class Executor {
  45. private String appName;
  46. private String ip;
  47. private int port;
  48. private String logPath;
  49. private int logRetentionDays;
  50. public String getAppName() {
  51. return appName;
  52. }
  53. public void setAppName(String appName) {
  54. this.appName = appName;
  55. }
  56. public String getIp() {
  57. return ip;
  58. }
  59. public void setIp(String ip) {
  60. this.ip = ip;
  61. }
  62. public int getPort() {
  63. return port;
  64. }
  65. public void setPort(int port) {
  66. this.port = port;
  67. }
  68. public String getLogPath() {
  69. return logPath;
  70. }
  71. public void setLogPath(String logPath) {
  72. this.logPath = logPath;
  73. }
  74. public int getLogRetentionDays() {
  75. return logRetentionDays;
  76. }
  77. public void setLogRetentionDays(int logRetentionDays) {
  78. this.logRetentionDays = logRetentionDays;
  79. }
  80. }
  81. }