🎨 逻辑优化,启用AI和水群统计改为数据库配置(未全部完成)

This commit is contained in:
李寻欢
2023-11-28 16:09:36 +08:00
parent 3b4862d5bc
commit e3bb115560
10 changed files with 108 additions and 94 deletions

23
service/friend.go Normal file
View 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
}