pg_order_service.go
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package domainService
import (
coreDomain "github.com/linmadan/egglib-go/core/domain"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain/event"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
)
type OrderServices struct {
coreDomain.BaseEventPublisher
transactionContext *transaction.TransactionContext
}
//UpdateOrderGoodData 修改订单中的货品数据
func (serve OrderServices) UpdateOrderGoodData(orderId int64, goodId int64, adminId int64, updateData map[string]string) error {
var err error
//TODO数据更新操作
//事件发布
modifyEvent := event.OrderGoodModify{
OrderId: orderId,
GoodId: goodId,
AdminId: adminId,
UpdateGoodData: updateData,
}
if err = serve.Publish(modifyEvent); err != nil {
return err
}
return nil
}
//PayOrderGoodBonus 支付订单中货品的分红
func (serve OrderServices) PayOrderGoodBonus(orderId int64, goodId int64, adminId int64) error {
var err error
//TODO
payEvent := event.PayOrderGoodBonus{
OrderId: orderId,
GoodId: goodId,
AdminId: adminId,
}
if err = serve.Publish(payEvent); err != nil {
return err
}
return nil
}