--- lbbs/include/article_view_log.h 2025/06/07 07:59:38 1.1 +++ lbbs/include/article_view_log.h 2025/10/13 00:18:40 1.4 @@ -19,23 +19,26 @@ #include -#define MAX_AID_INC_CNT 100000 +#define MAX_VIEWED_AID_INC_CNT 1000 struct article_view_log_t { + int uid; int32_t *aid_base; int aid_base_cnt; - int32_t aid_inc[MAX_AID_INC_CNT]; + int32_t aid_inc[MAX_VIEWED_AID_INC_CNT]; int aid_inc_cnt; }; typedef struct article_view_log_t ARTICLE_VIEW_LOG; +extern ARTICLE_VIEW_LOG BBS_article_view_log; + // Load baseline view log from DB extern int article_view_log_load(int uid, ARTICLE_VIEW_LOG *p_view_log, int keep_inc); // Clear data -extern int article_view_log_unload(int uid, ARTICLE_VIEW_LOG *p_view_log); +extern int article_view_log_unload(ARTICLE_VIEW_LOG *p_view_log); // Save incremental view log to DB -extern int article_view_log_save_inc(int uid, const ARTICLE_VIEW_LOG *p_view_log); +extern int article_view_log_save_inc(const ARTICLE_VIEW_LOG *p_view_log); // Merge incremental view log to baseline, without DB read / write extern int article_view_log_merge_inc(ARTICLE_VIEW_LOG *p_view_log);