SAP|SAP Commerce Cloud Product Review 的添加逻辑
点了 Write Review 按钮之后,调用 ProductReviewService 的 add 方法:
文章图片
该方法 dispatch 一个新的 action:
文章图片
文章图片
文章图片
override the ProductReviewService to dispatch a custom action to an effect they would create with the logic they need.搜索 POST_PRODUCT_REVIEW, 看看接收方是谁。
答案是 『ProductReviewsEffect:接收了该 Action 之后,调用 productReviewsConnector,消费 OCC API 添加 post,待添加成功后,返回新的 Action 对象 ProductActions.PostProductReviewSuccess,其中包含了 ReviewResponse.
文章图片
同样在该 effect 内部,接收到 POST_PRODUCT_REVIEW_SUCCESS 之后,抛出 Thank you for review 的成功消息。
【SAP|SAP Commerce Cloud Product Review 的添加逻辑】
文章图片
更多Jerry的原创文章,尽在:"汪子熙":
文章图片
推荐阅读
- Spring|Spring Cloud Feign实现文件上传下载的示例代码
- 为Google|为Google Cloud配置深度学习环境(CUDA、cuDNN、Tensorflow2、VScode远程ssh等)
- 【SpringCloud-Alibaba系列教程】8.一文学会使用sentinel
- java|java B2B2C 仿淘宝电子商城系统-Spring Cloud构建分布式电子商务平台
- Spring|Spring Cloud Feign组件
- Spring|Spring Cloud Alibaba之负载均衡组件 - Ribbon
- Spring|Spring Cloud学习day98(Eureka的原理和Ribbon负载均衡)
- 史上最简单的SpringCloud教程|史上最简单的SpringCloud教程 | 第十篇: 高可用的服务注册中心(Finchley版本)
- Spring|Spring Cloud Gateway真的有那么差吗()
- (三十)java版spring|(三十)java版spring cloud+spring boot+redis多租户社交电子商务平台- gateway限流