- big refactor.
This commit is contained in:
26
legacy/mtps/controller/order.go
Normal file
26
legacy/mtps/controller/order.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/jx-callback/legacy/freshfood"
|
||||
)
|
||||
|
||||
type OrderController struct {
|
||||
}
|
||||
|
||||
func Error2Response(err error) *mtpsapi.CallbackResponse {
|
||||
if err != nil {
|
||||
return &mtpsapi.CallbackResponse{
|
||||
Code: -1,
|
||||
}
|
||||
}
|
||||
return mtpsapi.SuccessResponse
|
||||
}
|
||||
|
||||
func (c *OrderController) OrderStatusChanged(order *mtpsapi.CallbackOrderMsg) *mtpsapi.CallbackResponse {
|
||||
return Error2Response(freshfood.FreshFoodAPI.MtpsOrderStatusChanged(order))
|
||||
}
|
||||
|
||||
func (c *OrderController) OrderException(order *mtpsapi.CallbackOrderExceptionMsg) *mtpsapi.CallbackResponse {
|
||||
return Error2Response(freshfood.FreshFoodAPI.MtpsOrderException(order))
|
||||
}
|
||||
Reference in New Issue
Block a user