| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.YamlProperties; |
| | | import com.whyc.dto.FileDirPath; |
| | | import com.whyc.dto.Page; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.DocUserMapper; |
| | |
| | | private DocFaceService faceService; |
| | | |
| | | //查询所有用户信息 |
| | | public Response getAllUser(Page page) { |
| | | PageHelper.startPage(page.getPageCurr(),page.getPageSize()); |
| | | public Response getAllUser(int pageCurr,int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | List<DocUser> list=mapper.getAllUser(); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null?true:false,pageInfo,"数据返回"); |
| | |
| | | |
| | | //检测是否存在重新上传的人脸 |
| | | public int checkFaceData(MultipartFile file,int faceId){ |
| | | String fileDirName = ""; |
| | | ApplicationHome applicationHome = new ApplicationHome(getClass()); |
| | | File jarFile = applicationHome.getDir(); |
| | | if( 1 == YamlProperties.runModel){ |
| | | fileDirName = jarFile.getParentFile().toString(); |
| | | }else{ |
| | | //打包版 |
| | | fileDirName = jarFile.toString(); |
| | | } |
| | | String root=fileDirName+"/face/"+File.separator; |
| | | String fileDirName = FileDirPath.getFileDirName(); |
| | | String root=fileDirName+File.separator+"face"+File.separator; |
| | | if(file.isEmpty()){ |
| | | faceId=0; |
| | | return faceId; |
| | | }else{ |
| | | String fileFileName = file.getOriginalFilename(); |
| | | String filePath = root + fileFileName; |