mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-06-05 06:15:40 +00:00
doc[storage]: Synchronize the latest documents.
This commit is contained in:
@@ -23,6 +23,7 @@ import com.zfoo.storage.resource.StudentResource;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
import java.util.List;
|
||||
@@ -36,6 +37,14 @@ public class ApplicationTest {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
public String testSpringInject(IStorage<Integer, StudentResource> studentStorage) {
|
||||
StudentResource resource = studentStorage.get(1001);
|
||||
|
||||
return resource.getName();
|
||||
}
|
||||
|
||||
// storage教程
|
||||
@Test
|
||||
public void startStorageTest() {
|
||||
@@ -47,6 +56,7 @@ public class ApplicationTest {
|
||||
// Excel的映射内容需要在被Spring管理的bean的方法上加上@ResInjection注解,即可自动注入Excel对应的对象
|
||||
// 参考StudentManager中的标准用法
|
||||
|
||||
IStorage<Integer, StudentResource> storage1 = StorageContext.getStorageManager().getStorage(StudentResource.class);
|
||||
|
||||
//获取所有数据
|
||||
List<StudentResource> list = StorageContext.getList(StudentResource.class);
|
||||
|
||||
@@ -10,7 +10,6 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* @author veione
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Storage
|
||||
public record StudentResource(
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package com.zfoo.storage;
|
||||
package com.zfoo.storage.util.support;
|
||||
|
||||
import com.zfoo.protocol.util.FieldUtils;
|
||||
import org.junit.Test;
|
||||
@@ -7,7 +7,6 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author veione
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class TestFieldUtils {
|
||||
|
||||
+2
-2
@@ -1,5 +1,6 @@
|
||||
package com.zfoo.storage;
|
||||
package com.zfoo.storage.util.support;
|
||||
|
||||
import com.zfoo.storage.StudentResource;
|
||||
import com.zfoo.storage.util.LambdaUtils;
|
||||
import com.zfoo.storage.util.function.Func1;
|
||||
import com.zfoo.storage.util.support.LambdaMeta;
|
||||
@@ -11,7 +12,6 @@ import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @author veione
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class TestLambdaFunction {
|
||||
//https://blog.csdn.net/iteye_19045/article/details/119299015
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package com.zfoo.storage;
|
||||
package com.zfoo.storage.util.support;
|
||||
|
||||
import com.zfoo.storage.resource.StudentResource;
|
||||
import com.zfoo.storage.util.LambdaUtils;
|
||||
@@ -7,7 +7,6 @@ import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author veione
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class TestLambdaFunctionCache {
|
||||
|
||||
Reference in New Issue
Block a user