package com.ssj.service.conch.game.service;

import com.ssj.bean.sys.game.domain.Ranklist;
import com.ssj.framework.core.common.service.BaseService;
import com.ssj.framework.core.util.ResponseEntity;
import com.ssj.service.conch.game.request.RanklistReq;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Map;

/**
 * @author Mount Liu
 * @date 2018/1/22
 */
public interface RanklistService extends BaseService<Ranklist, String> {
    /**
     * 分页查询列表
     * @param params
     * @param sp
     * @return
     */
    Page<Ranklist> findByPage(Map<String, Object> params, Pageable sp);
    /**
     * 获取排行榜列表
     *
     * @param req
     * @param pageable
     * @return
     */
    ResponseEntity rankingList(RanklistReq req, Pageable pageable);

    /**
     * 保存结果
     * @param userId
     * @param score
     * @return
     */
    ResponseEntity saveResult(String userId, double score);

    /**
     * 根据用户id查询用户综合测试结果
     * @param userId 用户id
     * @return 测试结果
     */
    Ranklist findByUserId(String userId);
}
