mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-21 08:27:11 +00:00
doc[storage]: 更新文档
This commit is contained in:
+6
-4
@@ -5,6 +5,8 @@
|
||||
|
||||
- 利用Java动态语言的反射特性,用最少的代码去解析Excel
|
||||
|
||||
- 支持Excel导出Json文件
|
||||
|
||||
### Ⅱ. 自动映射
|
||||
|
||||
- Excel的第一行对应Java类属性,第二行和第三行不会起到注释的作用,其中第一列必须是Id属性
|
||||
@@ -16,7 +18,7 @@
|
||||

|
||||
|
||||
- 解析过后有两种使用方式
|
||||
1. 通过注解
|
||||
1. 通过注解
|
||||
```
|
||||
@Component
|
||||
public class StudentManager {
|
||||
@@ -26,7 +28,7 @@
|
||||
|
||||
}
|
||||
```
|
||||
2. 通过类动态获取
|
||||
2. 通过类动态获取
|
||||
```
|
||||
Storage<Integer, StudentResource> studentResources = (Storage<Integer, StudentResource>) StorageContext.getStorageManager().getStorage(StudentResource.class);
|
||||
```
|
||||
@@ -45,10 +47,10 @@ var students = studentResources.getIndex("name", "james0");
|
||||
|
||||
- 唯一索引通过Storage.getUniqueIndex()获取,需要把索引注解标注为@Index(unique = true)
|
||||
|
||||
### Ⅲ. 热更新Excel
|
||||
### Ⅲ. 热更新Excel/Json
|
||||
|
||||
- [tank](https://github.com/zfoo-project/tank-game-server/blob/main/common/src/main/java/com/zfoo/tank/common/util/HotUtils.java)
|
||||
分布式热更新Excel配置文件实现
|
||||
分布式热更新Excel/Json配置文件实现
|
||||
|
||||
### Ⅳ. 用途
|
||||
|
||||
|
||||
Reference in New Issue
Block a user