AppConfig.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package cn.hmsoft.scan.common;
  2. import org.springframework.beans.factory.annotation.Value;
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.context.annotation.PropertySource;
  5. import org.springframework.stereotype.Component;
  6. /**
  7. * 系统配置常量类.
  8. *
  9. */
  10. @Configuration
  11. @PropertySource(
  12. value={
  13. "classpath:config.properties"
  14. },
  15. ignoreResourceNotFound=true
  16. )
  17. @Component
  18. public class AppConfig {
  19. /**
  20. * 考生登记表扫描目录
  21. */
  22. @Value("${file.scan.dir}")
  23. private String fileScanDir;
  24. /**
  25. * 临时文件路径.
  26. */
  27. @Value("${download.temp}")
  28. private String downloadTemp;
  29. /**
  30. * ocr识别成功后,移植的目录
  31. */
  32. @Value("${file.ocr.result.dir}")
  33. private String resultDir;
  34. /**
  35. * 消费者线程的数目,需要根据百度的QPS大小来配置
  36. */
  37. @Value("${scan.consume.thread.num}")
  38. private int consumerTheadNum;
  39. /**
  40. * opencv切割成图片后的 考生登记表存放目录
  41. */
  42. @Value("${file.scan.opencv.dir}")
  43. private String fileOpencvDir;
  44. public String getFileScanDir() {
  45. return fileScanDir;
  46. }
  47. public void setFileScanDir(String fileScanDir) {
  48. this.fileScanDir = fileScanDir;
  49. }
  50. public String getDownloadTemp() {
  51. return downloadTemp;
  52. }
  53. public void setDownloadTemp(String downloadTemp) {
  54. this.downloadTemp = downloadTemp;
  55. }
  56. public String getResultDir() {
  57. return resultDir;
  58. }
  59. public void setResultDir(String resultDir) {
  60. this.resultDir = resultDir;
  61. }
  62. public int getConsumerTheadNum() {
  63. return consumerTheadNum;
  64. }
  65. public void setConsumerTheadNum(int consumerTheadNum) {
  66. this.consumerTheadNum = consumerTheadNum;
  67. }
  68. public String getFileOpencvDir() {
  69. return fileOpencvDir;
  70. }
  71. public void setFileOpencvDir(String fileOpencvDir) {
  72. this.fileOpencvDir = fileOpencvDir;
  73. }
  74. }