FileComponents.java 679 B

1234567891011121314151617181920212223242526
  1. package com.ydtech.modules.order.components;
  2. import com.ydtech.utils.baidu.FileUtil;
  3. import org.springframework.beans.factory.annotation.Value;
  4. import org.springframework.stereotype.Component;
  5. @Component
  6. public class FileComponents {
  7. @Value("${upload.file.path}")
  8. private String uploadFilePath;
  9. @Value("${upload.file.url}")
  10. private String showFileUrl;
  11. @Value("${api.url}")
  12. private String apiUrl;
  13. public String gainCarInsPolicy(String url, String fileName, String licensePlate) {
  14. String dir = "carInsPolicy/" + licensePlate + "/";
  15. return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
  16. }
  17. }