|
@@ -6,8 +6,10 @@ import (
|
|
|
"hongze/hongze_yb/controller/response"
|
|
|
"hongze/hongze_yb/global"
|
|
|
"hongze/hongze_yb/logic"
|
|
|
+ "hongze/hongze_yb/models/request"
|
|
|
"hongze/hongze_yb/models/tables/yb_suncode_pars"
|
|
|
"hongze/hongze_yb/services"
|
|
|
+ "hongze/hongze_yb/services/alarm_msg"
|
|
|
"hongze/hongze_yb/utils"
|
|
|
"os"
|
|
|
"path"
|
|
@@ -159,3 +161,24 @@ func GetVarietyTagTree(c *gin.Context) {
|
|
|
}
|
|
|
response.OkData("获取成功", list, c)
|
|
|
}
|
|
|
+
|
|
|
+// WechatWarning 小程序前端预警提示
|
|
|
+// @Tags 公共模块
|
|
|
+// @Description 小程序前端预警提示
|
|
|
+// @Param content query string true "预警信息"
|
|
|
+// @Success 200 {string} string "操作成功"
|
|
|
+// @failure 400 {string} string "操作失败"
|
|
|
+// @Router /public/wechat_warning [post]
|
|
|
+func WechatWarning(c *gin.Context) {
|
|
|
+ var req request.WechatWarningReq
|
|
|
+ if err := c.Bind(&req); err != nil {
|
|
|
+ response.Fail("参数有误", c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if req.Content != "" {
|
|
|
+ tips := fmt.Sprintf("研报小程序前端报错预警-ErrMsg: %s", req.Content)
|
|
|
+ global.LOG.Warning(tips)
|
|
|
+ go alarm_msg.SendAlarmMsg(tips, 2)
|
|
|
+ }
|
|
|
+ response.Ok("操作成功", c)
|
|
|
+}
|