|
@@ -3,12 +3,20 @@ package com.fdkankan.job.controller;
|
|
|
|
|
|
import com.fdkankan.job.service.IRepairUpXmlUrlService;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
+import com.rabbitmq.client.AMQP;
|
|
|
+import com.rabbitmq.client.Channel;
|
|
|
+import com.rabbitmq.client.GetResponse;
|
|
|
+import org.springframework.amqp.rabbit.core.ChannelCallback;
|
|
|
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* pro场景表 前端控制器
|
|
@@ -22,12 +30,37 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class SceneProController {
|
|
|
|
|
|
@Autowired
|
|
|
+ private RabbitTemplate rabbitTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private IRepairUpXmlUrlService repairUpXmlUrlService;
|
|
|
|
|
|
|
|
|
@GetMapping("/test")
|
|
|
- public ResultData test(){
|
|
|
- repairUpXmlUrlService.repairSceneUpXmlUrlOfVideos();
|
|
|
+ public ResultData test() throws UnsupportedEncodingException {
|
|
|
+ GetResponse bbbbb = rabbitTemplate.execute(new ChannelCallback<GetResponse>() {
|
|
|
+ public GetResponse doInRabbit(Channel channel) throws Exception {
|
|
|
+ GetResponse get = channel.basicGet("bbbbb", false);
|
|
|
+ return get;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ byte[] body = bbbbb.getBody();
|
|
|
+ System.out.println(new String(body, StandardCharsets.UTF_8.name()));
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/test2")
|
|
|
+ public ResultData test2() throws UnsupportedEncodingException {
|
|
|
+ GetResponse bbbbb = rabbitTemplate.execute(new ChannelCallback<GetResponse>() {
|
|
|
+ public GetResponse doInRabbit(Channel channel) throws Exception {
|
|
|
+ GetResponse get = channel.basicGet("bbbbb", true);
|
|
|
+ return get;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ byte[] body = bbbbb.getBody();
|
|
|
+ System.out.println(new String(body, StandardCharsets.UTF_8.name()));
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|