- refactor as baseapi.

This commit is contained in:
gazebo
2018-06-22 22:38:30 +08:00
parent 50790b3686
commit 65593521b9
7 changed files with 82 additions and 82 deletions

View File

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