# Conflicts: # .vscode/settings.json # lib/view/user/user_view.dart # pubspec.lockchen
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "windows-gcc-x64",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**"
|
||||||
|
],
|
||||||
|
"compilerPath": "C:/mingw64/bin/gcc.exe",
|
||||||
|
"cStandard": "${default}",
|
||||||
|
"cppStandard": "${default}",
|
||||||
|
"intelliSenseMode": "windows-gcc-x64",
|
||||||
|
"compilerArgs": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "C/C++ Runner: Debug Session",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [],
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"externalConsole": true,
|
||||||
|
"cwd": "e:/Flutter/MusicAPP/MTMusic/linux/flutter",
|
||||||
|
"program": "e:/Flutter/MusicAPP/MTMusic/linux/flutter/build/Debug/outDebug",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"miDebuggerPath": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,32 @@
|
|||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import '../models/getLikeList_bean.dart';
|
||||||
|
|
||||||
|
const String _LikesListURL = 'http://8.210.250.29:10010/likes/user-like-list';
|
||||||
|
|
||||||
|
class LikesListApi {
|
||||||
|
final Dio dio = Dio();
|
||||||
|
|
||||||
|
/// 获取用户点赞歌曲列表
|
||||||
|
Future<LikeListBean> getUserLikesList({
|
||||||
|
required String Authorization,
|
||||||
|
}) async {
|
||||||
|
try {
|
||||||
|
Response response = await dio.get(
|
||||||
|
_LikesListURL,
|
||||||
|
options: Options(
|
||||||
|
headers: {
|
||||||
|
'Authorization': Authorization,
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8'
|
||||||
|
}
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
print('点赞列表响应数据: ${response.data}');
|
||||||
|
return LikeListBean.formMap(response.data);
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
print('获取点赞列表失败: $e');
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
class LikeListBean {
|
||||||
|
int? code;
|
||||||
|
String? msg;
|
||||||
|
List<LikeListData>? data;
|
||||||
|
|
||||||
|
LikeListBean.formMap(Map map) {
|
||||||
|
code = map['code'];
|
||||||
|
msg = map['msg'];
|
||||||
|
if (map['data'] is! List) return;
|
||||||
|
|
||||||
|
data = (map['data'] as List)
|
||||||
|
.map((item) => LikeListData._formMap(item))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LikeListData {
|
||||||
|
int? id;
|
||||||
|
String? name;
|
||||||
|
String? coverPath;
|
||||||
|
String? musicPath;
|
||||||
|
String? singerName;
|
||||||
|
String? uploadUserName;
|
||||||
|
bool? likes;
|
||||||
|
bool? collection;
|
||||||
|
|
||||||
|
LikeListData._formMap(Map map) {
|
||||||
|
id = map['id'];
|
||||||
|
name = map['name'];
|
||||||
|
coverPath = map['coverPath'];
|
||||||
|
musicPath = map['musicPath'];
|
||||||
|
singerName = map['singerName'];
|
||||||
|
uploadUserName = map['uploadUserName'];
|
||||||
|
likes = map['likes'];
|
||||||
|
collection = map['collection'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换为Map方法,用于数据存储
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return {
|
||||||
|
'id': id,
|
||||||
|
'name': name,
|
||||||
|
'coverPath': coverPath,
|
||||||
|
'musicPath': musicPath,
|
||||||
|
'singerName': singerName,
|
||||||
|
'uploadUserName': uploadUserName,
|
||||||
|
'likes': likes,
|
||||||
|
'collection': collection,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|