3 Star 2 Fork 1

fotomxq/weeekj_core

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
focus_check.go 770 Bytes
Copy Edit Raw Blame History
fotomxq authored 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

Search