Przeglądaj źródła

Merge branch 'bzq/dev' of eta_mini/eta_mini_api into master

鲍自强 9 miesięcy temu
rodzic
commit
11aea64c33
1 zmienionych plików z 12 dodań i 11 usunięć
  1. 12 11
      controllers/wechat.go

+ 12 - 11
controllers/wechat.go

@@ -19,6 +19,16 @@ type WechatController struct {
 	BaseCommonController
 }
 
+type Notify struct {
+	ToUserName   string `xml:"ToUserName"`
+	FromUserName string `xml:"FromUserName"`
+	CreateTime   int    `xml:"CreateTime"`
+	MsgType      string `xml:"MsgType"`
+	Event        string `xml:"Event"`
+	EventKey     string `xml:"EventKey"`
+	Content      string `xml:"Content"`
+}
+
 // @Title 微信获取签名接口
 // @Description 微信获取签名接口
 // @Param   Url   query   string  true       "url地址"
@@ -28,15 +38,6 @@ func (this *WechatController) Notify() {
 	echostr := this.GetString("echostr")
 	method := this.Ctx.Input.Method()
 
-	type Notify struct {
-		ToUserName   string `xml:"ToUserName"`
-		FromUserName string `xml:"FromUserName"`
-		CreateTime   int    `xml:"CreateTime"`
-		MsgType      string `xml:"MsgType"`
-		Event        string `xml:"Event"`
-		EventKey     string `xml:"EventKey"`
-		Content      string `xml:"Content"`
-	}
 	if method == "POST" {
 		body := this.Ctx.Input.RequestBody
 		utils.FileLog.Info("wechat notify:" + string(body))
@@ -171,9 +172,9 @@ func subscribe(openId string) {
 		return
 	}
 	if user != nil {
-		user.IsRegistered = true
+		user.IsSubscribed = true
 		user.ModifyTime = time.Now()
-		err = user.Update([]string{"is_registered", "modify_time"})
+		err = user.Update([]string{"is_subscribed", "modify_time"})
 		if err != nil {
 			fmt.Println("关注后,修改绑定用户状态异常,ERR:", err)
 			return