3 Star 2 Fork 1

fotomxq/weeekj_core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
focus_check.go 770 Bytes
一键复制 编辑 原始数据 按行查看 历史
fotomxq 提交于 2025-02-05 18:52 +08:00 . 修改项目路径;
package UserFocus2
import (
Router2SystemConfig "gitee.com/fotomxq/weeekj_core/v5/router2/system_config"
)
// CheckFocus 检查是否关注了数据
func CheckFocus(userID int64, mark string, system string, bindID int64) bool {
if err := checkMark(mark); err != nil {
return false
}
var data FieldsFocus
cacheMark := getFocusUserCacheMark(userID, mark, system, bindID)
if id, err := Router2SystemConfig.MainCache.GetInt64(cacheMark); err == nil && id > 0 {
return true
}
_ = Router2SystemConfig.MainDB.Get(&data, "SELECT id FROM user_focus2 WHERE user_id = $1 AND mark = $2 AND system = $3 AND bind_id = $4", userID, mark, system, bindID)
if data.ID < 1 {
return false
}
Router2SystemConfig.MainCache.SetInt64(cacheMark, data.ID, 1800)
return true
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fotomxq/weeekj_core.git
git@gitee.com:fotomxq/weeekj_core.git
fotomxq
weeekj_core
weeekj_core
v5.3.83

搜索帮助