renzheng 9 سال پیش
والد
کامیت
bb4a256ca5
2فایلهای تغییر یافته به همراه2 افزوده شده و 54 حذف شده
  1. 0 4
      weixin/src/config.json
  2. 2 50
      weixin/src/qfw/weixin/rpc/rpc.go

+ 0 - 4
weixin/src/config.json

@@ -28,10 +28,6 @@
 		"identifytplid":"sKn4r0or615ETYC-aI5OACPO_Q4-B8GYmgWoqcDghN4",
 		"offLinemsgtplid":"ExIeyFfoDNVJXhRDq09JbsjH_zbEJCB6gw6rxcV7atw",
 		"msgnotifytplid":"fcke7PqteAtclzHV3ScdiePH48vxaH6M5aJF0O_7by8",
-<<<<<<< HEAD
 		"managernotirytplid":"dplgu5Q644vzPdqcPXY7RqgItS3eXACmU1XDl27CvTA"
-=======
-		"managernotifytplid":"DIwMrPQToOhGfa6ZAQCCrqquzbLKajiXsKY0K_lQtWQ"
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
 	}
 }

+ 2 - 50
weixin/src/qfw/weixin/rpc/rpc.go

@@ -25,22 +25,14 @@ const (
 	//msgnotify_tplid = "b7iuAMiTCIolnPhTdueKBVYThEMf2D-Bh2M_9v3J-68" //消息提醒
 )
 
-<<<<<<< HEAD
 var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managernotiry_tplid string
-=======
-var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managerNotify_tplid string
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
 
 //读取配置
 func InitTpl() {
 	identify_tplid = wf.SysConfig.MessageTpl["identifytplid"]
 	offLineMsg_tplid = wf.SysConfig.MessageTpl["offLinemsgtplid"]
 	msgnotify_tplid = wf.SysConfig.MessageTpl["msgnotifytplid"]
-<<<<<<< HEAD
 	managernotiry_tplid = wf.SysConfig.MessageTpl["managernotirytplid"]
-=======
-	managerNotify_tplid = wf.SysConfig.MessageTpl["managernotifytplid"]
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
 }
 
 func (wxrpc *WeiXinRpc) SendPushTplMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
@@ -126,8 +118,8 @@ func (wxrpc *WeiXinRpc) SendIdentifyTplMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcR
 	return
 }
 
+//发送管理员通知
 func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
-	log.Println("tpl::", identify_tplid)
 	//构造自定义消息文本
 	var msg struct {
 		ToUser   string `json:"touser"`
@@ -150,7 +142,7 @@ func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.Rp
 		} `json:"data"`
 	}
 	msg.ToUser = param.Openid
-	msg.TplId = managerNotify_tplid
+	msg.TplId = managernotiry_tplid
 	msg.Url = param.Url
 	msg.Data.Title.Value = param.Title
 	msg.Data.Detail.Value = param.Detail
@@ -206,46 +198,6 @@ func (wxrpc *WeiXinRpc) SendOffLineMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResul
 	return
 }
 
-//发送管理员通知
-func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
-	//构造自定义消息文本
-	var msg struct {
-		ToUser   string `json:"touser"`
-		TplId    string `json:"template_id"`
-		Url      string `json:"url"`
-		Topcolor string `json:"topcolor"`
-		Data     struct {
-			Title struct {
-				Value string `json:"value"`
-			} `json:"first"`
-			Detail struct {
-				Value string `json:"value"`
-			} `json:"keyword1"`
-			Result struct {
-				Value string `json:"value"`
-			} `json:"keyword2"`
-			Remark struct {
-				Value string `json:"value"`
-			} `json:"remark"`
-		} `json:"data"`
-	}
-	msg.ToUser = param.Openid
-	msg.TplId = managernotiry_tplid
-	msg.Url = param.Url
-	msg.Data.Title.Value = param.Title
-	msg.Data.Detail.Value = param.Detail
-	msg.Data.Result.Value = param.Result
-	msg.Data.Remark.Value = param.Remark
-
-	err = wxrpc.wx.PostTextCustom(tplapi_url, &msg)
-	if err != nil {
-		log.Println(err.Error())
-	} else {
-		log.Println("send tplmsg success!")
-	}
-	return
-}
-
 func StartWeixinRpc(wx *weixin.Weixin) {
 	wrpc := &WeiXinRpc{wx: wx}
 	//在此可以注册多个Rpc服务接口