作者 tangxvhui

调整 手机推送异常

... ... @@ -117,7 +117,7 @@ spec:
- name: BUSINESS_ADMIN_SERVICE_HOST
value: "https://suplus-business-admin-test.fjmaimaimai.com"
- name: MMM_OPEN_API_SERVICE_HOST
value: "http://mmm-open-api-dev.fjmaimaimai.com"
value: "http://mmm-open-api-test.fjmaimaimai.com"
volumes:
- name: accesslogs
emptyDir: {}
... ...
... ... @@ -157,7 +157,7 @@ func messageTaskRecordAnomaly() ([]*domain.MessagePersonal, error) {
payloadStr, _ := json.Marshal(payload)
newMessage := domain.MessagePersonal{
Id: 0,
Types: domain.MessageTypesTaskStageApp,
Types: domain.MessageTypesTaskRecordApp,
TargetUserId: val2.Id,
ReadFlag: domain.MessageIsRead,
Title: "",
... ... @@ -234,7 +234,7 @@ func appMessageSend() error {
appMessage = append(appMessage, messageList2...)
openApi := serviceGateway.NewHttplibMmmOpenApiServiceGateway()
for _, val := range appMessage {
_, err := openApi.PushInfo(1, constant.APP_MESSAGE_KEY, []int64{int64(val.TargetUserId)}, val.Title, val.Content)
_, err := openApi.PushInfo(0, constant.APP_MESSAGE_KEY, []int64{int64(val.TargetUserId)}, val.Title, val.Content)
if err != nil {
log.Logger.Error("发送远端openApi关于里程碑异常的消息通知:" + err.Error())
}
... ...
... ... @@ -17,7 +17,7 @@ var UPLOAD_ZIP_PATH = "./uploads/zip"
// Env 判断当前环境变量
var Env = "dev"
var MMM_OPEN_API_SERVICE_HOST = "http://mmm-open-api-dev.fjmaimaimai.com"
var MMM_OPEN_API_SERVICE_HOST = "http://mmm-open-api-test.fjmaimaimai.com"
// 绩效管理平台ID
var PLATFORM_ADMIN_ID = 28
... ...
... ... @@ -19,11 +19,12 @@ type MessagePersonal struct {
type MessageTypes string
const (
MessageTypesOther MessageTypes = "other" //综合自评开启时,消息通知
MessageTypesTaskStage MessageTypes = "task_stage" //任务里程碑未按时完成
MessageTypesTaskRecord MessageTypes = "task_record" //任务每日反馈异常
MessageTypesTaskModify MessageTypes = "task_modify" //修改任务
MessageTypesTaskStageApp MessageTypes = "task_stage-app" //任务里程碑未按时完成
MessageTypesOther MessageTypes = "other" //综合自评开启时,消息通知
MessageTypesTaskStage MessageTypes = "task_stage" //任务里程碑未按时完成
MessageTypesTaskRecord MessageTypes = "task_record" //任务每日反馈异常
MessageTypesTaskModify MessageTypes = "task_modify" //修改任务
MessageTypesTaskStageApp MessageTypes = "task_stage-app" //任务里程碑未按时完成
MessageTypesTaskRecordApp MessageTypes = "task_record-app" //任务每日反馈异常
)
type MessageReadFlag string
... ...
... ... @@ -3,14 +3,14 @@ package serviceGateway
import (
"crypto/tls"
"encoding/json"
"github.com/beego/beego/v2/client/httplib"
"github.com/linmadan/egglib-go/utils/tool_funs"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
"io/ioutil"
"net/http"
"reflect"
"strings"
"time"
"github.com/beego/beego/v2/client/httplib"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
)
type httpLibBaseServiceGateway struct {
... ... @@ -101,7 +101,7 @@ func (client *httpLibBaseServiceGateway) ToJson(result interface{}) error {
}
err = json.Unmarshal(mBytes, result)
//增加返回数据日志
log.Logger.Debug(response.Request.Method+" "+response.Request.URL.String()+"----response----", tool_funs.SimpleStructToMap(result))
log.Logger.Debug(response.Request.Method + " " + response.Request.URL.String() + "----response----" + string(mBytes))
return err
}
... ...
package serviceGateway
import (
"strings"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/constant"
)
... ... @@ -31,7 +29,8 @@ type MessageExt struct {
// PushInfo 个推
func (serviceGateway *HttplibMmmOpenApiServiceGateway) PushInfo(msgType int, project string, uids []int64, title string, content string) (map[string]interface{}, error) {
url := strings.Join([]string{serviceGateway.baseURL, "v1", "push", "pushInfo"}, "/")
// url := strings.Join([]string{"v1", "push", "pushInfo"}, "/")
url := "/v1/push/pushInfo"
serviceGateway.CreateRequest("post", url)
options := &MessageOptions{
MmmType: msgType,
... ...
package serviceGateway
import "testing"
func TestPushInfo(t *testing.T) {
//测试消息推送
c := NewHttplibMmmOpenApiServiceGateway()
resp, err := c.PushInfo(0, "mmm.ability.performance", []int64{3422174102828544}, "ceshi推送一个消息233", "消息内容xxxx332")
if err != nil {
t.Error(err)
}
t.Logf("%v", resp)
}
... ...