- zhice teamson company development this module and all right reserved!
- attention ! just suport the spring-ioc framework.
npm instlal zc-file-storage-service
{
"fileList":[
{
"name":"app",
"initData":[],
"filePath":"${ROOT_PATH}/app.log"
}
]
}
const {SpringBoot} = require("spring-ioc")
const {ZcFileStorageServiceScaner} = require("zc-file-storage-service")
new SpringBoot({
srcList:["./app"],
moduleList:[ZcFileStorageServiceScaner]
}).run();
//@SpringBoot
class Application {
//@Autowired
zcFileStorageService;
appLog;
async beanInit(){
/**
1.json name convert to fileWrap Object and map to zcFileStorageService.files.
2.${ROOT_PATH} is root path of project.
3.allow set mutilple file configuration.
{
"fileList":[
{
"name":"app",
"initData":[],
"filePath":"${ROOT_PATH}/app.log"
}
]
}
*/
this.appLog = this.zcFileStorageService.files.app;
}
async main(){
this.appLog.update(data => data.push("222"))
}
}