20240115-ljl-multiPay
parent
4b0dc1181c
commit
2bde53c616
@ -0,0 +1,18 @@
|
||||
package com.ms.api.dto.common;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class DoudianMessage implements Serializable {
|
||||
@JSONField(name = "tag")
|
||||
private String tag;
|
||||
|
||||
@JSONField(name = "msg_id")
|
||||
private String msg_id;
|
||||
|
||||
@JSONField(name = "data")
|
||||
private String data;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ms.biz.listener;
|
||||
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
//@Component
|
||||
public class JobListener implements ApplicationListener<ContextRefreshedEvent>, Runnable {
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
JobListener listener = event.getApplicationContext().getBean(JobListener.class);
|
||||
new Thread(this).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
System.out.println("run run run...");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue