package com.td.boss.game.complayerland.service;

import com.td.boss.common.service.CommonServiceImpl;
import com.td.boss.game.complayerland.pojo.ComPlayerDisasterProtected;
import com.td.boss.game.complayerland.repository.ComPlayerDisasterProtectedRepository;
import com.td.boss.game.complayerland.vo.ComPlayerDisasterProtectedVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class ComPlayerDisasterProtectedServiceImpl extends CommonServiceImpl<ComPlayerDisasterProtectedVo, ComPlayerDisasterProtected, String> implements ComPlayerDisasterProtectedService {
    @Autowired
    private ComPlayerDisasterProtectedRepository repository;

    /**
     * 按照用户编号获取 防护灾难 记录
     * @param userId
     * @return
     */
    public List<ComPlayerDisasterProtected> getComPlayerDisasterProtectedByUserIdOrderByProtectTimeDesc(String userId) {
        return repository.getComPlayerDisasterProtectedsByUserId(userId);
    }
}
