%% ------------------------
%% @doc     :合成机头文件
%% author   :hh
%% time     :20/12/22
%% ------------------------


%% 常规抽奖(不按配方)
-record (base_printer_draw, {
    id = 0,                 %% 唯一id
    item_suit = 0,          %% 主题道具id
    exchange_item = 0       %% 物品id
    }).

%% 配方合成配置
-record (base_printer_draw_list, {
    id = 0,                 %% 唯一id
    exchange = [],          %% 兑换消耗 
    pic = 0,                %% 物品图标
    item_suit = 0,          %% 主题道具id
    name = "",              %% 物品名
    pool = 0                %% 奖池id
    }).

%% 配方合成奖池配置
-record (base_printer_draw_pool, {
    id = 0,                 %% 唯一id
    pool = 0,               %% 奖池id
    pool_type = 0,          %% 主题套件
    opday = 0,              %% 开服天数
    goods = [],             %% 奖池奖励
    weight = 0              %% 权重
    }).


-record (printer_draw_state, {
    act_info = [],          %% 开放的活动列表 
    draw_list = [],         %% 首次解锁的配方列表  [{sub_type, [{role_id, id, time},...]}]
    cd_list = []            %% 冷却检查       [{sub_type, [{提问时间,第一个回答时间}]}]
    }).

% -define (FORMULA,        1).    %% 配方
% -define (NORMAL_FORM,    2).    %% 常规

-define (FORMULA_LOCK,   1).    %% 未解锁
-define (FORMULA_UNLOCK, 2).    %% 已解锁

-define (SQL_SELECT_PRINT_DRAW, 
    <<"SELECT sub_type, role_id, id, time FROM printer_draw">>).

-define (SQL_REPLACE_PRINT_DRAW,
    <<"REPLACE INTO printer_draw SET sub_type = ~p, role_id = ~p, id = ~p, time = ~p">>).

-define (SQL_DELETE_PRINT_DRAW_WITH_TYPE,
    <<"DELETE FROM printer_draw WHERE sub_type in ~s">>).

-define (SQL_DELETE_PRINT_DRAW,
    <<"DELETE FROM printer_draw">>).