| | |
| | | package com.whyc.util; |
| | | |
| | | import com.whyc.constant.YamlProperties; |
| | | import com.whyc.pojo.DocUser; |
| | | import com.whyc.service.DocLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return jarFile.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 获取存放文件的根路径 |
| | | * @return 返回存放文件的根路径 |
| | | */ |
| | | public static File getRootFile(){ |
| | | ApplicationHome applicationHome = new ApplicationHome(CommonUtil.class); |
| | | File jarFile = applicationHome.getDir(); |
| | | String baseDirPath; |
| | | if(YamlProperties.runModel == 1) { |
| | | //开发路径 |
| | | baseDirPath = jarFile.getParentFile().toString()+File.separator+"doc_file"+File.separator; |
| | | }else { |
| | | //打包路径 |
| | | baseDirPath = jarFile.toString()+File.separator+"doc_file"+File.separator; |
| | | } |
| | | return new File(baseDirPath); |
| | | } |
| | | |
| | | /**手动记录特定日志*/ |
| | | public static void record(long uId, int operationType, String msg){ |
| | | docLogService.record(uId,operationType,msg); |