data/db_cx.sql | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/controller/show/InquiryController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/entity/ctrl/DownloadReqEntity.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/entity/ctrl/DownloadTileEntity.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/entity/ctrl/PwdEntity.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/service/data/DownloadService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
data/db_cx.sql
@@ -21,9 +21,8 @@ select * from lf.sys_layer order by id desc; select * from lf.sys_fme_log order by id desc; select gid, top, bottom, top -(bottom - top) from public.coal2000 order by gid limit 20; update public.coal2000 set bottom = top -(bottom - top); select * from public.coal2000 order by gid limit 20; select * from lf.sys_download src/main/java/com/lf/server/controller/show/InquiryController.java
@@ -14,6 +14,7 @@ import com.lf.server.helper.StringHelper; import com.lf.server.helper.WebHelper; import com.lf.server.service.all.BaseUploadService; import com.lf.server.service.data.DownloadService; import com.lf.server.service.show.InquiryService; import com.lf.server.service.sys.TokenService; import io.swagger.annotations.Api; @@ -80,7 +81,16 @@ @PostMapping(value = "/downloadTiles") public ResponseMsg<Object> downloadTiles(@RequestBody DownloadTileEntity dt, HttpServletRequest req, HttpServletResponse res) { try { if (null == dt || null == dt.getPubid() || StringHelper.isEmpty(dt.getPwd())) { return fail("åå¸IDåå¯ç ä¸è½ä¸ºç©º"); } String err = dt.verifyCoords(); if (null != err) { return fail(err); } if (!DownloadService.decryptPwd(dt)) { return fail("å¯ç è§£å¯å¤±è´¥", null); } return success(""); } catch (Exception ex) { src/main/java/com/lf/server/entity/ctrl/DownloadReqEntity.java
@@ -7,10 +7,8 @@ * 请æ±ä¸è½½å®ä½ç±» * @author WWW */ public class DownloadReqEntity implements Serializable { public class DownloadReqEntity extends PwdEntity implements Serializable { private static final long serialVersionUID = -8624235184539814997L; private String pwd; private String guid; @@ -37,14 +35,6 @@ private String dirs; public DownloadReqEntity() { } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } public String getGuid() { src/main/java/com/lf/server/entity/ctrl/DownloadTileEntity.java
@@ -8,7 +8,7 @@ * ä¸è½½ç¦çå®ä½ç±» * @author WWW */ public class DownloadTileEntity implements Serializable { public class DownloadTileEntity extends PwdEntity implements Serializable { private static final long serialVersionUID = -229710198271495902L; private Double xmin; @@ -19,11 +19,9 @@ private Double ymax; private Integer pubid; private String title; private String url; private String pwd; public DownloadTileEntity() { } @@ -40,6 +38,17 @@ } if (ymin < StaticData.I90_NEG || ymin > StaticData.I90 || ymax < StaticData.I90_NEG || ymax > StaticData.I90) { return "Yåæ å¼ä¸æ£ç¡®"; } if (xmin > xmax) { double x = xmax; xmin = xmax; xmax = x; } if (ymin > ymax) { double y = ymax; ymin = ymax; ymax = y; } return null; @@ -77,27 +86,19 @@ this.ymax = ymax; } public Integer getPubid() { return pubid; } public void setPubid(Integer pubid) { this.pubid = pubid; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } } src/main/java/com/lf/server/entity/ctrl/PwdEntity.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ package com.lf.server.entity.ctrl; /** * å¯ç æ½è±¡ç±» * @author WWW */ public abstract class PwdEntity { private String pwd; public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } } src/main/java/com/lf/server/service/data/DownloadService.java
@@ -1,6 +1,7 @@ package com.lf.server.service.data; import com.lf.server.entity.ctrl.DownloadReqEntity; import com.lf.server.entity.ctrl.PwdEntity; import com.lf.server.entity.data.DownloadEntity; import com.lf.server.entity.show.PipelineEntity; import com.lf.server.helper.*; @@ -113,17 +114,17 @@ /** * è§£å¯ * * @param reqEntity 请æ±ä¸è½½å®ä½ç±» * @param entity å¯ç æ½è±¡ç±» * @return æ¯/å¦è§£å¯æå */ public static boolean decryptPwd(DownloadReqEntity reqEntity) { public static boolean decryptPwd(PwdEntity entity) { try { String pwd = RsaHelper.decrypt(reqEntity.getPwd()); String pwd = RsaHelper.decrypt(entity.getPwd()); if (StringHelper.isEmpty(pwd)) { return false; } reqEntity.setPwd(pwd); entity.setPwd(pwd); return true; } catch (Exception ex) {