fix facebook账号删除
This commit is contained in:
parent
2512994ee8
commit
d8752b962b
|
@ -92,3 +92,10 @@ func (a *AccountLog) Save(log *modelpkg.AccountLog) error {
|
||||||
_, err = a.InsertOne(context.Background(), log)
|
_, err = a.InsertOne(context.Background(), log)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *AccountLog) RemoveByFaceBookId(id string) error {
|
||||||
|
_, err := a.DeleteMany(context.Background(), func(cols *internal.AccountLogColumns) interface{} {
|
||||||
|
return bson.M{cols.FaceBookId: id}
|
||||||
|
})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
|
@ -26,6 +26,21 @@ func (a *AccountLogSvc) GetByFaceBookId(req *string, res *model.AccountLog) erro
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *AccountLogSvc) RemoveByFaceBookId(req *string, res *bool) error {
|
||||||
|
c, err := dao.GetAccountLog(mongox.Global)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("GetAccountLog error: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = c.RemoveByFaceBookId(*req)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("RemoveByFaceBookId error: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*res = true
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
var AccountLogSvcInst = new(AccountLogSvc)
|
var AccountLogSvcInst = new(AccountLogSvc)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -45,3 +45,22 @@ func GetByFaceBookId(faceBookId string) (*AccountLog, error) {
|
||||||
|
|
||||||
return accountLog, nil
|
return accountLog, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RemoveByFaceBookId(faceBookId string) error {
|
||||||
|
if rpcCli == nil {
|
||||||
|
return errors.New("rpc client is nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
if faceBookId == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
ret := false
|
||||||
|
err := rpcCli.CallWithTimeout("AccountLogSvc.RemoveByFaceBookId", &faceBookId, &ret, time.Second*30)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("RemoveByFaceBookId err:%v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
@ -2446,6 +2446,10 @@ func init() {
|
||||||
}
|
}
|
||||||
msg.Platform = fb.Platform
|
msg.Platform = fb.Platform
|
||||||
msg.Snid = fb.SnId
|
msg.Snid = fb.SnId
|
||||||
|
err = model.RemoveByFaceBookId(msg.GetFaceBookId())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||||
|
|
Loading…
Reference in New Issue