%%---------------------------------------------------- %% 数据配置文件 %% @author linguohui %%---------------------------------------------------- -module(subscriber_data). -export([cfg/0, get/1]). -include("data_config.hrl"). -include("common.hrl"). cfg() -> #data_cfg{ name = subscriber_data ,lua_name = subscriber_data ,js_name = subscriber_data ,desc = "配置数据" ,source = "subscriber_data.xml" ,target = "subscriber_data.erl" ,splitv = 1 ,head_rows = 1 ,inc = [] ,callback = [ {{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}} ,{{get_id_reward, undefined}, cb_fun, handle, {get_tuple, ["订阅信息"], charge_id, [id, reward]}} ,{{get_days, undefined}, cb_fun, handle, {get_tuple, ["订阅信息"], id, days}} ,{{get_day_reward, undefined}, cb_fun, handle, {get_tuple, ["订阅信息"], id, [day_reward, seven_day_reward]}} ] ,callback_cli = [ {constant, cb_fun_lua, handle, {key_val, ["常量配置"], key, [val, desc]}}, {id_info, cb_fun_lua, handle, {type_get_val, ["订阅信息"], [id], all}}, {type_info, cb_fun_lua, handle, {type_get_val, ["订阅信息"], [type], all}} ] ,callback_json = [ {constant, cb_fun_json, handle, {key_val, ["常量配置"], key, [val, desc]}}, {id_info, cb_fun_json, handle, {type_get_val, ["订阅信息"], [id], all}}, {type_info, cb_fun_json, handle, {type_get_val, ["订阅信息"], [type], all}} ] ,sheet = [ {["常量配置"], [ #f_column{type = atom, name = key, desc = "键", primary = true, mod = all} ,#f_column{type = term, name = val, desc = "值", add_list_sign=false, mod = all} ,#f_column{type = str, name = desc, desc = "描述", mod = all} ]} , {["订阅信息"], [ #f_column{type = int, name = id, desc = "id", primary = true, mod = all} ,#f_column{type = int, name = charge_id, desc = "充值id", mod = all} ,#f_column{type = kv, kv_type = {?MODULE, get, [type]}, name = type, desc = "类型", mod = all} ,#f_column{type = int, name = days, desc = "奖励天数", mod = all} ,#f_column{type = term, name = reward, add_list_sign=false, desc = "充值奖励", mod = all} ,#f_column{type = term, name = day_reward, add_list_sign=false, desc = "每日邮件奖励", mod = all} ,#f_column{type = term, name = seven_day_reward, add_list_sign=false, desc = "每7日邮件奖励", mod = all} ]} ] }. get(type) -> [ {"月订阅", 1} ,{"季度订阅", 2} ]; get(_) -> [].