style: add format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim)
2023-07-03 16:29:22 +08:00
parent 187ee9a375
commit 166ddb1e34
170 changed files with 4816 additions and 1279 deletions
+8 -2
View File
@@ -4,10 +4,11 @@ import (
"context"
"time"
"gorm.io/gorm"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
"gorm.io/gorm"
)
type ObjectInfoGorm struct {
@@ -45,5 +46,10 @@ func (o *ObjectInfoGorm) Take(ctx context.Context, name string) (info *relation.
}
func (o *ObjectInfoGorm) DeleteExpiration(ctx context.Context, expiration time.Time) (err error) {
return utils.Wrap1(o.DB.WithContext(ctx).Where("expiration_time IS NOT NULL AND expiration_time <= ?", expiration).Delete(&relation.ObjectInfoModel{}).Error)
return utils.Wrap1(
o.DB.WithContext(ctx).
Where("expiration_time IS NOT NULL AND expiration_time <= ?", expiration).
Delete(&relation.ObjectInfoModel{}).
Error,
)
}