mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 01:25:58 +08:00
fix: fix all lint warning in pkg (#1263)
* fix:fix lint errors in internal * fix:fix lint error in interal/tools * fix: fix lint errros in pkg/statics * fix: fix lint erros in pkg/authverify,pkg/rpcclien * fix: fix lint erros in pkg/common/cmd * fix: fix lint erros in pkg/common/config,convert * fix: fix lint erros in pkg/common/db/cache * fix: fix lint errors in pkg/common/db/controller * fix:fix lint errors in pkg/common/db/relation and pkg/common/db/localcache * fix: fix rest lint errors in pkg/common/db * fix: fix rest lint errors in pkg * fix:set back go.work to use go 1.19
This commit is contained in:
@@ -61,12 +61,14 @@ func (g *GroupGorm) Find(ctx context.Context, groupIDs []string) (groups []*rela
|
||||
|
||||
func (g *GroupGorm) Take(ctx context.Context, groupID string) (group *relation.GroupModel, err error) {
|
||||
group = &relation.GroupModel{}
|
||||
|
||||
return group, utils.Wrap(g.DB.Where("group_id = ?", groupID).Take(group).Error, "")
|
||||
}
|
||||
|
||||
func (g *GroupGorm) Search(ctx context.Context, keyword string, pageNumber, showNumber int32) (total uint32, groups []*relation.GroupModel, err error) {
|
||||
db := g.DB
|
||||
db = db.WithContext(ctx).Where("status!=?", constant.GroupStatusDismissed)
|
||||
|
||||
return ormutil.GormSearch[relation.GroupModel](db, []string{"name"}, keyword, pageNumber, showNumber)
|
||||
}
|
||||
|
||||
@@ -82,6 +84,7 @@ func (g *GroupGorm) CountTotal(ctx context.Context, before *time.Time) (count in
|
||||
if err := db.Count(&count).Error; err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
@@ -98,6 +101,7 @@ func (g *GroupGorm) CountRangeEverydayTotal(ctx context.Context, start time.Time
|
||||
for _, r := range res {
|
||||
v[r.Date.Format("2006-01-02")] = r.Count
|
||||
}
|
||||
|
||||
return v, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user