/// 앨범 API 서비스 library; import '../models/album.dart'; import 'api_client.dart'; /// 앨범 목록 조회 Future> getAlbums() async { final response = await dio.get('/albums'); final List data = response.data; return data.map((json) => Album.fromJson(json)).toList(); } /// 최신 앨범 N개 조회 Future> getRecentAlbums(int count) async { final albums = await getAlbums(); return albums.take(count).toList(); } /// 앨범 상세 조회 (폴더명으로) Future getAlbumByName(String name) async { final response = await dio.get('/albums/by-name/$name'); return Album.fromJson(response.data); }