mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-25 10:54:43 +00:00
使用Luban
This commit is contained in:
parent
0014eff5e0
commit
e8f8cb3ce9
15
CocosConfig.bat
Normal file
15
CocosConfig.bat
Normal file
@ -0,0 +1,15 @@
|
||||
set WORKSPACE=.\luban_examples
|
||||
|
||||
set LUBAN_DLL=%WORKSPACE%\Tools\Luban\Luban.dll
|
||||
set P_PATH=.\JisolGameCocos
|
||||
set CONF_ROOT=.\DataTables
|
||||
|
||||
dotnet %LUBAN_DLL% ^
|
||||
-t all ^
|
||||
-c typescript-json ^
|
||||
-d json ^
|
||||
--conf %CONF_ROOT%\luban.conf ^
|
||||
-x outputCodeDir=%P_PATH%\assets\resources\config\data ^
|
||||
-x outputDataDir=%P_PATH%\assets\resources\config\json
|
||||
|
||||
pause
|
BIN
DataTables/Datas/Battle/Role/角色表.xlsx
Normal file
BIN
DataTables/Datas/Battle/Role/角色表.xlsx
Normal file
Binary file not shown.
BIN
DataTables/Datas/__beans__.xlsx
Normal file
BIN
DataTables/Datas/__beans__.xlsx
Normal file
Binary file not shown.
BIN
DataTables/Datas/__enums__.xlsx
Normal file
BIN
DataTables/Datas/__enums__.xlsx
Normal file
Binary file not shown.
BIN
DataTables/Datas/__tables__.xlsx
Normal file
BIN
DataTables/Datas/__tables__.xlsx
Normal file
Binary file not shown.
BIN
DataTables/Datas/item.xlsx
Normal file
BIN
DataTables/Datas/item.xlsx
Normal file
Binary file not shown.
17
DataTables/Defines/builtin.xml
Normal file
17
DataTables/Defines/builtin.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<module name="">
|
||||
<bean name="vector2" valueType="1" sep=",">
|
||||
<var name="x" type="float"/>
|
||||
<var name="y" type="float"/>
|
||||
</bean>
|
||||
<bean name="vector3" valueType="1" sep=",">
|
||||
<var name="x" type="float"/>
|
||||
<var name="y" type="float"/>
|
||||
<var name="z" type="float"/>
|
||||
</bean>
|
||||
<bean name="vector4" valueType="1" sep=",">
|
||||
<var name="x" type="float"/>
|
||||
<var name="y" type="float"/>
|
||||
<var name="z" type="float"/>
|
||||
<var name="w" type="float"/>
|
||||
</bean>
|
||||
</module>
|
11
DataTables/gen.sh
Normal file
11
DataTables/gen.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
WORKSPACE=..
|
||||
LUBAN_DLL=$WORKSPACE/Tools/Luban/Luban.dll
|
||||
CONF_ROOT=.
|
||||
|
||||
dotnet $LUBAN_DLL \
|
||||
-t all \
|
||||
-d json \
|
||||
--conf $CONF_ROOT/luban.conf \
|
||||
-x outputDataDir=output
|
22
DataTables/luban.conf
Normal file
22
DataTables/luban.conf
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"groups":
|
||||
[
|
||||
{"names":["c"], "default":true},
|
||||
{"names":["s"], "default":true},
|
||||
{"names":["e"], "default":true}
|
||||
],
|
||||
"schemaFiles":
|
||||
[
|
||||
{"fileName":"Defines", "type":""},
|
||||
{"fileName":"Datas/__tables__.xlsx", "type":"table"},
|
||||
{"fileName":"Datas/__beans__.xlsx", "type":"bean"},
|
||||
{"fileName":"Datas/__enums__.xlsx", "type":"enum"}
|
||||
],
|
||||
"dataDir": "Datas",
|
||||
"targets":
|
||||
[
|
||||
{"name":"server", "manager":"Tables", "groups":["s"], "topModule":"cfg"},
|
||||
{"name":"client", "manager":"Tables", "groups":["c"], "topModule":"cfg"},
|
||||
{"name":"all", "manager":"Tables", "groups":["c,s,e"], "topModule":"cfg"}
|
||||
]
|
||||
}
|
104
DataTables/output/item_tbitem.json
Normal file
104
DataTables/output/item_tbitem.json
Normal file
@ -0,0 +1,104 @@
|
||||
[
|
||||
{
|
||||
"id": 10000,
|
||||
"name": "发型",
|
||||
"price": 100,
|
||||
"upgrade_to_item_id": 10001,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10001,
|
||||
"name": "外套",
|
||||
"price": 100,
|
||||
"upgrade_to_item_id": 10002,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10002,
|
||||
"name": "上衣",
|
||||
"price": 100,
|
||||
"upgrade_to_item_id": 10003,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10003,
|
||||
"name": "裙子",
|
||||
"price": 100,
|
||||
"upgrade_to_item_id": 10004,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10004,
|
||||
"name": "袜子",
|
||||
"price": 100,
|
||||
"upgrade_to_item_id": 10005,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 6
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10005,
|
||||
"name": "鞋子",
|
||||
"price": 100,
|
||||
"upgrade_to_item_id": 10006,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 7
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10006,
|
||||
"name": "发饰",
|
||||
"price": 100,
|
||||
"upgrade_to_item_id": 10007,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 8
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10007,
|
||||
"name": "中秋节发饰",
|
||||
"price": 200,
|
||||
"upgrade_to_item_id": 10008,
|
||||
"expire_time": 1633881599,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 9
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10008,
|
||||
"name": "中秋节鞋子",
|
||||
"price": 300,
|
||||
"upgrade_to_item_id": 10009,
|
||||
"expire_time": 1633967999,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 10009,
|
||||
"name": "礼包",
|
||||
"price": 100,
|
||||
"upgrade_to_item_id": 10000,
|
||||
"exchange_column": {
|
||||
"id": 10001,
|
||||
"num": 11
|
||||
}
|
||||
}
|
||||
]
|
15
JavaConfig.bat
Normal file
15
JavaConfig.bat
Normal file
@ -0,0 +1,15 @@
|
||||
set WORKSPACE=.\luban_examples
|
||||
|
||||
set LUBAN_DLL=%WORKSPACE%\Tools\Luban\Luban.dll
|
||||
set JAVA_PATH=.\JisolGameServer\Main\src\main
|
||||
set CONF_ROOT=.\DataTables
|
||||
|
||||
dotnet %LUBAN_DLL% ^
|
||||
-t all ^
|
||||
-c java-json ^
|
||||
-d json ^
|
||||
--conf %CONF_ROOT%\luban.conf ^
|
||||
-x outputCodeDir=%JAVA_PATH%\java\cfg ^
|
||||
-x outputDataDir=%JAVA_PATH%\resources\json
|
||||
|
||||
pause
|
98
JisolGameCocos/assets/resources/config/data/schema.ts
Normal file
98
JisolGameCocos/assets/resources/config/data/schema.ts
Normal file
@ -0,0 +1,98 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export namespace TB {export namespace Battle {export namespace Role {
|
||||
export class GRole {
|
||||
|
||||
constructor(_json_: any) {
|
||||
if (_json_.id === undefined) { throw new Error() }
|
||||
this.id = _json_.id
|
||||
if (_json_.name === undefined) { throw new Error() }
|
||||
this.name = _json_.name
|
||||
if (_json_.price === undefined) { throw new Error() }
|
||||
this.price = _json_.price
|
||||
if(_json_.expire_time != undefined) { this.expireTime = _json_.expire_time } else { this.expireTime = undefined }
|
||||
}
|
||||
|
||||
/**
|
||||
* 这是id
|
||||
*/
|
||||
readonly id: number
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
readonly name: string
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
readonly price: number
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
readonly expireTime: number|undefined
|
||||
|
||||
resolve(tables:Tables)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
|
||||
|
||||
|
||||
export class TbGRole{
|
||||
private _dataMap: Map<number, TB.Battle.Role.GRole>
|
||||
private _dataList: TB.Battle.Role.GRole[]
|
||||
constructor(_json_: any) {
|
||||
this._dataMap = new Map<number, TB.Battle.Role.GRole>()
|
||||
this._dataList = []
|
||||
for(var _json2_ of _json_) {
|
||||
let _v: TB.Battle.Role.GRole
|
||||
_v = new TB.Battle.Role.GRole(_json2_)
|
||||
this._dataList.push(_v)
|
||||
this._dataMap.set(_v.id, _v)
|
||||
}
|
||||
}
|
||||
|
||||
getDataMap(): Map<number, TB.Battle.Role.GRole> { return this._dataMap; }
|
||||
getDataList(): TB.Battle.Role.GRole[] { return this._dataList; }
|
||||
|
||||
get(key: number): TB.Battle.Role.GRole | undefined { return this._dataMap.get(key); }
|
||||
|
||||
resolve(tables:Tables)
|
||||
{
|
||||
for(let data of this._dataList)
|
||||
{
|
||||
data.resolve(tables)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
type JsonLoader = (file: string) => any
|
||||
|
||||
export class Tables {
|
||||
private _TbGRole: TbGRole
|
||||
get TbGRole(): TbGRole { return this._TbGRole;}
|
||||
|
||||
constructor(loader: JsonLoader) {
|
||||
this._TbGRole = new TbGRole(loader('tbgrole'))
|
||||
|
||||
this._TbGRole.resolve(this)
|
||||
}
|
||||
}
|
54
JisolGameCocos/assets/resources/config/json/tbgrole.json
Normal file
54
JisolGameCocos/assets/resources/config/json/tbgrole.json
Normal file
@ -0,0 +1,54 @@
|
||||
[
|
||||
{
|
||||
"id": 10000,
|
||||
"name": "发型",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10001,
|
||||
"name": "外套",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10002,
|
||||
"name": "上衣",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10003,
|
||||
"name": "裙子",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10004,
|
||||
"name": "袜子",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10005,
|
||||
"name": "鞋子",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10006,
|
||||
"name": "发饰",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10007,
|
||||
"name": "中秋节发饰",
|
||||
"price": 200,
|
||||
"expire_time": 1633881599
|
||||
},
|
||||
{
|
||||
"id": 10008,
|
||||
"name": "中秋节鞋子",
|
||||
"price": 300,
|
||||
"expire_time": 1633967999
|
||||
},
|
||||
{
|
||||
"id": 10009,
|
||||
"name": "礼包",
|
||||
"price": 100
|
||||
}
|
||||
]
|
@ -22,6 +22,10 @@
|
||||
<artifactId>JNGame</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -0,0 +1,61 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.TB.Battle.Role;
|
||||
|
||||
import luban.*;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
|
||||
public final class GRole extends AbstractBean {
|
||||
public GRole(JsonObject _buf) {
|
||||
id = _buf.get("id").getAsInt();
|
||||
name = _buf.get("name").getAsString();
|
||||
price = _buf.get("price").getAsInt();
|
||||
{ if (_buf.has("expire_time") && !_buf.get("expire_time").isJsonNull()) { expireTime = _buf.get("expire_time").getAsLong(); } else { expireTime = null; } }
|
||||
}
|
||||
|
||||
public static GRole deserialize(JsonObject _buf) {
|
||||
return new cfg.TB.Battle.Role.GRole(_buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* 这是id
|
||||
*/
|
||||
public final int id;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
public final String name;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
public final int price;
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
public final Long expireTime;
|
||||
|
||||
public static final int __ID__ = -1539036837;
|
||||
|
||||
@Override
|
||||
public int getTypeId() { return __ID__; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{ "
|
||||
+ "(format_field_name __code_style field.name):" + id + ","
|
||||
+ "(format_field_name __code_style field.name):" + name + ","
|
||||
+ "(format_field_name __code_style field.name):" + price + ","
|
||||
+ "(format_field_name __code_style field.name):" + expireTime + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
29
JisolGameServer/Main/src/main/java/cfg/Tables.java
Normal file
29
JisolGameServer/Main/src/main/java/cfg/Tables.java
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg;
|
||||
|
||||
import luban.*;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
public final class Tables
|
||||
{
|
||||
|
||||
public interface IJsonLoader {
|
||||
JsonElement load(String file) throws java.io.IOException;
|
||||
}
|
||||
|
||||
private final cfg.TbGRole _tbgrole;
|
||||
public cfg.TbGRole getTbGRole() { return _tbgrole; }
|
||||
|
||||
public Tables(IJsonLoader loader) throws java.io.IOException {
|
||||
_tbgrole = new cfg.TbGRole(loader.load("tbgrole"));
|
||||
}
|
||||
}
|
||||
|
37
JisolGameServer/Main/src/main/java/cfg/TbGRole.java
Normal file
37
JisolGameServer/Main/src/main/java/cfg/TbGRole.java
Normal file
@ -0,0 +1,37 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg;
|
||||
|
||||
import luban.*;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
|
||||
public final class TbGRole {
|
||||
private final java.util.HashMap<Integer, cfg.TB.Battle.Role.GRole> _dataMap;
|
||||
private final java.util.ArrayList<cfg.TB.Battle.Role.GRole> _dataList;
|
||||
|
||||
public TbGRole(JsonElement _buf) {
|
||||
_dataMap = new java.util.HashMap<Integer, cfg.TB.Battle.Role.GRole>();
|
||||
_dataList = new java.util.ArrayList<cfg.TB.Battle.Role.GRole>();
|
||||
|
||||
for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) {
|
||||
cfg.TB.Battle.Role.GRole _v;
|
||||
_v = cfg.TB.Battle.Role.GRole.deserialize(_e_.getAsJsonObject());
|
||||
_dataList.add(_v);
|
||||
_dataMap.put(_v.id, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public java.util.HashMap<Integer, cfg.TB.Battle.Role.GRole> getDataMap() { return _dataMap; }
|
||||
public java.util.ArrayList<cfg.TB.Battle.Role.GRole> getDataList() { return _dataList; }
|
||||
|
||||
public cfg.TB.Battle.Role.GRole get(int key) { return _dataMap.get(key); }
|
||||
|
||||
}
|
@ -1,8 +1,14 @@
|
||||
package cn.jisol.game.listener;
|
||||
|
||||
import cfg.Tables;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
||||
@Component
|
||||
public class InitGameListener {
|
||||
@ -10,7 +16,14 @@ public class InitGameListener {
|
||||
@EventListener(ContextRefreshedEvent.class)
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
|
||||
|
||||
try {
|
||||
Tables tables = new Tables(file -> JsonParser.parseReader(
|
||||
new FileReader(ResourceUtils.getFile("classpath:json/"+file+".json"))
|
||||
));
|
||||
System.out.println(tables.getTbGame().get(10000).name);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
{"60001":{"id":60001,"mapName":"天空城","map1":"map/MAP6/MAP6_1/spriteFrame","map2":"map/MAP6/MAP6_2/spriteFrame","map3":"map/MAP6/MAP6_3/spriteFrame","map1OffsetY":100,"map2OffsetY":400,"map3OffsetY":400}}
|
@ -1 +0,0 @@
|
||||
{"10001":{"id":10001,"roleName":"小石头","spine":"spine/召唤与合成819个Spine/小石头/guaiA1a/spine/guaiA1a","roleSkillIds":[],"roleAttackRange":100},"10002":{"id":10002,"roleName":"坚强小石","spine":"spine/召唤与合成819个Spine/坚强小石/guaiA1a_1/spine/guaiA1a","roleSkillIds":[],"roleAttackRange":100},"10003":{"id":10003,"roleName":"疯狂松鼠","spine":"spine/召唤与合成819个Spine/疯狂松鼠/guaiA4e_2/spine/guaiA4e","roleSkillIds":[40001],"roleAttackRange":500},"10004":{"id":10004,"roleName":"妙蛙种子","spine":"spine/神奇宝贝/001妙蛙种子/spine/001妙蛙种子","roleSkillIds":[40002],"roleAttackRange":350}}
|
@ -1 +0,0 @@
|
||||
{"10001":{"roleId":10001,"attackWay":"Normal","attackArgs":[]},"10002":{"roleId":10002,"attackWay":"Normal","attackArgs":[]},"10003":{"roleId":10003,"attackWay":"ParabolicBangRemote","attackArgs":["20001","30001","timo5 007","0.6","100","100"]},"10004":{"roleId":10004,"attackWay":"Normal","attackArgs":[]}}
|
@ -1 +0,0 @@
|
||||
{"20001":{"id":20001,"bulletName":"炸弹","bulletSrc":"bullets/疯狂松鼠/attack/spriteFrame"}}
|
@ -1 +0,0 @@
|
||||
{"30001":{"id":30001,"effectName":"爆炸","spine":"effect/爆炸效果/shouji_01/spine/shouji_01","animation":"animation"}}
|
@ -1 +0,0 @@
|
||||
{"40001":{"id":40001,"skillName":"疯狂松鼠","skillController":"GSkillCrazySquirrel","skillArgs":["5","250","250"],"skillText":"疯狂松鼠的技能 丢出巨大炸弹 轰炸全部玩家"},"40002":{"id":40002,"skillName":"妙蛙种子连击","skillController":"GSkillBulbasaurDoubleHit","skillArgs":["8"],"skillText":"妙蛙种子攻击8次 触发一次射叶子技能"}}
|
@ -1 +0,0 @@
|
||||
{"50001":{"id":50001,"text":"疯狂松鼠的技能开始 松鼠向天上丢出炸弹","spine":"spine/召唤与合成819个Spine/疯狂松鼠/guaiA4es_2/spine/guaiA4es"},"50002":{"id":50002,"text":"火球","spine":"effect/子弹效果/base_fly_fire/spine/buff_fire"},"50003":{"id":50003,"text":"火球爆炸","spine":"effect/爆炸效果/zhouyu_skill2_2/spine/zhouyu_skill2_2"}}
|
54
JisolGameServer/Main/src/main/resources/json/tbgrole.json
Normal file
54
JisolGameServer/Main/src/main/resources/json/tbgrole.json
Normal file
@ -0,0 +1,54 @@
|
||||
[
|
||||
{
|
||||
"id": 10000,
|
||||
"name": "发型",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10001,
|
||||
"name": "外套",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10002,
|
||||
"name": "上衣",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10003,
|
||||
"name": "裙子",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10004,
|
||||
"name": "袜子",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10005,
|
||||
"name": "鞋子",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10006,
|
||||
"name": "发饰",
|
||||
"price": 100
|
||||
},
|
||||
{
|
||||
"id": 10007,
|
||||
"name": "中秋节发饰",
|
||||
"price": 200,
|
||||
"expire_time": 1633881599
|
||||
},
|
||||
{
|
||||
"id": 10008,
|
||||
"name": "中秋节鞋子",
|
||||
"price": 300,
|
||||
"expire_time": 1633967999
|
||||
},
|
||||
{
|
||||
"id": 10009,
|
||||
"name": "礼包",
|
||||
"price": 100
|
||||
}
|
||||
]
|
@ -60,6 +60,12 @@ public final class Tables
|
||||
public cfg.test.TbTestString getTbTestString() { return _tbteststring; }
|
||||
private final cfg.test.TbDemoGroup _tbdemogroup;
|
||||
public cfg.test.TbDemoGroup getTbDemoGroup() { return _tbdemogroup; }
|
||||
private final cfg.test.TbDemoGroup_C _tbdemogroup_c;
|
||||
public cfg.test.TbDemoGroup_C getTbDemoGroup_C() { return _tbdemogroup_c; }
|
||||
private final cfg.test.TbDemoGroup_S _tbdemogroup_s;
|
||||
public cfg.test.TbDemoGroup_S getTbDemoGroup_S() { return _tbdemogroup_s; }
|
||||
private final cfg.test.TbDemoGroup_E _tbdemogroup_e;
|
||||
public cfg.test.TbDemoGroup_E getTbDemoGroup_E() { return _tbdemogroup_e; }
|
||||
private final cfg.test.TbTestGlobal _tbtestglobal;
|
||||
public cfg.test.TbTestGlobal getTbTestGlobal() { return _tbtestglobal; }
|
||||
private final cfg.test.TbTestBeRef _tbtestberef;
|
||||
@ -92,6 +98,8 @@ public final class Tables
|
||||
public cfg.test.TbExcelFromJsonMultiRow getTbExcelFromJsonMultiRow() { return _tbexcelfromjsonmultirow; }
|
||||
private final cfg.test.TbTestScriptableObject _tbtestscriptableobject;
|
||||
public cfg.test.TbTestScriptableObject getTbTestScriptableObject() { return _tbtestscriptableobject; }
|
||||
private final cfg.test.TbPath _tbpath;
|
||||
public cfg.test.TbPath getTbPath() { return _tbpath; }
|
||||
private final cfg.test.TbTestMapper _tbtestmapper;
|
||||
public cfg.test.TbTestMapper getTbTestMapper() { return _tbtestmapper; }
|
||||
private final cfg.test.TbDefineFromExcel2 _tbdefinefromexcel2;
|
||||
@ -118,6 +126,9 @@ public final class Tables
|
||||
_tbdemoprimitive = new cfg.test.TbDemoPrimitive(loader.load("test_tbdemoprimitive"));
|
||||
_tbteststring = new cfg.test.TbTestString(loader.load("test_tbteststring"));
|
||||
_tbdemogroup = new cfg.test.TbDemoGroup(loader.load("test_tbdemogroup"));
|
||||
_tbdemogroup_c = new cfg.test.TbDemoGroup_C(loader.load("test_tbdemogroup_c"));
|
||||
_tbdemogroup_s = new cfg.test.TbDemoGroup_S(loader.load("test_tbdemogroup_s"));
|
||||
_tbdemogroup_e = new cfg.test.TbDemoGroup_E(loader.load("test_tbdemogroup_e"));
|
||||
_tbtestglobal = new cfg.test.TbTestGlobal(loader.load("test_tbtestglobal"));
|
||||
_tbtestberef = new cfg.test.TbTestBeRef(loader.load("test_tbtestberef"));
|
||||
_tbtestberef2 = new cfg.test.TbTestBeRef2(loader.load("test_tbtestberef2"));
|
||||
@ -134,6 +145,7 @@ public final class Tables
|
||||
_tbcompositejsontable3 = new cfg.test.TbCompositeJsonTable3(loader.load("test_tbcompositejsontable3"));
|
||||
_tbexcelfromjsonmultirow = new cfg.test.TbExcelFromJsonMultiRow(loader.load("test_tbexcelfromjsonmultirow"));
|
||||
_tbtestscriptableobject = new cfg.test.TbTestScriptableObject(loader.load("test_tbtestscriptableobject"));
|
||||
_tbpath = new cfg.test.TbPath(loader.load("test_tbpath"));
|
||||
_tbtestmapper = new cfg.test.TbTestMapper(loader.load("test_tbtestmapper"));
|
||||
_tbdefinefromexcel2 = new cfg.test.TbDefineFromExcel2(loader.load("test_tbdefinefromexcel2"));
|
||||
}
|
||||
|
@ -19,8 +19,11 @@ public final class Item extends AbstractBean {
|
||||
public Item(ByteBuf _buf) {
|
||||
id = _buf.readInt();
|
||||
name = _buf.readString();
|
||||
majorType = _buf.readInt();
|
||||
minorType = _buf.readInt();
|
||||
maxPileNum = _buf.readInt();
|
||||
quality = _buf.readInt();
|
||||
icon = _buf.readString();
|
||||
iconBackgroud = _buf.readString();
|
||||
iconMask = _buf.readString();
|
||||
desc = _buf.readString();
|
||||
@ -36,8 +39,11 @@ public final class Item extends AbstractBean {
|
||||
*/
|
||||
public final int id;
|
||||
public final String name;
|
||||
public final int majorType;
|
||||
public final int minorType;
|
||||
public final int maxPileNum;
|
||||
public final int quality;
|
||||
public final String icon;
|
||||
public final String iconBackgroud;
|
||||
public final String iconMask;
|
||||
public final String desc;
|
||||
@ -53,8 +59,11 @@ public final class Item extends AbstractBean {
|
||||
return "{ "
|
||||
+ "(format_field_name __code_style field.name):" + id + ","
|
||||
+ "(format_field_name __code_style field.name):" + name + ","
|
||||
+ "(format_field_name __code_style field.name):" + majorType + ","
|
||||
+ "(format_field_name __code_style field.name):" + minorType + ","
|
||||
+ "(format_field_name __code_style field.name):" + maxPileNum + ","
|
||||
+ "(format_field_name __code_style field.name):" + quality + ","
|
||||
+ "(format_field_name __code_style field.name):" + icon + ","
|
||||
+ "(format_field_name __code_style field.name):" + iconBackgroud + ","
|
||||
+ "(format_field_name __code_style field.name):" + iconMask + ","
|
||||
+ "(format_field_name __code_style field.name):" + desc + ","
|
||||
|
@ -27,5 +27,6 @@ public final class DemoEnum {
|
||||
* dd
|
||||
*/
|
||||
public static final int D = 5;
|
||||
public static final int Any = 6;
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,10 @@ import luban.*;
|
||||
public final class DemoGroup extends AbstractBean {
|
||||
public DemoGroup(ByteBuf _buf) {
|
||||
id = _buf.readInt();
|
||||
x1 = _buf.readInt();
|
||||
x2 = _buf.readInt();
|
||||
x3 = _buf.readInt();
|
||||
x4 = _buf.readInt();
|
||||
x5 = cfg.test.InnerGroup.deserialize(_buf);
|
||||
}
|
||||
|
||||
@ -23,6 +27,10 @@ public final class DemoGroup extends AbstractBean {
|
||||
}
|
||||
|
||||
public final int id;
|
||||
public final int x1;
|
||||
public final int x2;
|
||||
public final int x3;
|
||||
public final int x4;
|
||||
public final cfg.test.InnerGroup x5;
|
||||
|
||||
public static final int __ID__ = -379263008;
|
||||
@ -34,6 +42,10 @@ public final class DemoGroup extends AbstractBean {
|
||||
public String toString() {
|
||||
return "{ "
|
||||
+ "(format_field_name __code_style field.name):" + id + ","
|
||||
+ "(format_field_name __code_style field.name):" + x1 + ","
|
||||
+ "(format_field_name __code_style field.name):" + x2 + ","
|
||||
+ "(format_field_name __code_style field.name):" + x3 + ","
|
||||
+ "(format_field_name __code_style field.name):" + x4 + ","
|
||||
+ "(format_field_name __code_style field.name):" + x5 + ","
|
||||
+ "}";
|
||||
}
|
||||
|
@ -15,6 +15,9 @@ import luban.*;
|
||||
public final class InnerGroup extends AbstractBean {
|
||||
public InnerGroup(ByteBuf _buf) {
|
||||
y1 = _buf.readInt();
|
||||
y2 = _buf.readInt();
|
||||
y3 = _buf.readInt();
|
||||
y4 = _buf.readInt();
|
||||
}
|
||||
|
||||
public static InnerGroup deserialize(ByteBuf _buf) {
|
||||
@ -22,6 +25,9 @@ public final class InnerGroup extends AbstractBean {
|
||||
}
|
||||
|
||||
public final int y1;
|
||||
public final int y2;
|
||||
public final int y3;
|
||||
public final int y4;
|
||||
|
||||
public static final int __ID__ = -587873083;
|
||||
|
||||
@ -32,6 +38,9 @@ public final class InnerGroup extends AbstractBean {
|
||||
public String toString() {
|
||||
return "{ "
|
||||
+ "(format_field_name __code_style field.name):" + y1 + ","
|
||||
+ "(format_field_name __code_style field.name):" + y2 + ","
|
||||
+ "(format_field_name __code_style field.name):" + y3 + ","
|
||||
+ "(format_field_name __code_style field.name):" + y4 + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.test;
|
||||
|
||||
import luban.*;
|
||||
|
||||
|
||||
public final class Path extends AbstractBean {
|
||||
public Path(ByteBuf _buf) {
|
||||
id = _buf.readInt();
|
||||
res = _buf.readString();
|
||||
}
|
||||
|
||||
public static Path deserialize(ByteBuf _buf) {
|
||||
return new cfg.test.Path(_buf);
|
||||
}
|
||||
|
||||
public final int id;
|
||||
public final String res;
|
||||
|
||||
public static final int __ID__ = -1226450911;
|
||||
|
||||
@Override
|
||||
public int getTypeId() { return __ID__; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{ "
|
||||
+ "(format_field_name __code_style field.name):" + id + ","
|
||||
+ "(format_field_name __code_style field.name):" + res + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.test;
|
||||
|
||||
import luban.*;
|
||||
|
||||
|
||||
public final class TbDemoGroup_C {
|
||||
private final java.util.HashMap<Integer, cfg.test.DemoGroup> _dataMap;
|
||||
private final java.util.ArrayList<cfg.test.DemoGroup> _dataList;
|
||||
|
||||
public TbDemoGroup_C(ByteBuf _buf) {
|
||||
_dataMap = new java.util.HashMap<Integer, cfg.test.DemoGroup>();
|
||||
_dataList = new java.util.ArrayList<cfg.test.DemoGroup>();
|
||||
|
||||
for(int n = _buf.readSize() ; n > 0 ; --n) {
|
||||
cfg.test.DemoGroup _v;
|
||||
_v = cfg.test.DemoGroup.deserialize(_buf);
|
||||
_dataList.add(_v);
|
||||
_dataMap.put(_v.id, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public java.util.HashMap<Integer, cfg.test.DemoGroup> getDataMap() { return _dataMap; }
|
||||
public java.util.ArrayList<cfg.test.DemoGroup> getDataList() { return _dataList; }
|
||||
|
||||
public cfg.test.DemoGroup get(int key) { return _dataMap.get(key); }
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.test;
|
||||
|
||||
import luban.*;
|
||||
|
||||
|
||||
public final class TbDemoGroup_E {
|
||||
private final java.util.HashMap<Integer, cfg.test.DemoGroup> _dataMap;
|
||||
private final java.util.ArrayList<cfg.test.DemoGroup> _dataList;
|
||||
|
||||
public TbDemoGroup_E(ByteBuf _buf) {
|
||||
_dataMap = new java.util.HashMap<Integer, cfg.test.DemoGroup>();
|
||||
_dataList = new java.util.ArrayList<cfg.test.DemoGroup>();
|
||||
|
||||
for(int n = _buf.readSize() ; n > 0 ; --n) {
|
||||
cfg.test.DemoGroup _v;
|
||||
_v = cfg.test.DemoGroup.deserialize(_buf);
|
||||
_dataList.add(_v);
|
||||
_dataMap.put(_v.id, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public java.util.HashMap<Integer, cfg.test.DemoGroup> getDataMap() { return _dataMap; }
|
||||
public java.util.ArrayList<cfg.test.DemoGroup> getDataList() { return _dataList; }
|
||||
|
||||
public cfg.test.DemoGroup get(int key) { return _dataMap.get(key); }
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.test;
|
||||
|
||||
import luban.*;
|
||||
|
||||
|
||||
public final class TbDemoGroup_S {
|
||||
private final java.util.HashMap<Integer, cfg.test.DemoGroup> _dataMap;
|
||||
private final java.util.ArrayList<cfg.test.DemoGroup> _dataList;
|
||||
|
||||
public TbDemoGroup_S(ByteBuf _buf) {
|
||||
_dataMap = new java.util.HashMap<Integer, cfg.test.DemoGroup>();
|
||||
_dataList = new java.util.ArrayList<cfg.test.DemoGroup>();
|
||||
|
||||
for(int n = _buf.readSize() ; n > 0 ; --n) {
|
||||
cfg.test.DemoGroup _v;
|
||||
_v = cfg.test.DemoGroup.deserialize(_buf);
|
||||
_dataList.add(_v);
|
||||
_dataMap.put(_v.id, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public java.util.HashMap<Integer, cfg.test.DemoGroup> getDataMap() { return _dataMap; }
|
||||
public java.util.ArrayList<cfg.test.DemoGroup> getDataList() { return _dataList; }
|
||||
|
||||
public cfg.test.DemoGroup get(int key) { return _dataMap.get(key); }
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.test;
|
||||
|
||||
import luban.*;
|
||||
|
||||
|
||||
public final class TbPath {
|
||||
private final java.util.HashMap<Integer, cfg.test.Path> _dataMap;
|
||||
private final java.util.ArrayList<cfg.test.Path> _dataList;
|
||||
|
||||
public TbPath(ByteBuf _buf) {
|
||||
_dataMap = new java.util.HashMap<Integer, cfg.test.Path>();
|
||||
_dataList = new java.util.ArrayList<cfg.test.Path>();
|
||||
|
||||
for(int n = _buf.readSize() ; n > 0 ; --n) {
|
||||
cfg.test.Path _v;
|
||||
_v = cfg.test.Path.deserialize(_buf);
|
||||
_dataList.add(_v);
|
||||
_dataMap.put(_v.id, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public java.util.HashMap<Integer, cfg.test.Path> getDataMap() { return _dataMap; }
|
||||
public java.util.ArrayList<cfg.test.Path> getDataList() { return _dataList; }
|
||||
|
||||
public cfg.test.Path get(int key) { return _dataMap.get(key); }
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.test;
|
||||
|
||||
import luban.*;
|
||||
|
||||
|
||||
/**
|
||||
* 这是个测试excel结构
|
||||
*/
|
||||
public final class TestExcelBean1 extends AbstractBean {
|
||||
public TestExcelBean1(ByteBuf _buf) {
|
||||
x1 = _buf.readInt();
|
||||
x2 = _buf.readString();
|
||||
x3 = _buf.readInt();
|
||||
x4 = _buf.readFloat();
|
||||
}
|
||||
|
||||
public static TestExcelBean1 deserialize(ByteBuf _buf) {
|
||||
return new cfg.test.TestExcelBean1(_buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* 最高品质
|
||||
*/
|
||||
public final int x1;
|
||||
/**
|
||||
* 黑色的
|
||||
*/
|
||||
public final String x2;
|
||||
/**
|
||||
* 蓝色的
|
||||
*/
|
||||
public final int x3;
|
||||
/**
|
||||
* 最差品质
|
||||
*/
|
||||
public final float x4;
|
||||
|
||||
public static final int __ID__ = -1738345160;
|
||||
|
||||
@Override
|
||||
public int getTypeId() { return __ID__; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{ "
|
||||
+ "(format_field_name __code_style field.name):" + x1 + ","
|
||||
+ "(format_field_name __code_style field.name):" + x2 + ","
|
||||
+ "(format_field_name __code_style field.name):" + x3 + ","
|
||||
+ "(format_field_name __code_style field.name):" + x4 + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
@ -100,6 +100,8 @@ public final class Tables
|
||||
public cfg.test.TbExcelFromJsonMultiRow getTbExcelFromJsonMultiRow() { return _tbexcelfromjsonmultirow; }
|
||||
private final cfg.test.TbTestScriptableObject _tbtestscriptableobject;
|
||||
public cfg.test.TbTestScriptableObject getTbTestScriptableObject() { return _tbtestscriptableobject; }
|
||||
private final cfg.test.TbPath _tbpath;
|
||||
public cfg.test.TbPath getTbPath() { return _tbpath; }
|
||||
private final cfg.test.TbTestMapper _tbtestmapper;
|
||||
public cfg.test.TbTestMapper getTbTestMapper() { return _tbtestmapper; }
|
||||
private final cfg.test.TbDefineFromExcel2 _tbdefinefromexcel2;
|
||||
@ -145,6 +147,7 @@ public final class Tables
|
||||
_tbcompositejsontable3 = new cfg.test.TbCompositeJsonTable3(loader.load("test_tbcompositejsontable3"));
|
||||
_tbexcelfromjsonmultirow = new cfg.test.TbExcelFromJsonMultiRow(loader.load("test_tbexcelfromjsonmultirow"));
|
||||
_tbtestscriptableobject = new cfg.test.TbTestScriptableObject(loader.load("test_tbtestscriptableobject"));
|
||||
_tbpath = new cfg.test.TbPath(loader.load("test_tbpath"));
|
||||
_tbtestmapper = new cfg.test.TbTestMapper(loader.load("test_tbtestmapper"));
|
||||
_tbdefinefromexcel2 = new cfg.test.TbDefineFromExcel2(loader.load("test_tbdefinefromexcel2"));
|
||||
}
|
||||
|
@ -27,5 +27,6 @@ public final class DemoEnum {
|
||||
* dd
|
||||
*/
|
||||
public static final int D = 5;
|
||||
public static final int Any = 6;
|
||||
}
|
||||
|
||||
|
43
luban_examples/Projects/java_json/src/gen/cfg/test/Path.java
Normal file
43
luban_examples/Projects/java_json/src/gen/cfg/test/Path.java
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.test;
|
||||
|
||||
import luban.*;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
|
||||
public final class Path extends AbstractBean {
|
||||
public Path(JsonObject _buf) {
|
||||
id = _buf.get("id").getAsInt();
|
||||
res = _buf.get("res").getAsString();
|
||||
}
|
||||
|
||||
public static Path deserialize(JsonObject _buf) {
|
||||
return new cfg.test.Path(_buf);
|
||||
}
|
||||
|
||||
public final int id;
|
||||
public final String res;
|
||||
|
||||
public static final int __ID__ = -1226450911;
|
||||
|
||||
@Override
|
||||
public int getTypeId() { return __ID__; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{ "
|
||||
+ "(format_field_name __code_style field.name):" + id + ","
|
||||
+ "(format_field_name __code_style field.name):" + res + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg.test;
|
||||
|
||||
import luban.*;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
|
||||
public final class TbPath {
|
||||
private final java.util.HashMap<Integer, cfg.test.Path> _dataMap;
|
||||
private final java.util.ArrayList<cfg.test.Path> _dataList;
|
||||
|
||||
public TbPath(JsonElement _buf) {
|
||||
_dataMap = new java.util.HashMap<Integer, cfg.test.Path>();
|
||||
_dataList = new java.util.ArrayList<cfg.test.Path>();
|
||||
|
||||
for (com.google.gson.JsonElement _e_ : _buf.getAsJsonArray()) {
|
||||
cfg.test.Path _v;
|
||||
_v = cfg.test.Path.deserialize(_e_.getAsJsonObject());
|
||||
_dataList.add(_v);
|
||||
_dataMap.put(_v.id, _v);
|
||||
}
|
||||
}
|
||||
|
||||
public java.util.HashMap<Integer, cfg.test.Path> getDataMap() { return _dataMap; }
|
||||
public java.util.ArrayList<cfg.test.Path> getDataList() { return _dataList; }
|
||||
|
||||
public cfg.test.Path get(int key) { return _dataMap.get(key); }
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user