- mtps added.

- refactor.
This commit is contained in:
gazebo
2018-06-18 12:03:53 +08:00
parent a0a97c6fc2
commit 03c7efbe1e
14 changed files with 302 additions and 178 deletions

View File

@@ -0,0 +1,26 @@
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))
}