Refactor code

pull/131/head
wenxu12345 3 years ago
parent 1a69fdf1e0
commit bc0c5d4fcb

@ -2,6 +2,7 @@ package im_mysql_model
import ( import (
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
"Open_IM/pkg/utils"
"time" "time"
) )
@ -39,9 +40,8 @@ func RemoveBlackList(ownerUserID, blockUserID string) error {
if err != nil { if err != nil {
return err return err
} }
black := db.Black{OwnerUserID: ownerUserID, BlockUserID: blockUserID}
err = dbConn.Table("blacks").Where("owner_user_id=? and block_user_id=?", ownerUserID, blockUserID).Delete(&db.Black{}).Error return utils.Wrap(dbConn.Delete(&black).Error, "RemoveBlackList failed")
return err
} }
func GetBlackListByUserID(ownerUserID string) ([]db.Black, error) { func GetBlackListByUserID(ownerUserID string) ([]db.Black, error) {

Loading…
Cancel
Save