1.库存新增上下架接口

2.库存记录返回orderNo
3.增加保存库存记录mq处理
This commit is contained in:
2024-07-17 09:55:23 +08:00
parent 279057d54f
commit a16b2925b2
13 changed files with 223 additions and 11 deletions

View File

@@ -0,0 +1,30 @@
package cn.ysk.cashier.config;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RabbitConfig {
public static final String QUEUE_STOCK_RECORD_SALE = "queue.stock.record.sale";
public static final String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
public static final String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
@Bean
Queue stockRecordSaleQueue() {
return new Queue(QUEUE_STOCK_RECORD_SALE);
}
@Bean
DirectExchange stockRecordExchange() {
return new DirectExchange(EXCHANGE_STOCK_RECORD);
}
@Bean
Binding binding(Queue stockRecordSaleQueue, DirectExchange stockRecordExchange) {
return BindingBuilder.bind(stockRecordSaleQueue).to(stockRecordExchange).with(ROUTING_STOCK_RECORD_SALE);
}
}