|
@@ -130,7 +130,7 @@ func GetWxAccessTokenByXzs() (accessTokenStr string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取小助手的微信Token
|
|
|
+// 获取小助手的微信Token
|
|
|
func GetWxTokenByXzs() (item *WxAccessToken, err error) {
|
|
|
getUrl := "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + utils.WxPublicIdXzs + "&secret=" + utils.WxPublicSecretXzs
|
|
|
result, err := http.Get(getUrl)
|
|
@@ -194,17 +194,26 @@ func WxUsersGet() (openIdStr string) {
|
|
|
}
|
|
|
|
|
|
type WxCheckContentJson struct {
|
|
|
- AccessToken string `json:"access_token"`
|
|
|
- ExpiresIn int `json:"expires_in"`
|
|
|
- RefreshToken string `json:"refresh_token"`
|
|
|
- Openid string `json:"openid"`
|
|
|
- Unionid string `json:"unionid"`
|
|
|
- Scope string `json:"scope"`
|
|
|
- Errcode int `json:"errcode"`
|
|
|
- Errmsg string `json:"errmsg"`
|
|
|
+ AccessToken string `json:"access_token"`
|
|
|
+ ExpiresIn int `json:"expires_in"`
|
|
|
+ RefreshToken string `json:"refresh_token"`
|
|
|
+ Openid string `json:"openid"`
|
|
|
+ Unionid string `json:"unionid"`
|
|
|
+ Scope string `json:"scope"`
|
|
|
+ Errcode int `json:"errcode"`
|
|
|
+ Errmsg string `json:"errmsg"`
|
|
|
+ Detail WxCheckContentJsonDetail `json:"det"`
|
|
|
+}
|
|
|
+
|
|
|
+type WxCheckContentJsonDetail struct {
|
|
|
+ Label int
|
|
|
+ KeyWord string
|
|
|
+ Prob int
|
|
|
+ Strategy string
|
|
|
+ Errcode int
|
|
|
}
|
|
|
|
|
|
-func WxCheckContent(content string) (errCode int){
|
|
|
+func WxCheckContent(content string) (detail WxCheckContentJsonDetail) {
|
|
|
accessToken, err := GetWxAccessToken()
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("GetWxAccessToken Err:%s", err.Error())
|
|
@@ -225,5 +234,5 @@ func WxCheckContent(content string) (errCode int){
|
|
|
return
|
|
|
}
|
|
|
fmt.Println(result)
|
|
|
- return item.Errcode
|
|
|
+ return item.Detail
|
|
|
}
|