123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- package com.fdkankan.manage.controller;
- import com.dtflys.forest.annotation.Post;
- import com.fdkankan.manage.common.ResultData;
- import com.fdkankan.manage.service.IMqBackupService;
- import com.fdkankan.manage.service.IToolsApiService;
- import org.springframework.amqp.rabbit.core.RabbitTemplate;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import java.io.UnsupportedEncodingException;
- /**
- * 工具接口
- */
- @RestController
- @RequestMapping("/service/manage/tools")
- public class ToolsController {
- @Autowired
- private IMqBackupService mqBackupService;
- /**
- * 将指定队列的消息出队
- * @param queue 队列名称
- * @param needRequeue 是否需要从新入队(0-否,1-是),如果选择了是,则需要调用入队接口从新将消息入队
- * @return
- * @throws UnsupportedEncodingException
- */
- @PostMapping("/getRabbitMqMsg")
- public ResultData getRabbitMqMsg(
- @RequestParam(value = "queue") String queue,
- @RequestParam(value = "needRequeue") Integer needRequeue) throws UnsupportedEncodingException {
- return mqBackupService.getRabbitMqMsg(queue, needRequeue);
- }
- /**
- * 将指定队列的消息从新入队
- * @param queue 队列名称
- * @return
- * @throws UnsupportedEncodingException
- */
- @PostMapping("/rabbitmqRequeue")
- public ResultData rabbitmqRequeue(
- @RequestParam(value = "queue") String queue) throws UnsupportedEncodingException {
- return mqBackupService.rabbitmqRequeue(queue);
- }
- }
|