浏览代码

状态更新

lichangdong 2 天之前
父节点
当前提交
f25c1b4ca6

+ 4 - 4
internal/service/MessageHandlers/find_contact_task_result_notice.go

@@ -91,16 +91,16 @@ func (f *FindContactTaskResultNoticeHandler) Handle(ctx context.Context, msg *we
 
 	if message.ErrMsg != nil {
 		if *message.ErrMsg == "用户不存在" {
-			update = update.SetIsCanAdd(4)
+			update = update.SetIsCanAdd(5)
 		} else {
-			update = update.SetIsCanAdd(3)
+			update = update.SetIsCanAdd(4)
 		}
 	}
 	if message.Success {
 		if message.IsFriend {
-			update = update.SetIsCanAdd(6)
+			update = update.SetIsCanAdd(7)
 		} else {
-			update = update.SetIsCanAdd(1)
+			update = update.SetIsCanAdd(1) //todo 后续这里会发送 添加请求
 		}
 	}
 	if _, err := update.Save(ctx); err != nil {

+ 4 - 4
internal/service/MessageHandlers/task_result_notice.go

@@ -63,16 +63,16 @@ func (f *TaskResultNoticeHandler) Handle(ctx context.Context, msg *wechat_ws.Msg
 
 	if common.Code == "InternalError" {
 		if common.ErrMsg == "timeout" {
-			update.SetIsCanAdd(3) // 重置添加为不能添加好友
-		} else if common.ErrMsg == "该用户不存在" || common.ErrMsg == "用户不存在" {
 			update.SetIsCanAdd(4) // 重置添加为不能添加好友
+		} else if common.ErrMsg == "该用户不存在" || common.ErrMsg == "用户不存在" {
+			update.SetIsCanAdd(5) // 重置添加为不能添加好友
 		} else {
-			update.SetIsCanAdd(3)
+			update.SetIsCanAdd(4)
 		} // 重置添加为不能添加好友
 	}
 
 	if common.Success {
-		update.SetIsCanAdd(2) // 表示任务成功
+		update.SetIsCanAdd(3) // 表示任务成功
 	}
 
 	if _, err := update.Save(ctx); err != nil {

+ 1 - 0
internal/service/addfriend/add_wechat_friend_log.go

@@ -94,6 +94,7 @@ func (l *AddWechatFriendService) AddNewFriend(wechatId, content, message string,
 		SetAddRequest(result).
 		SetTaskID(taskId.Int64()).
 		AddTaskCount(1).
+		SetIsCanAdd(2).
 		SetUpdatedAt(time.Now().Unix())
 	_, err = update.Save(l.ctx)
 	logx.Infof("更新 AddWechatFriendLog-field-add-result成功: %v", result)