月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-11-28 514705c874699fb016ca405961e50dcb15af2648
src/main/java/com/moon/server/entity/data/AnalysisResultEntity.java
@@ -1,6 +1,10 @@
package com.moon.server.entity.data;
import com.moon.server.helper.WebHelper;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
 * 分析结果
@@ -11,15 +15,60 @@
    private static final long serialVersionUID = -1237623414044281355L;
    public AnalysisResultEntity() {
        this.code = 200;
        this.minList = new ArrayList<>();
        this.avgList = new ArrayList<>();
        this.maxList = new ArrayList<>();
        this.points = new ArrayList<>();
    }
    public AnalysisResultEntity(String token) {
        this();
        this.token = token;
    }
    /**
     * 添加点
     */
    public void addPoint(double x, double y, double len, List<Double> vals) {
        Point point = new Point(x, y, len, vals);
        this.points.add(point);
    }
    /**
     * 添加Band值
     */
    public void addBandVals(double min, double avg, double max) {
        this.minList.add(WebHelper.round(min, 3));
        this.avgList.add(WebHelper.round(avg, 3));
        this.maxList.add(WebHelper.round(max, 3));
    }
    private String token;
    private String layerName;
    private Double min;
    private List<Double> minList;
    private Double avg;
    private List<Double> avgList;
    private Double max;
    private List<Double> maxList;
    private int code;
    private String info;
    private String unit;
    private List<Point> points;
    public String getToken() {
        return token;
    }
    public void setToken(String token) {
        this.token = token;
    }
    public String getLayerName() {
        return layerName;
@@ -29,27 +78,111 @@
        this.layerName = layerName;
    }
    public Double getMin() {
        return min;
    public List<Double> getMinList() {
        return minList;
    }
    public void setMin(Double min) {
        this.min = min;
    public void setMinList(List<Double> minList) {
        this.minList = minList;
    }
    public Double getAvg() {
        return avg;
    public List<Double> getAvgList() {
        return avgList;
    }
    public void setAvg(Double avg) {
        this.avg = avg;
    public void setAvgList(List<Double> avgList) {
        this.avgList = avgList;
    }
    public Double getMax() {
        return max;
    public List<Double> getMaxList() {
        return maxList;
    }
    public void setMax(Double max) {
        this.max = max;
    public void setMaxList(List<Double> maxList) {
        this.maxList = maxList;
    }
    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
    public String getInfo() {
        return info;
    }
    public void setInfo(String info) {
        this.info = info;
    }
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    public List<Point> getPoints() {
        return points;
    }
    public void setPoints(List<Point> points) {
        this.points = points;
    }
    public static class Point {
        private double x;
        private double y;
        private double len;
        private List<Double> vals;
        public Point() {
        }
        public Point(double x, double y, double len, List<Double> vals) {
            this.x = x;
            this.y = y;
            this.len = WebHelper.round(len, 3);
            this.vals = vals;
        }
        public double getX() {
            return x;
        }
        public void setX(double x) {
            this.x = x;
        }
        public double getY() {
            return y;
        }
        public void setY(double y) {
            this.y = y;
        }
        public double getLen() {
            return len;
        }
        public void setLen(double len) {
            this.len = len;
        }
        public List<Double> getVals() {
            return vals;
        }
        public void setVals(List<Double> vals) {
            this.vals = vals;
        }
    }
}