refactor: create MiniAppFacade
Phase 1, Step 1.5: Aggregate all mini app services - Create facade to simplify controller dependencies - Aggregate auth, scoring, and query services - Provide unified interface for controller Related to Phase 1 refactoring plan
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user