商品模块代码提交
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.czg.controller.admin;
|
package com.czg.controller.admin;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
import com.czg.config.RabbitPublisher;
|
import com.czg.config.RabbitPublisher;
|
||||||
import com.czg.exception.CzgException;
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.log.annotation.OperationLog;
|
import com.czg.log.annotation.OperationLog;
|
||||||
@@ -77,7 +78,9 @@ public class ProductController {
|
|||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
dto.setShopId(shopId);
|
dto.setShopId(shopId);
|
||||||
productService.addProduct(dto);
|
productService.addProduct(dto);
|
||||||
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
ThreadUtil.execAsync(() -> {
|
||||||
|
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
||||||
|
});
|
||||||
return CzgResult.success();
|
return CzgResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +91,9 @@ public class ProductController {
|
|||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
dto.setShopId(shopId);
|
dto.setShopId(shopId);
|
||||||
productService.updateProduct(dto);
|
productService.updateProduct(dto);
|
||||||
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
ThreadUtil.execAsync(() -> {
|
||||||
|
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
||||||
|
});
|
||||||
return CzgResult.success();
|
return CzgResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +105,9 @@ public class ProductController {
|
|||||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
productService.deleteProduct(shopId, id);
|
productService.deleteProduct(shopId, id);
|
||||||
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
ThreadUtil.execAsync(() -> {
|
||||||
|
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
||||||
|
});
|
||||||
return CzgResult.success();
|
return CzgResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +121,9 @@ public class ProductController {
|
|||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
param.setShopId(shopId);
|
param.setShopId(shopId);
|
||||||
productService.onOffProduct(param);
|
productService.onOffProduct(param);
|
||||||
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
ThreadUtil.execAsync(() -> {
|
||||||
|
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
||||||
|
});
|
||||||
return CzgResult.success();
|
return CzgResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +137,9 @@ public class ProductController {
|
|||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
param.setShopId(shopId);
|
param.setShopId(shopId);
|
||||||
productService.markProductIsSoldOut(param);
|
productService.markProductIsSoldOut(param);
|
||||||
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
ThreadUtil.execAsync(() -> {
|
||||||
|
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
||||||
|
});
|
||||||
return CzgResult.success();
|
return CzgResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user