delete user from user_thirds, too

This commit is contained in:
Tao Chen
2024-10-30 15:59:33 +08:00
parent bc92ffc106
commit 3041fb82d9
2 changed files with 23 additions and 1 deletions

View File

@@ -441,6 +441,12 @@ func (os *OauthService) UnBindThird(thirdType string, userid uint) error {
return global.DB.Where("user_id = ? and third_type = ?", userid, thirdType).Delete(&model.UserThird{}).Error
}
// DeleteUserByUserId: When user is deleted, delete all third party bindings
func (os *OauthService) DeleteUserByUserId(userid uint) error {
return global.DB.Where("user_id = ?", userid).Delete(&model.UserThird{}).Error
}
// InfoById 根据id取用户信息
func (os *OauthService) InfoById(id uint) *model.Oauth {
u := &model.Oauth{}