|
@@ -13,7 +13,7 @@ import (
|
|
"time"
|
|
"time"
|
|
)
|
|
)
|
|
|
|
|
|
-//访谈申请
|
|
|
|
|
|
+// 访谈申请
|
|
func SendInterviewApplyTemplateMsg(realName, companyName, mobile, articleTitle string, itemOpenid *models.OpenIdList) (err error) {
|
|
func SendInterviewApplyTemplateMsg(realName, companyName, mobile, articleTitle string, itemOpenid *models.OpenIdList) (err error) {
|
|
var msg string
|
|
var msg string
|
|
defer func() {
|
|
defer func() {
|
|
@@ -60,7 +60,7 @@ func SendInterviewApplyTemplateMsg(realName, companyName, mobile, articleTitle s
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-//访谈申请取消
|
|
|
|
|
|
+// 访谈申请取消
|
|
func SendInterviewApplyCancelTemplateMsg(realName, companyName, mobile, articleTitle string, itemOpenid *models.OpenIdList) (err error) {
|
|
func SendInterviewApplyCancelTemplateMsg(realName, companyName, mobile, articleTitle string, itemOpenid *models.OpenIdList) (err error) {
|
|
var msg string
|
|
var msg string
|
|
defer func() {
|
|
defer func() {
|
|
@@ -102,7 +102,7 @@ func SendInterviewApplyCancelTemplateMsg(realName, companyName, mobile, articleT
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-//权限申请
|
|
|
|
|
|
+// 权限申请
|
|
func SendPermissionApplyTemplateMsg(realName, companyName, mobile, applyMethod string, itemOpenid *models.OpenIdList) (err error) {
|
|
func SendPermissionApplyTemplateMsg(realName, companyName, mobile, applyMethod string, itemOpenid *models.OpenIdList) (err error) {
|
|
var msg string
|
|
var msg string
|
|
defer func() {
|
|
defer func() {
|
|
@@ -116,28 +116,15 @@ func SendPermissionApplyTemplateMsg(realName, companyName, mobile, applyMethod s
|
|
}()
|
|
}()
|
|
|
|
|
|
var accessToken string
|
|
var accessToken string
|
|
- if utils.RunMode == "release" {
|
|
|
|
- accessToken, err = models.GetWxAccessTokenByXzs()
|
|
|
|
- if err != nil {
|
|
|
|
- msg = "GetWxAccessToken Err:" + err.Error()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if accessToken == "" {
|
|
|
|
- msg = "accessToken is empty"
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- accessToken, err = models.GetWxAccessToken()
|
|
|
|
- if err != nil {
|
|
|
|
- msg = "GetWxAccessToken Err:" + err.Error()
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if accessToken == "" {
|
|
|
|
- msg = "accessToken is empty"
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ accessToken, err = models.GetWxAccessTokenByXzs()
|
|
|
|
+ if err != nil {
|
|
|
|
+ msg = "GetWxAccessToken Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if accessToken == "" {
|
|
|
|
+ msg = "accessToken is empty"
|
|
|
|
+ return
|
|
}
|
|
}
|
|
-
|
|
|
|
sendUrl := "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + accessToken
|
|
sendUrl := "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + accessToken
|
|
|
|
|
|
sendMap := make(map[string]interface{})
|
|
sendMap := make(map[string]interface{})
|
|
@@ -244,7 +231,7 @@ type SendWxTemplate struct {
|
|
OpenIdArr []string `description:"消息接收者openid"`
|
|
OpenIdArr []string `description:"消息接收者openid"`
|
|
}
|
|
}
|
|
|
|
|
|
-//推送模板消息
|
|
|
|
|
|
+// 推送模板消息
|
|
func PublicSendTemplateMsg(sendInfo *SendWxTemplate) (err error) {
|
|
func PublicSendTemplateMsg(sendInfo *SendWxTemplate) (err error) {
|
|
postData, err := json.Marshal(sendInfo)
|
|
postData, err := json.Marshal(sendInfo)
|
|
if err != nil {
|
|
if err != nil {
|