🎨 逻辑优化,启用AI和水群统计改为数据库配置(未全部完成)
This commit is contained in:
23
service/friend.go
Normal file
23
service/friend.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"go-wechat/client"
|
||||
"go-wechat/entity"
|
||||
)
|
||||
|
||||
// GetAllEnableAI
|
||||
// @description: 取出所有启用了AI的好友或群组
|
||||
// @return []entity.Friend
|
||||
func GetAllEnableAI() (records []entity.Friend, err error) {
|
||||
err = client.MySQL.Where("enable_ai = ?", 1).Find(&records).Error
|
||||
return
|
||||
}
|
||||
|
||||
// GetAllEnableChatRank
|
||||
// @description: 取出所有启用了聊天排行榜的群组
|
||||
// @return records
|
||||
// @return err
|
||||
func GetAllEnableChatRank() (records []entity.Friend, err error) {
|
||||
err = client.MySQL.Where("enable_chat_rank = ?", 1).Where("wxid LIKE '%@chatroom'").Find(&records).Error
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user