sfps callback
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/im"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
@@ -78,12 +80,17 @@ func (c *IMController) SetImMsgRead() {
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /SendToVendor [post]
|
||||
//func (c *IMController) SendToVendor() {
|
||||
// c.callSendToVendor(func(params *tImSendToVendorParams) (retVal interface{}, errCode string, err error) {
|
||||
// var sendData im.SendData
|
||||
// if err = json.Unmarshal([]byte(params.SendData), &sendData); err == nil {
|
||||
// im.SendToVendor(sendData)
|
||||
// }
|
||||
// return nil, "", err
|
||||
// })
|
||||
//}
|
||||
func (c *IMController) SendToVendor() {
|
||||
c.callSendToVendor(func(params *tImSendToVendorParams) (retVal interface{}, errCode string, err error) {
|
||||
var sendData im.SendData
|
||||
b := bytes.NewBufferString(params.SendData)
|
||||
decoder := json.NewDecoder(b)
|
||||
_ = decoder.Decode(&sendData)
|
||||
fmt.Println(sendData)
|
||||
|
||||
if dataStr, err := json.Marshal(sendData); err == nil {
|
||||
im.SendToVendor(dataStr)
|
||||
}
|
||||
return nil, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user