27 lines
709 B
Go
27 lines
709 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))
|
|
}
|