forked from youlaitech/youlai-mall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Seata实验室案例调整为Seata官网购买商品示例
- Loading branch information
1 parent
fdfcd93
commit 43ee28a
Showing
23 changed files
with
355 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 12 additions & 13 deletions
25
...boratory/seata/service/ISeataService.java → ...aboratory/seata/service/SeataService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,39 @@ | ||
package com.youlai.laboratory.seata.service; | ||
|
||
import com.youlai.laboratory.seata.pojo.form.SeataForm; | ||
import com.youlai.laboratory.seata.pojo.vo.SeataDataVO; | ||
import com.youlai.laboratory.seata.pojo.vo.SeataVO; | ||
|
||
/** | ||
* @author haoxr | ||
* @date 2022/4/16 20:49 | ||
*/ | ||
public interface ISeataService { | ||
public interface SeataService { | ||
|
||
/** | ||
* 模拟订单支付 | ||
* 获取模拟数据 | ||
* | ||
* @return | ||
*/ | ||
boolean payOrder(SeataForm seataForm); | ||
SeataVO getData(); | ||
|
||
/** | ||
* 模拟订单支付(分布式事务) | ||
* 重置模拟数据 | ||
* | ||
* @param seataForm | ||
* @return | ||
*/ | ||
boolean payOrderWithGlobalTx(SeataForm seataForm); | ||
boolean resetData(); | ||
|
||
/** | ||
* 获取模拟数据 | ||
* 购买商品 | ||
* | ||
* @return | ||
* @return 订单号 | ||
*/ | ||
SeataDataVO getData(); | ||
String purchaseGoods(SeataForm seataForm); | ||
|
||
/** | ||
* 重置模拟数据 | ||
* 购买商品(全局事务) | ||
* | ||
* @return | ||
* @return 订单号 | ||
*/ | ||
boolean resetData(); | ||
String purchaseGoodsWithGlobalTx(SeataForm seataForm); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ | |
import lombok.Data; | ||
|
||
/** | ||
* 订单信息传输层对象 | ||
* 订单传输层对象 | ||
* | ||
* @author <a href="mailto:[email protected]">haoxr</a> | ||
* @date 2022/4/17 21:12 | ||
* @author haoxr | ||
* @date 2022/4/17 | ||
*/ | ||
@Data | ||
public class OrderInfoDTO { | ||
|
28 changes: 28 additions & 0 deletions
28
mall-oms/oms-api/src/main/java/com/youlai/mall/oms/dto/SeataOrderDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.youlai.mall.oms.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class SeataOrderDTO { | ||
|
||
/** | ||
* 会员ID | ||
*/ | ||
private Long memberId; | ||
|
||
/** | ||
* 商品ID | ||
*/ | ||
private Long skuId; | ||
|
||
/** | ||
* 订单金额 | ||
*/ | ||
private Long amount; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.