50 lines
1.2 KiB
Java
50 lines
1.2 KiB
Java
package com.zcloud.util.mq;
|
|
|
|
import com.zcloud.dto.Response;
|
|
import com.zcloud.dto.TenCorpDto;
|
|
import com.zcloud.service.mq.SendMessageService;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
/**
|
|
* @author zhangyue
|
|
* @date 2023/9/23/023 13:54
|
|
*/
|
|
@Component
|
|
public class MqSendUtil {
|
|
|
|
|
|
@Resource
|
|
private SendMessageService sendMessageService;
|
|
|
|
public Response sendMessage(TenCorpDto tenCorpDto) throws Exception {
|
|
try {
|
|
sendMessageService.sendMessage(tenCorpDto);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
return Response.OK();
|
|
}
|
|
|
|
public Response timelyQueue(TenCorpDto tenCorpDto) throws Exception {
|
|
try {
|
|
sendMessageService.sendMessage(tenCorpDto);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
return Response.OK();
|
|
}
|
|
|
|
public Response sendDelayQueue(TenCorpDto tenCorpDto) throws Exception {
|
|
try {
|
|
sendMessageService.SendDelayQueue(tenCorpDto);
|
|
return Response.OK();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return Response.ERROR(e.getMessage());
|
|
}
|
|
|
|
}
|
|
}
|