- big refactor.

This commit is contained in:
gazebo
2018-07-05 12:21:25 +08:00
parent c43ec48837
commit bed727d3e5
21 changed files with 140 additions and 115 deletions

View 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))
}