疯狂的狮子Li
2022-01-25 3706d2e1db45e64a1375b92300901de39e35e464
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/queue/PriorityQueueController.java
@@ -8,7 +8,6 @@
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;
@@ -26,7 +25,7 @@
 */
@Slf4j
@Api(value = "优先队列 演示案例", tags = {"优先队列"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RequiredArgsConstructor
@RestController
@RequestMapping("/demo/queue/priority")
public class PriorityQueueController {
@@ -47,7 +46,9 @@
        }
        for (int i = 0; i < 10; i++) {
            int randomNum = RandomUtil.randomInt(10);
            PriorityDemo data = new PriorityDemo().setName("data-" + i).setOrderNum(randomNum);
            PriorityDemo data = new PriorityDemo();
            data.setName("data-" + i);
            data.setOrderNum(randomNum);
            if (QueueUtils.addPriorityQueueObject(queueName, data)) {
                log.info("通道: {} , 发送数据: {}", queueName, data);
            } else {
@@ -62,7 +63,9 @@
    public AjaxResult<Void> remove(@ApiParam("队列名") String queueName,
                                   @ApiParam("对象名") String name,
                                   @ApiParam("排序号") Integer orderNum) {
        PriorityDemo data = new PriorityDemo().setName(name).setOrderNum(orderNum);
        PriorityDemo data = new PriorityDemo();
        data.setName(name);
        data.setOrderNum(orderNum);
        if (QueueUtils.removePriorityQueueObject(queueName, data)) {
            log.info("通道: {} , 删除数据: {}", queueName, data);
        } else {