Skip to content

Commit 588d3b7

Browse files
committed
🎨 修lint
1 parent eed80d0 commit 588d3b7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugin/chatcount/model.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func initialize(dbpath string) *chattimedb {
6262

6363
// Close 关闭
6464
func (ctdb *chattimedb) Close() error {
65-
db := (*gorm.DB)(ctdb.db)
65+
db := ctdb.db
6666
return db.Close()
6767
}
6868

@@ -86,7 +86,7 @@ func (chatTime) TableName() string {
8686
func (ctdb *chattimedb) updateChatTime(gid, uid int64) (remindTime int64, remindFlag bool) {
8787
ctdb.chatmu.Lock()
8888
defer ctdb.chatmu.Unlock()
89-
db := (*gorm.DB)(ctdb.db)
89+
db := ctdb.db
9090
now := time.Now()
9191
keyword := fmt.Sprintf("%v_%v", gid, uid)
9292
ts, ok := ctdb.userTimestampMap.Load(keyword)
@@ -139,7 +139,7 @@ func (ctdb *chattimedb) updateChatTime(gid, uid int64) (remindTime int64, remind
139139
func (ctdb *chattimedb) getChatTime(gid, uid int64) (todayTime, todayMessage, totalTime, totalMessage int64) {
140140
ctdb.chatmu.Lock()
141141
defer ctdb.chatmu.Unlock()
142-
db := (*gorm.DB)(ctdb.db)
142+
db := ctdb.db
143143
st := chatTime{}
144144
db.Model(&st).Where("group_id = ? and user_id = ?", gid, uid).First(&st)
145145
keyword := fmt.Sprintf("%v_%v", gid, uid)
@@ -201,6 +201,7 @@ func (l *Leveler) Level(t int) int {
201201
return 0
202202
}
203203

204+
// ByTotalTimeDescMessageDesc chatTime排序数组
204205
type ByTotalTimeDescMessageDesc []chatTime
205206

206207
// Len 实现 sort.Interface

0 commit comments

Comments
 (0)