正在显示
3 个修改的文件
包含
47 行增加
和
0 行删除
@@ -29,3 +29,11 @@ func CreateCancelOrderService(options map[string]interface{}) (service.CancelOrd | @@ -29,3 +29,11 @@ func CreateCancelOrderService(options map[string]interface{}) (service.CancelOrd | ||
29 | } | 29 | } |
30 | return domainService.NewCancelOrderService(transactionContext) | 30 | return domainService.NewCancelOrderService(transactionContext) |
31 | } | 31 | } |
32 | + | ||
33 | +func CreateReturnGoodsService(options map[string]interface{}) (service.ReturnGoodsService, error) { | ||
34 | + var transactionContext *pgTransaction.TransactionContext | ||
35 | + if value, ok := options["transactionContext"]; ok { | ||
36 | + transactionContext = value.(*pgTransaction.TransactionContext) | ||
37 | + } | ||
38 | + return domainService.NewReturnGoodsService(transactionContext) | ||
39 | +} |
pkg/domain/service/return_goods.go
0 → 100644
1 | +package domainService | ||
2 | + | ||
3 | +import ( | ||
4 | + "fmt" | ||
5 | + coreDomain "github.com/linmadan/egglib-go/core/domain" | ||
6 | + "gitlab.fjmaimaimai.com/mmm-go-pp/partner01/pkg/domain" | ||
7 | + | ||
8 | + pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | ||
9 | +) | ||
10 | + | ||
11 | +type ReturnGoodsService struct { | ||
12 | + coreDomain.BaseEventPublisher | ||
13 | + transactionContext *pgTransaction.TransactionContext | ||
14 | +} | ||
15 | + | ||
16 | +func (service *ReceivingGoodsService) Return(orderId int64) (*domain.Order, error) { | ||
17 | + return nil, nil | ||
18 | +} | ||
19 | + | ||
20 | +func NewReturnGoodsService(transactionContext *pgTransaction.TransactionContext) (*ReturnGoodsService, error) { | ||
21 | + if transactionContext == nil { | ||
22 | + return nil, fmt.Errorf("transactionContext参数不能为nil") | ||
23 | + } else { | ||
24 | + return &ReturnGoodsService{ | ||
25 | + transactionContext: transactionContext, | ||
26 | + }, nil | ||
27 | + } | ||
28 | +} |
-
请 注册 或 登录 后发表评论