package com.tmerclub.cloud.systemtest.data.platform;

import com.tmerclub.cloud.platform.dto.ScoreConfigDTO;
import com.tmerclub.cloud.platform.vo.ScoreConfigVO;
import com.moyuer.cloud.systemtest.api.platform.ScoreConfigApi;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * @author lpj
 */
public class ScoreConfigDtoData {
    public static ScoreConfigDTO getScoreConfigDTO(Long shoppingUseScoreRatio, Double userRatioLimit) {
        ScoreConfigVO scoreConfigVO = ScoreConfigApi.info();
        ScoreConfigDTO scoreConfigDTO = new ScoreConfigDTO();
        BeanUtils.copyProperties(scoreConfigVO, scoreConfigDTO);

        List<Integer> signInScore = scoreConfigVO.getSignInScore();
        scoreConfigDTO.setSignInScore(signInScore);

        scoreConfigDTO.setShoppingUseScoreRatio(shoppingUseScoreRatio);
        scoreConfigDTO.setUseRatioLimit(userRatioLimit);
        scoreConfigDTO.setShoppingScoreSwitch(true);

        return scoreConfigDTO;
    }
}
