package org.springblade.modules.martial.service.facade;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.modules.martial.pojo.dto.MiniLoginDTO;
import org.springblade.modules.martial.pojo.dto.MiniScoreSubmitDTO;
import org.springblade.modules.martial.pojo.vo.MiniAthleteScoreVO;
import org.springblade.modules.martial.pojo.vo.MiniLoginVO;
import org.springblade.modules.martial.pojo.vo.MiniScoreDetailVO;
import org.springblade.modules.martial.service.IMiniAuthService;
import org.springblade.modules.martial.service.IMiniQueryService;
import org.springblade.modules.martial.service.IMiniScoringService;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
@RequiredArgsConstructor
public class MiniAppFacade {

    private final IMiniAuthService authService;
    private final IMiniScoringService scoringService;
    private final IMiniQueryService queryService;

    public R<MiniLoginVO> login(MiniLoginDTO dto) {
        return authService.login(dto);
    }

    public R<String> logout(String token) {
        return authService.logout(token);
    }

    public R<Boolean> verifyToken(String token) {
        return authService.verifyToken(token);
    }

    public R<String> submitScore(MiniScoreSubmitDTO dto) {
        return scoringService.submitScore(dto);
    }

    public R<List<MiniAthleteScoreVO>> getAthletes(Long projectId, Long venueId) {
        return queryService.getAthletes(projectId, venueId);
    }

    public R<MiniScoreDetailVO> getScoreDetail(Long athleteId) {
        return queryService.getScoreDetail(athleteId);
    }
}
