diff --git a/boot/src/main/java/com/zfoo/boot/StorageAutoConfiguration.java b/boot/src/main/java/com/zfoo/boot/StorageAutoConfiguration.java index 5486f90d..5432a6d7 100644 --- a/boot/src/main/java/com/zfoo/boot/StorageAutoConfiguration.java +++ b/boot/src/main/java/com/zfoo/boot/StorageAutoConfiguration.java @@ -13,6 +13,7 @@ package com.zfoo.boot; import com.zfoo.storage.StorageContext; +import com.zfoo.storage.interpreter.ResourceReader; import com.zfoo.storage.manager.StorageManager; import com.zfoo.storage.model.config.StorageConfig; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; @@ -39,8 +40,8 @@ public class StorageAutoConfiguration { @Bean @ConditionalOnMissingBean - public ExcelResourceReader excelResourceReader() { - return new ExcelResourceReader(); + public ResourceReader excelResourceReader() { + return new ResourceReader(); } @Bean diff --git a/storage/src/test/resources/excel/StudentResource.txt b/storage/src/test/resources/excel/StudentResource.txt deleted file mode 100644 index 7d1d6053..00000000 --- a/storage/src/test/resources/excel/StudentResource.txt +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name" : "StudentResource", - "columns" : [ - { - "name" : "id", - "type" : "string", - "index" : 0 - }, - { - "name" : "name", - "type" : "string", - "index" : 1 - }, - { - "name" : "age", - "type" : "int", - "index" : 2 - }, - { - "name" : "score", - "type" : "float", - "index" : 3 - }, - { - "name" : "courses", - "type" : "array", - "index" : 4 - }, - { - "name" : "users", - "type" : "array", - "index" : 5 - }, - { - "name" : "user", - "type" : "string", - "index" : 6 - } - ], - "data" : [ - [ - "1000", - "james0", - "10", - "60.8", - "[\"History\",\"Chiness\"]", - "[{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22},{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22}]", - "{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22}" - ], - [ - "1001", - "james1", - "10", - "70.1", - "[\"History\",\"Chiness\"]", - "[{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22},{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":23}]", - "{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22}" - ], - [ - "1002", - "james2", - "10", - "80.2", - "[\"History\",\"Chiness\"]", - "[{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22},{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":24}]", - "{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22}" - ], - [ - "1003", - "james3", - "10", - "59", - "[\"History\",\"Chiness\"]", - "[{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22},{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":25}]", - "{\"id\":\"1000\",\"name\":\"SunInsanity\",\"sex\":\"boy\",\"age\":22}" - ] - ] -} \ No newline at end of file diff --git a/storage/src/test/resources/excel/StudentResource.xlsx b/storage/src/test/resources/excel/StudentResource.xlsx new file mode 100644 index 00000000..d7378b7a Binary files /dev/null and b/storage/src/test/resources/excel/StudentResource.xlsx differ diff --git a/storage/src/test/resources/excel/TestResource.txt b/storage/src/test/resources/excel/TestResource.txt index 8505908b..99b958f6 100644 --- a/storage/src/test/resources/excel/TestResource.txt +++ b/storage/src/test/resources/excel/TestResource.txt @@ -1,6 +1,6 @@ { "name": "Test", - "columns": [ + "header": [ { "name": "Id", "type": "int",