%%-----------------------------------------------------------------------------
%% @Module  :       hi_point.hrl
%% @Author  :       Fwx
%% @Created :       2018-3-6
%% @Description:    嗨点(狂欢活动)
%%-----------------------------------------------------------------------------
-record(hi_points, {
    key = undefined,        %% {mod_id, sub_id}
    count = 0               %% 参与次数
}).

-record(role_info, {
    sum_points = 0,         %% 总狂欢值(各模块总狂欢值)
    extra_points = 0,       %% 使用物品额外获得的狂欢值
    points_list = [],       %% 各模块对应狂欢值列表 [#hi_points{}]
    reward_status = [],     %% [{GradeId, Status}]  0:不可领 1；可领 2：已领
    utime = 0               %% 更新时间
}).

-record(act_state, {
    act_maps = #{}          %% #{{type,sub_type} => #{role_id => #role_info{} } }
}).

-record(base_hi_point, {
    suit_id = 0,            %% 嗨点系列(一个系列对应多条配置)
    mod_id = 0,             %% 模块id
    sub_id = 0,             %% 子id  (模块id和子id确定唯一功能)
    name = "",              %% 功能名称
    one_points = 0,         %% 单次可得狂欢值
    max_count = 0,          %% 次数上限
    order_id = 0,           %% 排序Id
    jump_id = 0,            %% 跳转id
    about = ""              %% 备注
}).


-define(SELECT_HI_DATA,
    <<"SELECT points,extra_points,task_info,reward_info,utime FROM player_hi_point WHERE role_id=~p AND type=~p AND sub_type=~p">>).

-define(SAVE_HI_DATA,
    <<"REPLACE INTO player_hi_point(role_id,type,sub_type,points,extra_points,task_info,reward_info,utime) VALUES(~p,~p,~p,~p,~p,'~ts','~ts',~p) ">>).

-define(CLEAN_HI_DATA,
    <<"DELETE FROM player_hi_point WHERE type=~p AND sub_type=~p">>).