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, "接收到非法请求") } }