package com.red.circle.other.app.convertor.game;

import com.red.circle.other.app.dto.clientobject.game.GameRankingCO;
import com.red.circle.other.domain.game.GameRankingRecord;
import org.springframework.stereotype.Component;

/**
 * 游戏排行榜转换器.
 *
 * @author system
 */
@Component
public class GameRankingConvertor {

    /**
     * 领域对象转客户端对象.
     */
    public GameRankingCO toCO(GameRankingRecord record, Integer rank) {
        if (record == null) {
            return null;
        }

        GameRankingCO co = new GameRankingCO();
        co.setRank(rank);
        co.setGameId(record.getGameId());
        co.setGameName(record.getGameName());
        co.setGameCover(record.getGameCover());
        co.setGameUrl(record.getGameUrl());
        co.setGameOrigin(record.getGameOrigin());
        co.setSysOrigin(record.getSysOrigin());
        co.setTotalPrizeAmount(record.getTotalPrizeAmount());
        co.setPeriodType(record.getPeriodType());
        return co;
    }
}
