正在显示
4 个修改的文件
包含
9 行增加
和
4 行删除
@@ -15,7 +15,7 @@ import ( | @@ -15,7 +15,7 @@ import ( | ||
15 | type OrderService struct { | 15 | type OrderService struct { |
16 | } | 16 | } |
17 | 17 | ||
18 | -// 取消订单服务 | 18 | +// 取消订单 |
19 | func (orderService *OrderService) CancelOrder(cancelCommand *command.CancelOrderCommand) (interface{}, error) { | 19 | func (orderService *OrderService) CancelOrder(cancelCommand *command.CancelOrderCommand) (interface{}, error) { |
20 | if err := cancelCommand.ValidateCommand(); err != nil { | 20 | if err := cancelCommand.ValidateCommand(); err != nil { |
21 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 21 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
@@ -342,22 +342,27 @@ func (order *Order) Identify() interface{} { | @@ -342,22 +342,27 @@ func (order *Order) Identify() interface{} { | ||
342 | return order.OrderId | 342 | return order.OrderId |
343 | } | 343 | } |
344 | 344 | ||
345 | +// 更新订单 | ||
345 | func (order *Order) Update(data map[string]interface{}) error { | 346 | func (order *Order) Update(data map[string]interface{}) error { |
346 | return order.CurrentStatus.Update(order, data) | 347 | return order.CurrentStatus.Update(order, data) |
347 | } | 348 | } |
348 | 349 | ||
350 | +// 发货 | ||
349 | func (order *Order) Checkout() error { | 351 | func (order *Order) Checkout() error { |
350 | return order.CurrentStatus.Checkout(order) | 352 | return order.CurrentStatus.Checkout(order) |
351 | } | 353 | } |
352 | 354 | ||
355 | +// 退货 | ||
353 | func (order *Order) Return() error { | 356 | func (order *Order) Return() error { |
354 | return order.CurrentStatus.Return(order) | 357 | return order.CurrentStatus.Return(order) |
355 | } | 358 | } |
356 | 359 | ||
360 | +// 收货 | ||
357 | func (order *Order) Receive() error { | 361 | func (order *Order) Receive() error { |
358 | return order.CurrentStatus.Receive(order) | 362 | return order.CurrentStatus.Receive(order) |
359 | } | 363 | } |
360 | 364 | ||
365 | +// 取消订单 | ||
361 | func (order *Order) Cancel() error { | 366 | func (order *Order) Cancel() error { |
362 | return order.CurrentStatus.Cancel(order) | 367 | return order.CurrentStatus.Cancel(order) |
363 | } | 368 | } |
@@ -13,8 +13,8 @@ type ReturnGoodsService struct { | @@ -13,8 +13,8 @@ type ReturnGoodsService struct { | ||
13 | transactionContext *pgTransaction.TransactionContext | 13 | transactionContext *pgTransaction.TransactionContext |
14 | } | 14 | } |
15 | 15 | ||
16 | -func (service *ReceivingGoodsService) Return(orderId int64) (*domain.Order, error) { | ||
17 | - return nil, nil | 16 | +func (service *ReturnGoodsService) Return(orderId int64) (*domain.Order, error) { |
17 | + panic("implement me") | ||
18 | } | 18 | } |
19 | 19 | ||
20 | func NewReturnGoodsService(transactionContext *pgTransaction.TransactionContext) (*ReturnGoodsService, error) { | 20 | func NewReturnGoodsService(transactionContext *pgTransaction.TransactionContext) (*ReturnGoodsService, error) { |
-
请 注册 或 登录 后发表评论