RecallMergerResult.java 3.98 KB
package com.yoho.search.models.recall;

import com.yoho.search.service.recall.strategy.StrategyEnum;

import java.math.BigDecimal;
import java.util.List;

/**
 * 召回的合并结果
 */
public class RecallMergerResult {

    private long total;
    private List<SknResult> sknList;

    public RecallMergerResult(long total, List<SknResult> sknList) {
        this.total = total;
        this.sknList = sknList;
    }

    public long getTotal() {
        return total;
    }

    public List<SknResult> getSknList() {
        return sknList;
    }

    public static class SknResultSource {
        private StrategyEnum strategyEnum;
        private String intervalKey;

        public SknResultSource(StrategyEnum strategyEnum, String intervalKey) {
            this.strategyEnum = strategyEnum;
            this.intervalKey = intervalKey;
        }

        public StrategyEnum getStrategyEnum() {
            return strategyEnum;
        }

        public String getIntervalKey() {
            return intervalKey;
        }
    }

    public static class SknResult {

        private Integer productSkn;
        private Integer brandId;
        private Integer middleSortId;
        private Integer priceArea;
        private Integer heatValue;
        private String factor;
        private double uvScore;
        private double salesPrice;

        private Double score;
        private boolean likePriceArea;

        private StrategyEnum strategy;
        private String intervalKey;
        private boolean onlyOneStrategy;

        public SknResult(Integer productSkn) {
            this.productSkn = productSkn;
            this.likePriceArea = false;
        }

        /**************************set*******************************/
        public void setBySknBaseInfo(SknBaseInfoResponse sknBaseInfoResponse) {
            this.brandId = sknBaseInfoResponse.getBrandId();
            this.middleSortId = sknBaseInfoResponse.getMisortId();
            this.priceArea = sknBaseInfoResponse.getPriceArea();
            this.heatValue = sknBaseInfoResponse.getHeatValue();
            this.factor = sknBaseInfoResponse.getProductFeatureFactor();
            this.uvScore = sknBaseInfoResponse.getUvScore();
            this.salesPrice = sknBaseInfoResponse.getSalesPrice();
        }

        public void setScore(Double score) {
            this.score = score;
        }

        public void setLikePriceArea(boolean likePriceArea) {
            this.likePriceArea = likePriceArea;
        }

        public void setSource(SknResultSource sknResultSource, boolean onlyOneStrategy) {
            this.strategy = sknResultSource.getStrategyEnum();
            this.intervalKey = sknResultSource.getIntervalKey();
            this.onlyOneStrategy = onlyOneStrategy;
        }

        /**************************get*******************************/
        public Integer getProductSkn() {
            return productSkn;
        }

        public String getIntervalKey() {
            return intervalKey;
        }

        public Integer getBrandId() {
            return brandId;
        }

        public Integer getMiddleSortId() {
            return middleSortId;
        }

        public Integer getPriceArea() {
            return priceArea;
        }

        public StrategyEnum getStrategy() {
            return strategy;
        }

        public Double getScore() {
            return score;
        }

        public String getFactor() {
            return factor;
        }

        public boolean isLikePriceArea() {
            return likePriceArea;
        }

        public Integer getHeatValue() {
            return heatValue;
        }

        public boolean isOnlyOneStrategy() {
            return onlyOneStrategy;
        }

        public double getUvScore() {
            return uvScore;
        }

        public double getSalesPrice() {
            return salesPrice;
        }
    }

}