Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -526,6 +526,11 @@ func IsPrinterVendorExist(vendorID int) bool {
|
|||||||
return ok && vendorID >= VendorIDPrinterBegin && vendorID <= VendorIDPrinterEnd
|
return ok && vendorID >= VendorIDPrinterBegin && vendorID <= VendorIDPrinterEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsImVendorExist(vendorID int) bool {
|
||||||
|
_, ok := VendorNames[vendorID]
|
||||||
|
return ok && vendorID >= VendorIDPurchaseBegin && vendorID <= VendorIDPurchaseEnd
|
||||||
|
}
|
||||||
|
|
||||||
func IsOrderLockStatus(status int) bool {
|
func IsOrderLockStatus(status int) bool {
|
||||||
return status == OrderStatusLocked || status == OrderStatusApplyCancel
|
return status == OrderStatusLocked || status == OrderStatusApplyCancel
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,13 @@ func ReadMsgFromClient(vendorID int, elmAppID string, msg interface{}) error {
|
|||||||
UserID: utils.Int2Str(pushContent.OpenUserID),
|
UserID: utils.Int2Str(pushContent.OpenUserID),
|
||||||
LatestMsg: pushContent.MsgContent,
|
LatestMsg: pushContent.MsgContent,
|
||||||
LatestTime: pushContent.Cts,
|
LatestTime: pushContent.Cts,
|
||||||
|
OrderID: "",
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("ReadMsgFromClient pushContent.OrderID=%d", pushContent.OrderID)
|
||||||
|
if pushContent.OrderID != 0 {
|
||||||
|
userList.OrderID = utils.Int2Str(pushContent.OrderID)
|
||||||
|
}
|
||||||
|
globals.SugarLogger.Debugf("ReadMsgFromClient userList=%s", utils.Format4Output(userList, false))
|
||||||
}
|
}
|
||||||
if vendorID == VendorIDELM {
|
if vendorID == VendorIDELM {
|
||||||
var ElmData = ebaiapi.ImMessageSend{}
|
var ElmData = ebaiapi.ImMessageSend{}
|
||||||
@@ -127,8 +133,12 @@ func ReadMsgFromVendor(vendorID int, elmAppID string, msg []byte) error {
|
|||||||
UserID: utils.Int2Str(PushContentReq.OpenUserID),
|
UserID: utils.Int2Str(PushContentReq.OpenUserID),
|
||||||
LatestMsg: PushContentReq.MsgContent,
|
LatestMsg: PushContentReq.MsgContent,
|
||||||
LatestTime: PushContentReq.Cts,
|
LatestTime: PushContentReq.Cts,
|
||||||
|
OrderID: "",
|
||||||
}
|
}
|
||||||
vendorStoreID = PushContentReq.AppPoiCode
|
vendorStoreID = PushContentReq.AppPoiCode
|
||||||
|
if PushContentReq.OrderID != 0 {
|
||||||
|
userList.OrderID = utils.Int2Str(PushContentReq.OrderID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if vendorID == VendorIDELM {
|
if vendorID == VendorIDELM {
|
||||||
var ElmData = ebaiapi.ImMessageSend{}
|
var ElmData = ebaiapi.ImMessageSend{}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ type JXMsg struct {
|
|||||||
type UserMessageList struct {
|
type UserMessageList struct {
|
||||||
VendorID int `json:"vendorID"` //平台品牌 1-美团 3-饿了么
|
VendorID int `json:"vendorID"` //平台品牌 1-美团 3-饿了么
|
||||||
UserID string `json:"userID"` //用户ID
|
UserID string `json:"userID"` //用户ID
|
||||||
|
OrderID string `json:"orderID"` //已下单才有
|
||||||
NewMessageNum int `json:"NewMessageNum"` //新消息数量
|
NewMessageNum int `json:"NewMessageNum"` //新消息数量
|
||||||
LatestMsg string `json:"latestMsg"` //最新一条消息
|
LatestMsg string `json:"latestMsg"` //最新一条消息
|
||||||
LatestTime int `json:"latestTime"` //最新一条消息发送时间
|
LatestTime int `json:"latestTime"` //最新一条消息发送时间
|
||||||
|
|||||||
35
business/partner/partner_im.go
Normal file
35
business/partner/partner_im.go
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
package partner
|
||||||
|
|
||||||
|
//
|
||||||
|
//import (
|
||||||
|
// "fmt"
|
||||||
|
//
|
||||||
|
// "git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
//)
|
||||||
|
//
|
||||||
|
//type IImHandler interface {
|
||||||
|
// GetVendorID() int
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//var (
|
||||||
|
// ImPlatformHandlers map[int]IImHandler
|
||||||
|
//)
|
||||||
|
//
|
||||||
|
//func init() {
|
||||||
|
// ImPlatformHandlers = make(map[int]IImHandler)
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//func RegisterImPlatform(handler IImHandler) {
|
||||||
|
// vendorID := handler.GetVendorID()
|
||||||
|
// if !(model.IsImVendorExist(vendorID)) {
|
||||||
|
// panic(fmt.Sprintf("Im vendor:%d is illegal", vendorID))
|
||||||
|
// }
|
||||||
|
// if _, ok := ImPlatformHandlers[vendorID]; ok {
|
||||||
|
// panic(fmt.Sprintf("Im vendor:%d, already exists", vendorID))
|
||||||
|
// }
|
||||||
|
// ImPlatformHandlers[vendorID] = handler
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//func GetImPlatformFromVendorID(vendorID int) IImHandler {
|
||||||
|
// return ImPlatformHandlers[vendorID]
|
||||||
|
//}
|
||||||
@@ -5,6 +5,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner"
|
"git.rosy.net.cn/jx-callback/business/partner"
|
||||||
@@ -101,8 +103,9 @@ func (c *IMController) SendToVendorV2() {
|
|||||||
// @router /GetPoiIMStatus [get]
|
// @router /GetPoiIMStatus [get]
|
||||||
func (c *IMController) GetPoiIMStatus() {
|
func (c *IMController) GetPoiIMStatus() {
|
||||||
c.callGetPoiIMStatus(func(params *tImGetPoiIMStatusParams) (interface{}, string, error) {
|
c.callGetPoiIMStatus(func(params *tImGetPoiIMStatusParams) (interface{}, string, error) {
|
||||||
//retVal, err := api.MtwmAPI.GetPoiIMStatus(params.AppPoiCode)
|
var api = partner.CurAPIManager.GetAPI(model.VendorIDMTWM, params.VendorOrgCode).(*mtwmapi.API)
|
||||||
retVal, err := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, params.VendorOrgCode).(*mtwmapi.API).GetPoiIMStatus(params.AppPoiCode)
|
globals.SugarLogger.Debugf("GetPoiIMStatus appID=%s", api.GetAppID())
|
||||||
|
retVal, err := api.GetPoiIMStatus(params.AppPoiCode)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user