-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
273 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
target = "big_data" | ||
mode = "" | ||
source_type = "excel" | ||
|
||
sources = [ | ||
{ file_name = "big_data.xlsx", sheet_name = "Sheet1" }, | ||
] | ||
|
||
fields = [ | ||
{ active = true, sname = "id" , tname = "id" , type = "int" , key = 1, desc = "id" }, | ||
{ active = true, sname = "name" , tname = "name" , type = "string" , key = 0, desc = "名字" }, | ||
{ active = true, sname = "age" , tname = "age" , type = "int" , key = 0, desc = "年龄" }, | ||
{ active = true, sname = "course" , tname = "course" , type = "[]int" , key = 0, desc = "学科id" }, | ||
{ active = true, sname = "score" , tname = "score" , type = "map[int]int" , key = 0, desc = "成绩组" }, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
target = "csv_test" | ||
mode = "" | ||
source_type = "csv" | ||
|
||
sources = [ | ||
{ file_name = "csv_test.csv", sheet_name = "" }, | ||
] | ||
|
||
fields = [ | ||
{ active = true, sname = "id" , tname = "id" , type = "int" , key = 1, desc = "id" }, | ||
{ active = true, sname = "name" , tname = "name" , type = "string" , key = 0, desc = "名字" }, | ||
{ active = true, sname = "age" , tname = "age" , type = "int" , key = 0, desc = "年龄" }, | ||
] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
using Serialization; | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace CfgTable | ||
{ | ||
|
||
public partial class Tblbig_data | ||
{ | ||
|
||
private readonly Dictionary<int, Cfgbig_data> _dataMap; | ||
private readonly List<Cfgbig_data> _dataList; | ||
|
||
|
||
public Tblbig_data(ByteBuf _buf) | ||
{ | ||
//first read common data | ||
_TbCommonbig_data _commonData = null; | ||
var commonSize = _buf.ReadSize(); | ||
if( commonSize > 0) | ||
{ | ||
_commonData = new _TbCommonbig_data(_buf); | ||
} | ||
|
||
var size = _buf.ReadSize(); | ||
_dataMap = new Dictionary<int, Cfgbig_data>(16); | ||
_dataList = new List<Cfgbig_data>(size); | ||
|
||
for (int i = 0; i < size; i++) | ||
{ | ||
Cfgbig_data _v; | ||
_v = Cfgbig_data.DeserializeCfgbig_data(_buf, _commonData); | ||
_dataList.Add(_v); | ||
_dataMap[_v.id] = _v; | ||
} | ||
|
||
PostInit(); | ||
} | ||
|
||
public int DataCount => _dataList.Count; | ||
public Dictionary<int, Cfgbig_data> DataMap => _dataMap; | ||
public List<Cfgbig_data> DataList => _dataList; | ||
|
||
public Cfgbig_data GetDataById(int __k0) { if (_dataMap.TryGetValue(__k0, out var __tmpv0)) { return __tmpv0; } return null; } | ||
|
||
/// <summary> | ||
/// post process table | ||
/// </summary> | ||
partial void PostInit(); | ||
|
||
} | ||
|
||
public partial class Cfgbig_data | ||
{ | ||
private Cfgbig_data(ByteBuf _buf, _TbCommonbig_data _commonData) | ||
{ | ||
|
||
id = _buf.ReadInt(); | ||
{ int dataIndex = _buf.ReadInt() - 1; name = _commonData._field0[dataIndex]; } | ||
age = _buf.ReadInt(); | ||
{ int dataIndex = _buf.ReadInt() - 1; course = _commonData._field1[dataIndex]; } | ||
{ int dataIndex = _buf.ReadInt() - 1; score = _commonData._field2[dataIndex]; } | ||
PostInit(); | ||
} | ||
|
||
internal static Cfgbig_data DeserializeCfgbig_data(ByteBuf _buf, _TbCommonbig_data _commonData) | ||
{ | ||
return new Cfgbig_data(_buf, _commonData); | ||
} | ||
|
||
/// <summary> | ||
/// id | ||
/// </summary> | ||
public int id { get; private set; } | ||
|
||
/// <summary> | ||
/// 名字 | ||
/// </summary> | ||
public string name { get; private set; } | ||
|
||
/// <summary> | ||
/// 年龄 | ||
/// </summary> | ||
public int age { get; private set; } | ||
|
||
/// <summary> | ||
/// 学科id | ||
/// </summary> | ||
public int[] course { get; private set; } | ||
|
||
/// <summary> | ||
/// 成绩组 | ||
/// </summary> | ||
public Dictionary<int, int> score { get; private set; } | ||
|
||
|
||
/// <summary> | ||
/// post process table | ||
/// </summary> | ||
partial void PostInit(); | ||
} | ||
|
||
/// <summary> | ||
/// internal common data.Optimize memory | ||
/// </summary> | ||
internal class _TbCommonbig_data | ||
{ | ||
|
||
internal string[] _field0 { get; private set; } | ||
internal int[][] _field1 { get; private set; } | ||
internal Dictionary<int, int>[] _field2 { get; private set; } | ||
internal _TbCommonbig_data(ByteBuf _buf) | ||
{ | ||
|
||
{int __n0 = _buf.ReadSize(); _field0 = new string[__n0];for(var __i0 = 0 ; __i0 < __n0 ; __i0++ ){string __v0; __v0 = _buf.ReadString(); _field0[__i0] = __v0;} } | ||
{int __n0 = _buf.ReadSize(); _field1 = new int[__n0][];for(var __i0 = 0 ; __i0 < __n0 ; __i0++ ){int[] __v0; {int __n1 = _buf.ReadSize(); __v0 = new int[__n1];for(var __i1 = 0 ; __i1 < __n1 ; __i1++ ){int __v1; __v1 = _buf.ReadInt(); __v0[__i1] = __v1;} } _field1[__i0] = __v0;} } | ||
{int __n0 = _buf.ReadSize(); _field2 = new Dictionary<int, int>[__n0];for(var __i0 = 0 ; __i0 < __n0 ; __i0++ ){Dictionary<int, int> __v0; { int __n1 = _buf.ReadSize(); var __f1 = new Dictionary<int, int> (__n1 * 3 / 2) ; __v0 = __f1; for(var __i1 = 0 ; __i1 < __n1 ; __i1++ ) {int __k1; __k1 = _buf.ReadInt(); int __v1; __v1 = _buf.ReadInt(); __f1.Add(__k1, __v1); } } _field2[__i0] = __v0;} } | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
using Serialization; | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace CfgTable | ||
{ | ||
|
||
public partial class Tblcsv_test | ||
{ | ||
|
||
private readonly Dictionary<int, Cfgcsv_test> _dataMap; | ||
private readonly List<Cfgcsv_test> _dataList; | ||
|
||
|
||
public Tblcsv_test(ByteBuf _buf) | ||
{ | ||
//first read common data | ||
_TbCommoncsv_test _commonData = null; | ||
var commonSize = _buf.ReadSize(); | ||
if( commonSize > 0) | ||
{ | ||
_commonData = new _TbCommoncsv_test(_buf); | ||
} | ||
|
||
var size = _buf.ReadSize(); | ||
_dataMap = new Dictionary<int, Cfgcsv_test>(16); | ||
_dataList = new List<Cfgcsv_test>(size); | ||
|
||
for (int i = 0; i < size; i++) | ||
{ | ||
Cfgcsv_test _v; | ||
_v = Cfgcsv_test.DeserializeCfgcsv_test(_buf, _commonData); | ||
_dataList.Add(_v); | ||
_dataMap[_v.id] = _v; | ||
} | ||
|
||
PostInit(); | ||
} | ||
|
||
public int DataCount => _dataList.Count; | ||
public Dictionary<int, Cfgcsv_test> DataMap => _dataMap; | ||
public List<Cfgcsv_test> DataList => _dataList; | ||
|
||
public Cfgcsv_test GetDataById(int __k0) { if (_dataMap.TryGetValue(__k0, out var __tmpv0)) { return __tmpv0; } return null; } | ||
|
||
/// <summary> | ||
/// post process table | ||
/// </summary> | ||
partial void PostInit(); | ||
|
||
} | ||
|
||
public partial class Cfgcsv_test | ||
{ | ||
private Cfgcsv_test(ByteBuf _buf, _TbCommoncsv_test _commonData) | ||
{ | ||
|
||
id = _buf.ReadInt(); | ||
name = _buf.ReadString(); | ||
age = _buf.ReadInt(); | ||
PostInit(); | ||
} | ||
|
||
internal static Cfgcsv_test DeserializeCfgcsv_test(ByteBuf _buf, _TbCommoncsv_test _commonData) | ||
{ | ||
return new Cfgcsv_test(_buf, _commonData); | ||
} | ||
|
||
/// <summary> | ||
/// id | ||
/// </summary> | ||
public int id { get; private set; } | ||
|
||
/// <summary> | ||
/// 名字 | ||
/// </summary> | ||
public string name { get; private set; } | ||
|
||
/// <summary> | ||
/// 年龄 | ||
/// </summary> | ||
public int age { get; private set; } | ||
|
||
|
||
/// <summary> | ||
/// post process table | ||
/// </summary> | ||
partial void PostInit(); | ||
} | ||
|
||
/// <summary> | ||
/// internal common data.Optimize memory | ||
/// </summary> | ||
internal class _TbCommoncsv_test | ||
{ | ||
|
||
internal _TbCommoncsv_test(ByteBuf _buf) | ||
{ | ||
|
||
} | ||
|
||
} | ||
|
||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters