瀏覽代碼

update

master
DengBiao 2 年之前
父節點
當前提交
39b1e58f7d
共有 1 個文件被更改,包括 17 次插入20 次删除
  1. +17
    -20
      internal/business/domain/user/service/auth.go

+ 17
- 20
internal/business/domain/user/service/auth.go 查看文件

@@ -2,15 +2,12 @@ package service

import (
"context"
"errors"
"gim/internal/business/comm/db"
"gim/internal/business/domain/user/model"
"gim/internal/business/domain/user/repo"
"gim/pkg/gerrors"
"gim/pkg/pb"
"gim/pkg/rpc"
"gim/pkg/util"
"strconv"
"time"
)

@@ -61,23 +58,23 @@ func (*authService) SignIn(ctx context.Context, phoneNumber, code string, master
return false, 0, "", 0, err
}

if pushAlia != "" {
userPushForJg, err := db.DbUserPushForJg.UserPushForJgGetOne(strconv.FormatInt(user.Id, 10), masterId)
if err != nil && err.Error() != "record not found" {
return false, 0, "", 0, err
}
if userPushForJg == nil {
save := db.DbUserPushForJg.UserPushForJgInsert(user.Id, masterId, pushAlia)
if !save {
return false, 0, "", 0, errors.New("插入user_push_for_jg记录失败")
}
} else {
update := db.DbUserPushForJg.UserPushForJgUpdate(user.Id, masterId, pushAlia)
if !update {
return false, 0, "", 0, errors.New("修改user_push_for_jg记录失败")
}
}
}
//if pushAlia != "" {
// userPushForJg, err := db.DbUserPushForJg.UserPushForJgGetOne(strconv.FormatInt(user.Id, 10), masterId)
// if err != nil && err.Error() != "record not found" {
// return false, 0, "", 0, err
// }
// if userPushForJg == nil {
// save := db.DbUserPushForJg.UserPushForJgInsert(user.Id, masterId, pushAlia)
// if !save {
// return false, 0, "", 0, errors.New("插入user_push_for_jg记录失败")
// }
// } else {
// update := db.DbUserPushForJg.UserPushForJgUpdate(user.Id, masterId, pushAlia)
// if !update {
// return false, 0, "", 0, errors.New("修改user_push_for_jg记录失败")
// }
// }
//}
return isNew, user.Id, token, masterId, nil
}



Loading…
取消
儲存