From 1d53dd8f501a98ddcce8146443b51b357ef5f9b1 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期四, 29 十二月 2022 16:55:46 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/controller/data/MetaController.java | 33 +++++++++++++++++---------------- 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/lf/server/controller/data/MetaController.java b/src/main/java/com/lf/server/controller/data/MetaController.java index 652638a..bd79283 100644 --- a/src/main/java/com/lf/server/controller/data/MetaController.java +++ b/src/main/java/com/lf/server/controller/data/MetaController.java @@ -23,6 +23,7 @@ import com.lf.server.service.all.BaseQueryService; import com.lf.server.service.data.DownloadService; import com.lf.server.service.data.MetaService; +import com.lf.server.service.sys.DownlogService; import com.lf.server.service.sys.TokenService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; @@ -53,31 +54,33 @@ BaseQueryService baseQueryService; @Autowired - DownloadService downloadService; + DownlogService downlogService; - private final static String EQ = "="; + @Autowired + DownloadService downloadService; @SysLog() @ApiOperation(value = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟") @ApiImplicitParams({ + @ApiImplicitParam(name = "depid", value = "鍗曚綅ID", dataType = "Integer", paramType = "query", example = "1"), @ApiImplicitParam(name = "dirid", value = "鐩綍ID", dataType = "Integer", paramType = "query", example = "10"), @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = ""), @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"), @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1") }) @GetMapping(value = "/selectByPageAndCount") - public ResponseMsg<List<MetaEntity>> selectByPageAndCount(Integer dirid, String name, Integer pageSize, Integer pageIndex) { + public ResponseMsg<List<MetaEntity>> selectByPageAndCount(Integer depid, Integer dirid, String name, Integer pageSize, Integer pageIndex) { try { if (pageSize < 1 || pageIndex < 1) { return fail("姣忛〉椤垫暟鎴栧垎椤垫暟灏忎簬1", null); } - int count = metaService.selectCount(dirid, name); + int count = metaService.selectCount(depid, dirid, name); if (count == 0) { return success(0, null); } - List<MetaEntity> rs = metaService.selectByPage(dirid, name, pageSize, pageSize * (pageIndex - 1)); + List<MetaEntity> rs = metaService.selectByPage(depid, dirid, name, pageSize, pageSize * (pageIndex - 1)); return success(count, rs); } catch (Exception ex) { @@ -163,8 +166,8 @@ @ApiImplicitParam(name = "ns", value = "鍚嶇О绌洪棿", dataType = "String", paramType = "query", example = "bd"), @ApiImplicitParam(name = "tab", value = "琛ㄥ悕", dataType = "String", paramType = "query", example = "dlg25wAanp") }) - @GetMapping(value = "/selectFields") - public ResponseMsg<List<DictEntity>> selectFields(String ns, String tab) { + @GetMapping(value = "/selectTabFields") + public ResponseMsg<List<DictEntity>> selectTabFields(String ns, String tab) { try { if (StringHelper.isEmpty(ns) || StringHelper.isEmpty(tab)) { return fail("鍚嶇О绌洪棿鍜岃〃鍚嶄笉鑳戒负绌�", null); @@ -309,7 +312,7 @@ } @SysLog() - @ApiOperation(value = "鍒嗛〉鏌ヨ涓嬭浇璁板綍骞惰繑鍥炶褰曟暟") + @ApiOperation(value = "鍒嗛〉鏌ヨ涓嬭浇鏂囦欢") @ApiImplicitParams({ @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = ""), @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"), @@ -355,7 +358,7 @@ if (null == reqEntity.getIds() || reqEntity.getIds().isEmpty()) { return fail("璇烽�夋嫨瑕佷笅杞界殑鏂囦欢"); } - if (!downloadService.decryptPwd(reqEntity)) { + if (!DownloadService.decryptPwd(reqEntity)) { return fail("瀵嗙爜瑙e瘑澶辫触", null); } if (!StringHelper.checkPwdValid(reqEntity.getPwd())) { @@ -388,11 +391,11 @@ if (StringHelper.isEmpty(guid) || StringHelper.isEmpty(pwd)) { return fail("鏂囦欢ID鍜屽瘑鐮佷笉鑳戒负绌�", null); } - if (!pwd.endsWith(EQ)) { + if (!pwd.endsWith(StaticData.EQ)) { pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name()); } - String password = downloadService.decryptPwd(pwd); + String password = DownloadService.decryptPwd(pwd); if (null == password) { return fail("瀵嗙爜瑙e瘑澶辫触", null); } @@ -427,11 +430,11 @@ if (StringHelper.isEmpty(guid) || StringHelper.isEmpty(pwd)) { WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "鏂囦欢ID鍜屽瘑鐮佷笉鑳戒负绌�", res); } - if (!pwd.endsWith(EQ)) { + if (!pwd.endsWith(StaticData.EQ)) { pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name()); } - String password = downloadService.decryptPwd(pwd); + String password = DownloadService.decryptPwd(pwd); if (null == password) { WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "瀵嗙爜瑙e瘑澶辫触", res); } @@ -446,9 +449,7 @@ } UserEntity ue = tokenService.getCurrentUser(req); - de.setDcount(de.getDcount() + 1); - de.setDownloadUser(ue.getId()); - int rows = downloadService.update(de); + downlogService.updateInfos(ue, de, req); String filePath = downloadService.getDownloadFilePath(de); WebHelper.download(filePath, de.getName(), res); -- Gitblit v1.9.3