月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-09-02 738ac9519a80da21556ad7605acedba54423ab1d
添加数简服务发布实体类及参数
已修改5个文件
157 ■■■■■ 文件已修改
src/main/java/com/moon/server/controller/data/PublishController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/entity/ctrl/PubEntity.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/PublishService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/ShuJianService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/controller/data/PublishController.java
@@ -179,7 +179,6 @@
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                entity.setUserId(ue.getId());
                entity.setToken(WebHelper.getToken(req));
            }
            permsService.clearPermsCache();
@@ -193,6 +192,23 @@
    }
    @SysLog()
    @ApiOperation(value = "发布数简服务")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "PubEntity", paramType = "body")
    })
    public ResponseMsg<Object> insertShuJianService(@RequestBody PubEntity entity, HttpServletRequest req) {
        try {
            if (null == entity || null == entity.getIds() || entity.getIds().isEmpty()) {
                return fail("实体类为空或找不到元数据ID", 0);
            }
            return success(null);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
        }
    }
    @SysLog()
    @ApiOperation(value = "删除多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1")
src/main/java/com/moon/server/entity/ctrl/PubEntity.java
@@ -1,42 +1,79 @@
package com.moon.server.entity.ctrl;
import io.swagger.models.auth.In;
import com.moon.server.entity.shujian.ColorTableEntity;
import com.moon.server.entity.shujian.GradientColorTableEntity;
import java.io.Serializable;
import java.util.List;
/**
 * 发布实体类
 * @author WWW
 * @date 2023-09-02
 */
public class PubEntity {
public class PubEntity implements Serializable {
    private static final long serialVersionUID = 1393159573706054735L;
    public PubEntity() {
        min = 0;
        max = 18;
        epsgCode = 104903;
    }
    /**
     * 类型:DOM,DEM,Vector,Model
     */
    private String type;
    private String token;
    /**
     * 服务名称
     */
    private String name;
    private Integer userId;
    /**
     * 最小级别
     */
    private Integer min;
    /**
     * 最大级别
     */
    private Integer max;
    private Integer noData;
    /**
     * EPSG编码
     */
    private Integer epsgCode;
    /**
     * 用户ID
     */
    private Integer userId;
    /**
     * 目录编码
     */
    private String dircode;
    /**
     * 单位编码
     */
    private String depcode;
    /**
     * 元数据ID集合
     */
    private List<Integer> ids;
    private List<Integer> models;
    /**
     * 颜色表
     */
    private List<ColorTableEntity> colorTable;
    private List<Integer> srids;
    private List<Double> zs;
    /**
     * 渐变颜色表
     */
    private List<GradientColorTableEntity> gradientColorTable;
    public String getType() {
        return type;
@@ -46,28 +83,12 @@
        this.type = type;
    }
    public String getToken() {
        return token;
    }
    public void setToken(String token) {
        this.token = token;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getUserId() {
        return userId;
    }
    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    public Integer getMin() {
@@ -86,12 +107,20 @@
        this.max = max;
    }
    public Integer getNoData() {
        return noData;
    public Integer getEpsgCode() {
        return epsgCode;
    }
    public void setNoData(Integer noData) {
        this.noData = noData;
    public void setEpsgCode(Integer epsgCode) {
        this.epsgCode = epsgCode;
    }
    public Integer getUserId() {
        return userId;
    }
    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    public String getDircode() {
@@ -118,27 +147,19 @@
        this.ids = ids;
    }
    public List<Integer> getModels() {
        return models;
    public List<ColorTableEntity> getColorTable() {
        return colorTable;
    }
    public void setModels(List<Integer> models) {
        this.models = models;
    public void setColorTable(List<ColorTableEntity> colorTable) {
        this.colorTable = colorTable;
    }
    public List<Integer> getSrids() {
        return srids;
    public List<GradientColorTableEntity> getGradientColorTable() {
        return gradientColorTable;
    }
    public void setSrids(List<Integer> srids) {
        this.srids = srids;
    }
    public List<Double> getZs() {
        return zs;
    }
    public void setZs(List<Double> zs) {
        this.zs = zs;
    public void setGradientColorTable(List<GradientColorTableEntity> gradientColorTable) {
        this.gradientColorTable = gradientColorTable;
    }
}
src/main/java/com/moon/server/service/data/PublishService.java
@@ -6,7 +6,6 @@
import com.moon.server.entity.ctrl.PubEntity;
import com.moon.server.entity.data.MetaEntity;
import com.moon.server.entity.data.PublishEntity;
import com.moon.server.helper.PathHelper;
import com.moon.server.helper.RestHelper;
import com.moon.server.helper.StringHelper;
import com.moon.server.mapper.data.PublishMapper;
src/main/java/com/moon/server/service/data/ShuJianService.java
@@ -8,6 +8,7 @@
import com.moon.server.helper.StringHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -19,6 +20,12 @@
@Service
public class ShuJianService {
    private final static Log log = LogFactory.getLog(ShuJianService.class);
    @Value("${shujian.ak}")
    private String ak;
    @Value("${shujian.url}")
    private String url;
    /**
     * 创建数简图层
@@ -80,7 +87,6 @@
        }
    }
    /**
     * 删除数简图层
     */
@@ -89,7 +95,7 @@
            DeleteEntity entity = new DeleteEntity();
            entity.getId_list().add(id);
            //
            //..
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
@@ -103,7 +109,7 @@
            DeleteEntity entity = new DeleteEntity();
            entity.getId_list().add(id);
            //
            //..
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
src/main/resources/application.yml
@@ -103,11 +103,6 @@
        deny:
# mybatis
#mybatis:
#  type-aliases-package: com.moon.server.entity
#  config-location: classpath:mybatis.xml
#  mapper-locations: classpath:mapper/**/*.xml
mybatis-plus:
  type-aliases-package: com.moon.server.entity
  config-location: classpath:mybatis.xml
@@ -117,13 +112,17 @@
logging:
  config: classpath:logback-spring.xml
# RestTemplate config
# restTemplate config
remote:
  maxTotalConnect: 0
  maxConnectPerRoute: 1000
  connectTimeout: 30000
  readTimeout: -1
shujian:
  ak: ak=mf72ff9295c740ec0f37e61433e8a3ad8d
  url: http://172.16.2.10:50001/
# 系统配置
sys:
  # 管理员ID