- first edition of long pulling
This commit is contained in:
@@ -2,8 +2,11 @@ package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/configindb"
|
||||
"git.rosy.net.cn/jx-callback/business/msghub"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
@@ -149,3 +152,41 @@ func (c *CmsController) GetProductInfoByBarCode() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 得到服务器消息通知
|
||||
// @Description 得到服务器消息通知
|
||||
// @Param token header string true "认证token"
|
||||
// @Param storeID query int true "京西门店ID"
|
||||
// @Param lastOrderTime query string true "最后订单时间"
|
||||
// @Param lastOrderSeqID query string true "最后订单流水ID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetNewOrderMsg [get]
|
||||
func (c *CmsController) GetNewOrderMsg() {
|
||||
c.callGetNewOrderMsg(func(params *tCmsGetNewOrderMsgParams) (retVal interface{}, errCode string, err error) {
|
||||
timeList, err := jxutils.BatchStr2Time(params.LastOrderTime)
|
||||
if err == nil {
|
||||
lastOrderSeqID := utils.Str2Int64WithDefault(params.LastOrderSeqID, 0)
|
||||
retVal, err = msghub.GetMsg(params.Ctx, params.StoreID, timeList[0], lastOrderSeqID, nil)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 发送新订单消息(测试用)
|
||||
// @Description 发送新订单消息(测试用)
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrderID formData string true "订单ID"
|
||||
// @Param vendorID formData int true "订单厂商ID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /FakeNewOrder [post]
|
||||
func (c *CmsController) FakeNewOrder() {
|
||||
c.callFakeNewOrder(func(params *tCmsFakeNewOrderParams) (retVal interface{}, errCode string, err error) {
|
||||
order, err := orderman.FixedOrderManager.LoadOrder(params.VendorOrderID, params.VendorID)
|
||||
if err == nil {
|
||||
msghub.OnNewOrder(order)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user