Revert "Add API - Get user photos (mai)"

This reverts commit e7848cb9657a796c5df8fee70aac8bffa6ce12fb.
This commit is contained in:
肥宅虾哥 2023-12-08 02:07:18 +08:00
parent ba1f458907
commit 9c51b1e0ee

View File

@ -1,8 +1,6 @@
package icu.samnyan.aqua.api.controller.sega.game.maimai2;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import icu.samnyan.aqua.api.model.MessageResponse;
import icu.samnyan.aqua.api.model.ReducedPageResponse;
import icu.samnyan.aqua.api.model.resp.sega.maimai2.ProfileResp;
@ -23,12 +21,9 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.nio.file.*;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author samnyan (privateamusement@protonmail.com)
@ -94,28 +89,6 @@ public class ApiMaimai2PlayerDataController {
return divMaxLength;
}
@GetMapping("userPhoto")
public List<String> getUserPhoto(@RequestParam long aimeId) {
List<String> matchedFiles = new ArrayList<>();
try (Stream<Path> paths = Files.walk(Paths.get("data"))) {
matchedFiles = paths
.filter(Files::isRegularFile)
.filter(path -> path.getFileName().toString().endsWith(".jpg"))
.filter(path -> {
String fileName = path.getFileName().toString();
String[] parts = fileName.split("-");
return parts.length > 0 && parts[0].equals(String.valueOf(aimeId));
})
.map(Path::getFileName)
.map(Path::toString)
.sorted()
.collect(Collectors.toList());
matchedFiles.forEach(System.out::println);
} catch (IOException e) {
}
return matchedFiles;
}
@GetMapping("profile")
public ProfileResp getProfile(@RequestParam long aimeId) {
return mapper.convert(userDataRepository.findByCard_ExtId(aimeId).orElseThrow(), new TypeReference<>() {