|
@@ -20,9 +20,14 @@ func NewServer(appID, appSecret, token, encodingAESKey string) *Server {
|
|
|
}
|
|
|
|
|
|
// Echo notify echo GET
|
|
|
-func (wc Server) Echo(s FormSignature) (data string, err error) {
|
|
|
- if ok := makeSignature(wc.Token, s.Signature, s.TimeStamp, s.Nonce); ok {
|
|
|
+func (ws Server) Echo(s FormSignature) (data string, err error) {
|
|
|
+ if ok := makeSignature(ws.Token, s.Signature, s.TimeStamp, s.Nonce); ok {
|
|
|
data = s.Echostr
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// Validate 验证请求合法性
|
|
|
+func (ws Server) Validate(signature, timestamp, nonce string) bool {
|
|
|
+ return makeSignature(ws.Token, signature, timestamp, nonce)
|
|
|
+}
|