管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-04-23 3be6302d29cb0ba109f664860f2be51b03aaf165
1
已添加1个文件
已修改5个文件
98 ■■■■■ 文件已修改
data/db_cx.sql 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/InquiryController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/ctrl/DownloadReqEntity.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/ctrl/DownloadTileEntity.java 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/ctrl/PwdEntity.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/DownloadService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | 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) {