From d0b0cc78ab039ff9db20a2c15c75a253c4064156 Mon Sep 17 00:00:00 2001 From: lihui Date: Fri, 3 Jan 2025 13:42:28 +0800 Subject: [PATCH] feat: adjust apache header and recheck code --- notification-wecom/README.md | 2 ++ notification-wecom/README_CN.md | 4 +++- notification-wecom/go.mod | 5 +++-- notification-wecom/go.sum | 4 ++++ notification-wecom/notification_wecom.go | 20 ++++++++++++++++++++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/notification-wecom/README.md b/notification-wecom/README.md index e7a3dcae..53b3b344 100644 --- a/notification-wecom/README.md +++ b/notification-wecom/README.md @@ -1,5 +1,7 @@ # Wecom Notification Plugin +[English](./README.md) | [中文](./README_CN.md) + ## How to use To use the notification-wecom plugin with your application, install it using the following command: diff --git a/notification-wecom/README_CN.md b/notification-wecom/README_CN.md index ca3e3627..926ba357 100644 --- a/notification-wecom/README_CN.md +++ b/notification-wecom/README_CN.md @@ -1,5 +1,7 @@ # 企业微信通知插件 +[English](./README.md) | [中文](./README_CN.md) + ## 使用指南 要使用通知企业微信通知插件,请使用以下命令进行安装: @@ -30,4 +32,4 @@ https://developer.work.weixin.qq.com/document/path/91770 ## 致谢 -感谢钉钉通知插件的开发,本插件很多代码参考壶或者直接沿用了钉钉通知插件的代码。 \ No newline at end of file +感谢钉钉通知插件的开发,本插件很多代码参考或者直接沿用了钉钉通知插件的代码。 \ No newline at end of file diff --git a/notification-wecom/go.mod b/notification-wecom/go.mod index 24655890..1e191c73 100644 --- a/notification-wecom/go.mod +++ b/notification-wecom/go.mod @@ -1,10 +1,12 @@ module github.com/apache/incubator-answer-plugins/notification-wecom -go 1.23.4 +go 1.22.0 require ( github.com/apache/incubator-answer v1.4.1 github.com/apache/incubator-answer-plugins/util v1.0.2 + github.com/go-resty/resty/v2 v2.16.2 + github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f ) require ( @@ -32,7 +34,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f // indirect github.com/segmentfault/pacman/contrib/i18n v0.0.0-20230822083413-c0075a2d401f // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect diff --git a/notification-wecom/go.sum b/notification-wecom/go.sum index b08ce5b9..1bd7f183 100644 --- a/notification-wecom/go.sum +++ b/notification-wecom/go.sum @@ -36,6 +36,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-resty/resty/v2 v2.16.2 h1:CpRqTjIzq/rweXUt9+GxzzQdlkqMdt8Lm/fuK/CAbAg= +github.com/go-resty/resty/v2 v2.16.2/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -126,6 +128,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= diff --git a/notification-wecom/notification_wecom.go b/notification-wecom/notification_wecom.go index f76be4ae..9b01256c 100644 --- a/notification-wecom/notification_wecom.go +++ b/notification-wecom/notification_wecom.go @@ -1,8 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package wecom import ( "embed" "github.com/apache/incubator-answer/plugin" + "github.com/go-resty/resty/v2" "strings" wecomI18n "github.com/apache/incubator-answer-plugins/notification-wecom/i18n"