You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
491 B
27 lines
491 B
package handle
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
func HandleTencent(w http.ResponseWriter, r *http.Request) {
|
|
if r.URL.RequestURI() == "/favicon.ico" {
|
|
return
|
|
}
|
|
switch r.Method {
|
|
case "GET":
|
|
// 微信企业号验证
|
|
log.Println("接收到验证请求")
|
|
handleVerify(w, r)
|
|
case "POST":
|
|
// 微信企业号接收到消息
|
|
log.Println("接收到消息")
|
|
handleMessage(w, r)
|
|
default:
|
|
log.Println("接收到非法请求")
|
|
fmt.Fprintln(w, "接收到非法请求")
|
|
}
|
|
}
|