- mtps added.
- refactor.
This commit is contained in:
26
business/mtps/controller/order.go
Normal file
26
business/mtps/controller/order.go
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user