Files
jx-callback/business/mtps/controller/order.go
2018-06-19 18:42:30 +08:00

27 lines
707 B
Go

package controller
import (
"git.rosy.net.cn/baseapi/platform/mtpsapi"
"git.rosy.net.cn/jx-callback/globals"
)
type OrderController struct {
}
func Error2Response(err error) *mtpsapi.MtpsCallbackResponse {
if err != nil {
return &mtpsapi.MtpsCallbackResponse{
Code: -1,
}
}
return mtpsapi.SuccessResponse
}
func (c *OrderController) OrderStatusChanged(order *mtpsapi.MtpsCallbackOrderMsg) *mtpsapi.MtpsCallbackResponse {
return Error2Response(globals.FreshFoodAPI.MtpsOrderStatusChanged(order))
}
func (c *OrderController) OrderException(order *mtpsapi.MtpsCallbackOrderExceptionMsg) *mtpsapi.MtpsCallbackResponse {
return Error2Response(globals.FreshFoodAPI.MtpsOrderException(order))
}