|
|
@ -8,6 +8,7 @@ import ( |
|
|
"strconv" |
|
|
"strconv" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/api/wechatapp/sendmessage" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/global" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/global" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/model/approvalprocess" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/model/approvalprocess" |
|
|
@ -1022,7 +1023,8 @@ func (s *ShiyanApi) SendButtonMessageAll(c *gin.Context) { |
|
|
//模板卡片消息
|
|
|
//模板卡片消息
|
|
|
//文本通知型
|
|
|
//文本通知型
|
|
|
func (s *ShiyanApi) SendTextMessageAll(c *gin.Context) { |
|
|
func (s *ShiyanApi) SendTextMessageAll(c *gin.Context) { |
|
|
var sendTextMsg commonus.TextNotice |
|
|
// var sendTextMsg commonus.TextNotice
|
|
|
|
|
|
var sendTextMsg sendmessage.TextNoticeTemplateSimplify |
|
|
sendTextMsg.Touser = "KaiXinGuo" |
|
|
sendTextMsg.Touser = "KaiXinGuo" |
|
|
sendTextMsg.MsgType = "template_card" |
|
|
sendTextMsg.MsgType = "template_card" |
|
|
appId, _ := strconv.ParseInt(global.GVA_CONFIG.WorkWechatSchool.AgentId, 10, 64) |
|
|
appId, _ := strconv.ParseInt(global.GVA_CONFIG.WorkWechatSchool.AgentId, 10, 64) |
|
|
@ -1037,16 +1039,16 @@ func (s *ShiyanApi) SendTextMessageAll(c *gin.Context) { |
|
|
sendTextMsg.TemplateCard.Source.Desc = "知行学院" |
|
|
sendTextMsg.TemplateCard.Source.Desc = "知行学院" |
|
|
sendTextMsg.TemplateCard.Source.DescColor = 2 |
|
|
sendTextMsg.TemplateCard.Source.DescColor = 2 |
|
|
|
|
|
|
|
|
sendTextMsg.TemplateCard.ActionMenu.Desc = "是否继续关注" |
|
|
// sendTextMsg.TemplateCard.ActionMenu.Desc = "是否继续关注"
|
|
|
var actionList []commonus.ActionListStruct |
|
|
// var actionList []commonus.ActionListStruct
|
|
|
var actionCont commonus.ActionListStruct |
|
|
// var actionCont commonus.ActionListStruct
|
|
|
actionCont.Text = "接受推送" |
|
|
// actionCont.Text = "接受推送"
|
|
|
actionCont.Key = "A" |
|
|
// actionCont.Key = "A"
|
|
|
actionList = append(actionList, actionCont) |
|
|
// actionList = append(actionList, actionCont)
|
|
|
actionCont.Text = "不再推" |
|
|
// actionCont.Text = "不再推"
|
|
|
actionCont.Key = "b" |
|
|
// actionCont.Key = "b"
|
|
|
actionList = append(actionList, actionCont) |
|
|
// actionList = append(actionList, actionCont)
|
|
|
sendTextMsg.TemplateCard.ActionMenu.ActionList = actionList |
|
|
// sendTextMsg.TemplateCard.ActionMenu.ActionList = actionList
|
|
|
|
|
|
|
|
|
//任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成,最长128字节 (必填)
|
|
|
//任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成,最长128字节 (必填)
|
|
|
taskId := commonus.GetFileNumberEs() |
|
|
taskId := commonus.GetFileNumberEs() |
|
|
@ -1056,49 +1058,47 @@ func (s *ShiyanApi) SendTextMessageAll(c *gin.Context) { |
|
|
sendTextMsg.TemplateCard.MainTitle.Desc = "请你认真查询审批内容!" //标题辅助信息,建议不超过44个字,(支持id转译)
|
|
|
sendTextMsg.TemplateCard.MainTitle.Desc = "请你认真查询审批内容!" //标题辅助信息,建议不超过44个字,(支持id转译)
|
|
|
|
|
|
|
|
|
//引用文献样式
|
|
|
//引用文献样式
|
|
|
sendTextMsg.TemplateCard.QuoteArea.Type = 1 |
|
|
// sendTextMsg.TemplateCard.QuoteArea.Type = 1
|
|
|
sendTextMsg.TemplateCard.QuoteArea.Url = "http://www.hxgk.group" |
|
|
// sendTextMsg.TemplateCard.QuoteArea.Url = "http://www.hxgk.group"
|
|
|
sendTextMsg.TemplateCard.QuoteArea.Title = "用车编号" |
|
|
// sendTextMsg.TemplateCard.QuoteArea.Title = "用车编号"
|
|
|
sendTextMsg.TemplateCard.QuoteArea.QuoteText = "用车理由:\n工作需要 \n目的地:宁阳" |
|
|
// sendTextMsg.TemplateCard.QuoteArea.QuoteText = "用车理由:\n工作需要 \n目的地:宁阳"
|
|
|
|
|
|
|
|
|
sendTextMsg.TemplateCard.EmphasisContent.Title = "100" |
|
|
// sendTextMsg.TemplateCard.EmphasisContent.Title = "100"
|
|
|
sendTextMsg.TemplateCard.EmphasisContent.DescStruct.Desc = "核心数据" |
|
|
// sendTextMsg.TemplateCard.EmphasisContent.DescStruct.Desc = "核心数据"
|
|
|
|
|
|
|
|
|
//二级普通文本,建议不超过160个字(非必填)
|
|
|
//二级普通文本,建议不超过160个字(非必填)
|
|
|
sendTextMsg.TemplateCard.SubTitleText = "二级普通文本,下载企业微信还能抢红包!" |
|
|
// sendTextMsg.TemplateCard.SubTitleText = "二级普通文本,下载企业微信还能抢红包!"
|
|
|
|
|
|
|
|
|
//二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6(非必填)
|
|
|
//二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6(非必填)
|
|
|
var htalConListStrMap []commonus.HorizontalContentListStruct |
|
|
// var htalConListStrMap []sendmessage.HorizontalContentListType
|
|
|
var htalConListStrCon commonus.HorizontalContentListStruct |
|
|
// var htalConListStrCon sendmessage.HorizontalContentListType
|
|
|
htalConListStrCon.Type = 3 |
|
|
// htalConListStrCon.Type = 3
|
|
|
htalConListStrCon.KeyName = "申请人" |
|
|
// htalConListStrCon.KeyName = "申请人"
|
|
|
htalConListStrCon.Value = "秦东" |
|
|
// htalConListStrCon.Value = "秦东"
|
|
|
htalConListStrCon.UserId = "KaiXinGuo" |
|
|
// htalConListStrCon.UserId = "KaiXinGuo"
|
|
|
htalConListStrMap = append(htalConListStrMap, htalConListStrCon) |
|
|
// htalConListStrMap = append(htalConListStrMap, htalConListStrCon)
|
|
|
htalConListStrCon.Type = 1 |
|
|
// htalConListStrCon.Type = 1
|
|
|
htalConListStrCon.KeyName = "企业微信官网" |
|
|
// htalConListStrCon.KeyName = "企业微信官网"
|
|
|
htalConListStrCon.Value = "点击访问" |
|
|
// htalConListStrCon.Value = "点击访问"
|
|
|
htalConListStrCon.Url = "tel:15069130853" |
|
|
// htalConListStrCon.Url = "tel:15069130853"
|
|
|
htalConListStrMap = append(htalConListStrMap, htalConListStrCon) |
|
|
// htalConListStrMap = append(htalConListStrMap, htalConListStrCon)
|
|
|
htalConListStrCon.Type = 3 |
|
|
// htalConListStrCon.Type = 3
|
|
|
htalConListStrCon.KeyName = "乘车人" |
|
|
// htalConListStrCon.KeyName = "乘车人"
|
|
|
htalConListStrCon.Value = "秦东" |
|
|
// htalConListStrCon.Value = "秦东"
|
|
|
htalConListStrCon.UserId = "KaiXinGuo" |
|
|
// htalConListStrCon.UserId = "KaiXinGuo"
|
|
|
htalConListStrMap = append(htalConListStrMap, htalConListStrCon) |
|
|
// htalConListStrMap = append(htalConListStrMap, htalConListStrCon)
|
|
|
sendTextMsg.TemplateCard.HorizontalContentList = htalConListStrMap |
|
|
// sendTextMsg.TemplateCard.HorizontalContentList = htalConListStrMap
|
|
|
|
|
|
|
|
|
var jumpListStruct commonus.JumpListStruct |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jumpListStruct sendmessage.JumpListType |
|
|
jumpListStruct.Type = 1 |
|
|
jumpListStruct.Type = 1 |
|
|
jumpListStruct.Title = "知行学院官网" |
|
|
jumpListStruct.Title = "查看详情" |
|
|
jumpListStruct.Url = "http://www.hxgk.group" |
|
|
jumpListStruct.Url = "http://www.hxgk.group" |
|
|
|
|
|
|
|
|
sendTextMsg.TemplateCard.JumpList = append(sendTextMsg.TemplateCard.JumpList, jumpListStruct) |
|
|
sendTextMsg.TemplateCard.JumpList = append(sendTextMsg.TemplateCard.JumpList, jumpListStruct) |
|
|
|
|
|
|
|
|
sendTextMsg.TemplateCard.CardAction.Type = 1 |
|
|
sendTextMsg.TemplateCard.CardAction.Type = 1 |
|
|
sendTextMsg.TemplateCard.CardAction.Url = "http://admin.hxgk.group" |
|
|
sendTextMsg.TemplateCard.CardAction.Url = "http://admin.hxgk.group" |
|
|
|
|
|
|
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendTextTemplateCard() |
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendMessage("school") |
|
|
outData := commonus.MapOut() |
|
|
outData := commonus.MapOut() |
|
|
outData["callbakcMsg"] = string(callbakcMsg) |
|
|
outData["callbakcMsg"] = string(callbakcMsg) |
|
|
outData["isTrueCall"] = isTrueCall |
|
|
outData["isTrueCall"] = isTrueCall |
|
|
@ -1108,7 +1108,9 @@ func (s *ShiyanApi) SendTextMessageAll(c *gin.Context) { |
|
|
|
|
|
|
|
|
//图文展示型
|
|
|
//图文展示型
|
|
|
func (s *ShiyanApi) SendImageMessageAll(c *gin.Context) { |
|
|
func (s *ShiyanApi) SendImageMessageAll(c *gin.Context) { |
|
|
var sendTextMsg commonus.ImageTextTemplate |
|
|
// var sendTextMsg commonus.ImageTextTemplate
|
|
|
|
|
|
|
|
|
|
|
|
var sendTextMsg sendmessage.ImgTextTemplate |
|
|
|
|
|
|
|
|
sendTextMsg.Touser = "KaiXinGuo" |
|
|
sendTextMsg.Touser = "KaiXinGuo" |
|
|
sendTextMsg.MsgType = "template_card" |
|
|
sendTextMsg.MsgType = "template_card" |
|
|
@ -1125,8 +1127,8 @@ func (s *ShiyanApi) SendImageMessageAll(c *gin.Context) { |
|
|
sendTextMsg.TemplateCard.Source.DescColor = 2 |
|
|
sendTextMsg.TemplateCard.Source.DescColor = 2 |
|
|
|
|
|
|
|
|
sendTextMsg.TemplateCard.ActionMenu.Desc = "是否继续关注" |
|
|
sendTextMsg.TemplateCard.ActionMenu.Desc = "是否继续关注" |
|
|
var actionList []commonus.ActionListStruct |
|
|
var actionList []sendmessage.ActionListType |
|
|
var actionCont commonus.ActionListStruct |
|
|
var actionCont sendmessage.ActionListType |
|
|
actionCont.Text = "接受推送" |
|
|
actionCont.Text = "接受推送" |
|
|
actionCont.Key = "A" |
|
|
actionCont.Key = "A" |
|
|
actionList = append(actionList, actionCont) |
|
|
actionList = append(actionList, actionCont) |
|
|
@ -1157,7 +1159,7 @@ func (s *ShiyanApi) SendImageMessageAll(c *gin.Context) { |
|
|
sendTextMsg.TemplateCard.CardImage.Url = "https://docu.hxgk.group/images/2022_01/3f7a1120a559e9bee3991b85eb34d103.png" |
|
|
sendTextMsg.TemplateCard.CardImage.Url = "https://docu.hxgk.group/images/2022_01/3f7a1120a559e9bee3991b85eb34d103.png" |
|
|
sendTextMsg.TemplateCard.CardImage.AspectRatio = 1.3 |
|
|
sendTextMsg.TemplateCard.CardImage.AspectRatio = 1.3 |
|
|
|
|
|
|
|
|
var verCont commonus.VerticalContentListStr |
|
|
var verCont sendmessage.EmphasisContentType |
|
|
verCont.Title = "惊喜红包等你来拿" |
|
|
verCont.Title = "惊喜红包等你来拿" |
|
|
verCont.Desc = "下载企业微信还能抢红包!" |
|
|
verCont.Desc = "下载企业微信还能抢红包!" |
|
|
sendTextMsg.TemplateCard.VerticalContentList = append(sendTextMsg.TemplateCard.VerticalContentList, verCont) |
|
|
sendTextMsg.TemplateCard.VerticalContentList = append(sendTextMsg.TemplateCard.VerticalContentList, verCont) |
|
|
@ -1165,7 +1167,7 @@ func (s *ShiyanApi) SendImageMessageAll(c *gin.Context) { |
|
|
verCont.Desc = "====>下载企业微信还能抢红包!" |
|
|
verCont.Desc = "====>下载企业微信还能抢红包!" |
|
|
sendTextMsg.TemplateCard.VerticalContentList = append(sendTextMsg.TemplateCard.VerticalContentList, verCont) |
|
|
sendTextMsg.TemplateCard.VerticalContentList = append(sendTextMsg.TemplateCard.VerticalContentList, verCont) |
|
|
|
|
|
|
|
|
var htalConListStrCon commonus.HorizontalContentListStruct |
|
|
var htalConListStrCon sendmessage.HorizontalContentListType |
|
|
htalConListStrCon.Type = 3 |
|
|
htalConListStrCon.Type = 3 |
|
|
htalConListStrCon.KeyName = "申请人" |
|
|
htalConListStrCon.KeyName = "申请人" |
|
|
htalConListStrCon.Value = "秦东" |
|
|
htalConListStrCon.Value = "秦东" |
|
|
@ -1182,7 +1184,7 @@ func (s *ShiyanApi) SendImageMessageAll(c *gin.Context) { |
|
|
htalConListStrCon.UserId = "KaiXinGuo" |
|
|
htalConListStrCon.UserId = "KaiXinGuo" |
|
|
sendTextMsg.TemplateCard.HorizontalContentList = append(sendTextMsg.TemplateCard.HorizontalContentList, htalConListStrCon) |
|
|
sendTextMsg.TemplateCard.HorizontalContentList = append(sendTextMsg.TemplateCard.HorizontalContentList, htalConListStrCon) |
|
|
|
|
|
|
|
|
var jumpListStruct commonus.JumpListStruct |
|
|
var jumpListStruct sendmessage.JumpListType |
|
|
|
|
|
|
|
|
jumpListStruct.Type = 1 |
|
|
jumpListStruct.Type = 1 |
|
|
jumpListStruct.Title = "知行学院官网" |
|
|
jumpListStruct.Title = "知行学院官网" |
|
|
@ -1199,7 +1201,7 @@ func (s *ShiyanApi) SendImageMessageAll(c *gin.Context) { |
|
|
sendTextMsg.TemplateCard.CardAction.Type = 1 |
|
|
sendTextMsg.TemplateCard.CardAction.Type = 1 |
|
|
sendTextMsg.TemplateCard.CardAction.Url = "http://admin.hxgk.group" |
|
|
sendTextMsg.TemplateCard.CardAction.Url = "http://admin.hxgk.group" |
|
|
|
|
|
|
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendImageTemplateCard() |
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendMessage("school") |
|
|
outData := commonus.MapOut() |
|
|
outData := commonus.MapOut() |
|
|
outData["callbakcMsg"] = string(callbakcMsg) |
|
|
outData["callbakcMsg"] = string(callbakcMsg) |
|
|
outData["isTrueCall"] = isTrueCall |
|
|
outData["isTrueCall"] = isTrueCall |
|
|
@ -1207,3 +1209,25 @@ func (s *ShiyanApi) SendImageMessageAll(c *gin.Context) { |
|
|
outData["sendTextMsg"] = sendTextMsg |
|
|
outData["sendTextMsg"] = sendTextMsg |
|
|
response.Result(0, outData, "查询成功", c) |
|
|
response.Result(0, outData, "查询成功", c) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取审批模板详情
|
|
|
|
|
|
func (s *ShiyanApi) GetEatilTemplate(c *gin.Context) { |
|
|
|
|
|
var requestData sendmessage.TemplatedEtailType |
|
|
|
|
|
err := c.ShouldBindJSON(&requestData) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
response.Result(101, err, "参数错误!请重新提交!", c) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
// msgbtye, isTrue, msg := requestData.GetTemplatedeTail("school")
|
|
|
|
|
|
|
|
|
|
|
|
msgbtyees, isTruees, msges := sendmessage.JsSdkSignAlgorithm("school") |
|
|
|
|
|
|
|
|
|
|
|
outData := commonus.MapOut() |
|
|
|
|
|
// outData["msgbtye"] = msgbtye
|
|
|
|
|
|
// outData["isTrue"] = isTrue
|
|
|
|
|
|
// outData["msg"] = msg
|
|
|
|
|
|
outData["msgbtyees"] = msgbtyees |
|
|
|
|
|
outData["isTruees"] = isTruees |
|
|
|
|
|
outData["msges"] = msges |
|
|
|
|
|
response.Result(0, outData, "查询成功", c) |
|
|
|
|
|
} |
|
|
|