全新的自定义表系统让您可以灵活配置多张数据表,无需修改代码即可扩展数据采集能力。
在 dbconfig.ini 文件的 [custom_table] 节中配置:
[custom_table] # 用户数据表 custom_table_1=user_data:user_id:20,username:50,email:100,phone:20 # 游戏日志表 custom_table_2=game_log:log_id:20,player_id:20,action:200,timestamp:30 # 订单表 custom_table_3=orders:order_id:30,user_id:20,product:100,amount:20,status:10
key=表名:字段1:长度1,字段2:长度2,字段3:长度3,...
格式:HTTPPOST server 0 Param1=99#表名#字段值1#字段值2#...
生成 SQL:
INSERT INTO `user_data` (`user_id`,`username`,`email`,`phone`)
VALUES ('U001','张三','zhangsan@example.com','13800138000')
生成 SQL:
INSERT INTO `game_log` (`log_id`,`player_id`,`action`,`timestamp`)
VALUES ('LOG001','P12345','玩家完成任务','2024-01-15 10:30:00')
生成 SQL:
INSERT INTO `orders` (`order_id`,`user_id`,`product`,`amount`,`status`)
VALUES ('ORD001','U001','道具包','99.00','pending')
程序启动时会自动处理配置,处理成功后自动添加 _ok 标记行,原配置保持不变。
[custom_table] custom_table_1=user_data:user_id:20,username:50,email:100 custom_table_2=game_log:log_id:20,action:200,timestamp:30
[custom_table] custom_table_1=user_data:user_id:20,username:50,email:100 custom_table_2=game_log:log_id:20,action:200,timestamp:30 custom_table_1_ok=user_data:user_id:20,username:50,email:100 custom_table_2_ok=game_log:log_id:20,action:200,timestamp:30
工作原理:
_ok 标记的配置key_ok=value 行_ok 标记的配置优势: