|
|
|
@ -7,11 +7,10 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
|
|
|
|
|
import cn.estsh.impp.framework.base.controller.CoreBaseController;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.MachineFactory;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ImppRedis;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import com.rabbitmq.client.Channel;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
@ -22,7 +21,9 @@ import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.context.i18n.LocaleContextHolder;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
@ -66,7 +67,7 @@ public class DemoRedisMqController extends CoreBaseController{
|
|
|
|
|
@ApiOperation(value="缓存",notes="放入数据")
|
|
|
|
|
public ResultBean putCache(){
|
|
|
|
|
//放入缓存
|
|
|
|
|
redisCore.putObject("machineFactory",new MachineFactory("111","nnnn"));
|
|
|
|
|
//redisCore.putObject("machineFactory",new MachineFactory("111","nnnn"));
|
|
|
|
|
redisCore.putObject("wms","123123123");
|
|
|
|
|
|
|
|
|
|
return new ResultBean(true,"已放入缓存");
|
|
|
|
@ -75,11 +76,11 @@ public class DemoRedisMqController extends CoreBaseController{
|
|
|
|
|
@GetMapping(value="/get-cache")
|
|
|
|
|
@ApiOperation(value="缓存",notes="获取数据")
|
|
|
|
|
public ResultBean getCache(){
|
|
|
|
|
MachineFactory mf = (MachineFactory) redisCore.getObject("machineFactory");
|
|
|
|
|
System.out.println("1===== " + mf);
|
|
|
|
|
//MachineFactory mf = (MachineFactory) redisCore.getObject("machineFactory");
|
|
|
|
|
//System.out.println("1===== " + mf);
|
|
|
|
|
System.out.println("2===== " + redisCore.getObject("wms"));
|
|
|
|
|
|
|
|
|
|
return new ResultBean(true,mf);
|
|
|
|
|
return new ResultBean(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value="/send-mq")
|
|
|
|
@ -94,7 +95,7 @@ public class DemoRedisMqController extends CoreBaseController{
|
|
|
|
|
this.rabbitTemplate.convertAndSend(I3CoreQueueConfig.DEMO_HANDLE_QUEUE, context);
|
|
|
|
|
|
|
|
|
|
System.out.println("发送Object数据 : " + context);
|
|
|
|
|
this.rabbitTemplate.convertAndSend(I3CoreQueueConfig.DEMO_OBJ_QUEUE, new MachineFactory("111mq","rabbit"));
|
|
|
|
|
//this.rabbitTemplate.convertAndSend(I3CoreQueueConfig.DEMO_OBJ_QUEUE, new MachineFactory("111mq","rabbit"));
|
|
|
|
|
|
|
|
|
|
return new ResultBean(true,"操作成功");
|
|
|
|
|
}
|
|
|
|
|