package com.YuyeTech.TPlat.service.impl;

import com.YuyeTech.TPlat.dataobject.Ranking;
import com.YuyeTech.TPlat.repository.RankingRepository;
import com.YuyeTech.TPlat.service.RankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author:slambb
 * @date:2020/6/23
 */
@Service
public class RankingServiceImpl implements RankingService {
    @Autowired
    private RankingRepository rankingRepository;

    @Override
    public Ranking addRanking(Ranking ranking) {
        return rankingRepository.save(ranking);
    }

    @Override
    public Ranking findRankingByUserIdAndGameIdAndCityCode(String userId, String objectId,String cityCode) {
        return rankingRepository.findByUserIdAndRObjectIdAndCityCode(userId,objectId,cityCode).orElse(null);
    }
}
