我有三种数据类型...
1) 基础数据 2) data_dict_1 3) data_dict_2
基本数据是格式很好的 json .. 例如:
{"id1":"foo", "id2":"bar" ,type:"type1"}
{"id1":"foo", "id2":"bar" ,type:"type2"}
data_dict_1
1 foo
2 bar
3 foobar
....
data_dict_2
-1 foo
-2 bar
-3 foobar
... and so on
现在,我想要的是.. 如果数据是 type1
然后从 data_dict_1 中读取 id1,从 data_dict2 中读取 id2 并分配该整数 id.. 如果数据是 type2.. 则从 data_dict_2 中读取 id1.. 从 data_dict1.. 中读取 id2.. 并分配相应的 ids.. 例如:
{"id1":1, "id2":2 ,type:"type1"}
{"id1":-1, "id2":-2 ,type:"type2"}
等等..我如何在猪身上做到这一点?