publish 0.0.9
This commit is contained in:
@@ -2,9 +2,10 @@ package com.tiesheng.demo.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.demo.pojos.TestFile;
|
||||
import com.tiesheng.message.config.aliyun.AliyunSmsConfig;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.poi.write.PoiWriteBase;
|
||||
import com.tiesheng.poi.util.PoiWriteUtil;
|
||||
import com.tiesheng.util.config.GlobalConfig;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.FileUploadPath;
|
||||
@@ -54,14 +55,14 @@ public class TestController {
|
||||
@TokenIgnore
|
||||
public ApiResp<String> export() {
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("11111");
|
||||
list.add("22222");
|
||||
list.add("33333");
|
||||
List<TestFile> list = new ArrayList<>();
|
||||
list.add(new TestFile("11111"));
|
||||
list.add(new TestFile("22222"));
|
||||
list.add(new TestFile("33333"));
|
||||
list.add(new TestFile("44444"));
|
||||
|
||||
FileUploadPath fileUploadPath = FileUploadPath.random();
|
||||
|
||||
PoiWriteBase.export(list, fileUploadPath.getAbsolutePath(), "hahah");
|
||||
FileUploadPath fileUploadPath = FileUploadPath.random("xlsx");
|
||||
PoiWriteUtil.export(list, TestFile.class, fileUploadPath.getAbsolutePath(), "hahah");
|
||||
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.tiesheng.demo.pojos;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.tiesheng.poi.pojos.PoiWriteBase;
|
||||
import com.tiesheng.poi.util.PoiWriteUtil;
|
||||
|
||||
public class TestFile extends PoiWriteBase {
|
||||
|
||||
|
||||
@ExcelProperty("测试")
|
||||
private String test;
|
||||
|
||||
public TestFile(String test) {
|
||||
this.test = test;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter、getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getTest() {
|
||||
return test;
|
||||
}
|
||||
|
||||
public void setTest(String test) {
|
||||
this.test = test;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user