SpringBeanTaskDemo.java 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2021-2025, LXQ All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: LXQ (609827073@qq.com)
  16. */
  17. package com.kxs.daemon.quartz.task;
  18. import com.kxs.daemon.quartz.constants.SkyQuartzEnum;
  19. import lombok.SneakyThrows;
  20. import lombok.extern.slf4j.Slf4j;
  21. import org.springframework.stereotype.Component;
  22. import java.time.LocalDateTime;
  23. /**
  24. * @author LXQ
  25. */
  26. @Slf4j
  27. @Component("demo")
  28. public class SpringBeanTaskDemo {
  29. /**
  30. * 测试Spring Bean的演示方法
  31. */
  32. @SneakyThrows
  33. public String demoMethod(String para) {
  34. log.info("测试于:{},输入参数{}", LocalDateTime.now(), para);
  35. return SkyQuartzEnum.JOB_LOG_STATUS_SUCCESS.getType();
  36. }
  37. }