This commit is contained in:
richboo111
2023-07-12 16:42:26 +08:00
parent d6fe34efdd
commit d6cd059e31

View File

@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
"net/http"
"strings"
)
@@ -27,6 +28,7 @@ func (a *API) SendMsgByUinApp(parma map[string]interface{}) error {
data, _ := json.Marshal(parma)
fmt.Println(string(data))
result, err := a.AccessAPI(BaseUrl+a.appId, PushMsgByCid, http.MethodPost, parma)
globals.SugarLogger.Debugf("SendMsgByUinApp result=%s", utils.Format4Output(result, false))
if err != nil && !strings.Contains(err.Error(), "success") {
return err
}
@@ -35,6 +37,7 @@ func (a *API) SendMsgByUinApp(parma map[string]interface{}) error {
if err := utils.Map2StructByJson(result, &sendMsgRes, false); err != nil {
return err
}
globals.SugarLogger.Debugf("SendMsgByUinApp sendMsgRes=%s", utils.Format4Output(sendMsgRes, false))
if sendMsgRes.Code != 0 {
return errors.New(sendMsgRes.Msg)
}