增加预警

This commit is contained in:
李子铭 2025-03-11 18:06:10 +08:00
parent dc0ab16dca
commit 3925ba5bb0
3 changed files with 7 additions and 7 deletions

View File

@ -223,14 +223,14 @@ func (v *Cmb) alarm(ctx context.Context, order *bo.OrderBo, errMsg string) error
func (v *Cmb) alarmText(_ context.Context, order *bo.OrderBo, errMsg string) string { func (v *Cmb) alarmText(_ context.Context, order *bo.OrderBo, errMsg string) string {
remarks := fmt.Sprintf("订单号:%s商品编号:%s,错误原因:%s", order.OrderNo, order.ProductNo, errMsg) remarks := fmt.Sprintf("订单号:%s商品编号:%s,原因:%s", order.OrderNo, order.ProductNo, errMsg)
msg := "# <font color='green'>" + msg := "# <font color='green'>" +
"<h1>立减金发放平台报警通知</h1>" + "<h1>立减金发放平台报警通知</h1>" +
"</font> \n" + "</font> \n" +
"<font color='black'>" + "<font color='black'>" +
"不好了,订单发放发生异常了,错误内容" + "不好了,订单发放发生异常了" +
"[<font color='red'>%s</font>]@相关人员。" + "[<font color='red'>%s</font>]请尽快处理@相关人员。" +
"</font>" "</font>"
return fmt.Sprintf(msg, remarks) return fmt.Sprintf(msg, remarks)

View File

@ -119,7 +119,7 @@ func (c *TalkClient) SendLinkMessage(title, text, messageURL, picURL string, atM
func (c *TalkClient) SendMarkdownMessage(title, text string, atMobiles []string, isAtAll bool) error { func (c *TalkClient) SendMarkdownMessage(title, text string, atMobiles []string, isAtAll bool) error {
var atStr string var atStr string
for _, mobile := range atMobiles { for _, mobile := range atMobiles {
atStr += fmt.Sprintf("<font color='#006400'>@%s</font>", mobile) atStr += fmt.Sprintf("<font color='#003BFF'>@%s</font>", mobile)
} }
text += atStr text += atStr

View File

@ -65,14 +65,14 @@ func TestSendMarkdownMessage(t *testing.T) {
func alarmText(errMsg string) string { func alarmText(errMsg string) string {
remarks := fmt.Sprintf("订单号:%s商品编号:%s,错误原因:%s", "123456", "001", errMsg) remarks := fmt.Sprintf("订单号:%s商品编号:%s,原因:%s", "123456", "001", errMsg)
msg := "# <font color='green'>" + msg := "# <font color='green'>" +
"<h1>立减金发放平台报警通知</h1>" + "<h1>立减金发放平台报警通知</h1>" +
"</font> \n" + "</font> \n" +
"<font color='black'>" + "<font color='black'>" +
"不好了,订单发放发生异常了,错误内容" + "不好了,订单发放发生异常了" +
"[<font color='red'>%s</font>]@相关人员。" + "[<font color='red'>%s</font>]请尽快处理@相关人员。" +
"</font>" "</font>"
return fmt.Sprintf(msg, remarks) return fmt.Sprintf(msg, remarks)