fix: 파일업로드 경로 properties로 extract
parent
ffa642aae5
commit
f4288e5838
@ -0,0 +1,30 @@
|
||||
package cokr.xit.adds;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.executor.Executor;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.plugin.Intercepts;
|
||||
import org.apache.ibatis.plugin.Signature;
|
||||
|
||||
import cokr.xit.adds.core.util.CoreSpringUtils;
|
||||
import cokr.xit.base.FileController;
|
||||
import cokr.xit.foundation.data.paging.MapperSupport;
|
||||
|
||||
@Intercepts({
|
||||
@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})
|
||||
})
|
||||
public class AddsMapperSupport extends MapperSupport {
|
||||
|
||||
@Override
|
||||
protected Object update(Executor executor, MappedStatement mappedStatement, Object obj) throws SQLException {
|
||||
String id = mappedStatement.getId();
|
||||
if(id.equals("cokr.xit.base.file.dao.FileMapper.insertFile")) {
|
||||
FileController addsFileController = CoreSpringUtils.getFileController();
|
||||
((Map)obj).put("addsFileRootPath", addsFileController.getFileRootPath());
|
||||
}
|
||||
return super.update(executor, mappedStatement, obj);
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,15 @@
|
||||
package cokr.xit.base;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
@Controller
|
||||
public class FileController extends cokr.xit.base.file.web.FileController {}
|
||||
public class FileController extends cokr.xit.base.file.web.FileController {
|
||||
@Value("${app.data.file.path}")
|
||||
private String fileRootPath;
|
||||
|
||||
public String getFileRootPath() {
|
||||
return fileRootPath;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue